Bug #98529 vio->thread_id is not set in vio_reset function
Submitted: 10 Feb 2020 9:18 Modified: 5 Jan 2023 18:07
Reporter: Mario Karuza (OCA) Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Connection Handling Severity:S3 (Non-critical)
Version:8.0.19 OS:Any
Assigned to: CPU Architecture:Any

[10 Feb 2020 9:18] Mario Karuza
With SSL enabled and during authentication, new vio structure is created
via `vio_reset`. This function will not set vio->thread_id and vio->signal_mask.

Stack trace when this happens.

vio_reset(Vio * vio, enum_vio_type type, my_socket sd, void * ssl, uint flags)
ssl_do(st_VioSSLFd * ptr, Vio * vio, long timeout, ssl_handshake_func_t func, unsigned long * ssl_errno_holder, SSL ** sslptr)
sslaccept(st_VioSSLFd * ptr, Vio * vio, long timeout, unsigned long * ssl_errno_holder)
parse_client_handshake_packet(THD * thd, MPVIO_EXT * mpvio, uchar ** buff, size_t pkt_len)
server_mpvio_read_packet(MYSQL_PLUGIN_VIO * param, uchar ** buf
caching_sha2_password_authenticate(MYSQL_PLUGIN_VIO * vio, MYSQL_SERVER_AUTH_INFO * info)
do_auth_once(THD * thd, const LEX_CSTRING & auth_plugin_name, MPVIO_EXT * mpvio)
acl_authenticate(THD * thd, enum_server_command command)
check_connection(THD * thd)
login_connection(THD * thd)
thd_prepare_connection(THD * thd)
handle_connection(void * arg)
pfs_spawn_thread(void * arg)

How to repeat:
Enable SSL and authentication.
[10 Feb 2020 9:19] Mario Karuza
Suggested patch

Attachment: vio_reset.patch (text/x-patch), 508 bytes.

[10 Feb 2020 13:39] MySQL Verification Team
Hi Mr. Karuza,

Thank you for your bug report.

I find that your bug has lots of merit and that it should be verified.

However, we can not accept a patch from you, unless you become our OCA contributor.

You will find all info here below .....
[10 Feb 2020 13:39] MySQL Verification Team
Thank you very much for your patch contribution, we appreciate it!

In order for us to continue the process of reviewing your contribution to MySQL, please send us a signed copy of the Oracle Contributor Agreement (OCA) as outlined in http://www.oracle.com/technetwork/community/oca-486395.html

Signing an OCA needs to be done only once and it's valid for all other Oracle governed Open Source projects as well.

Getting a signed/approved OCA on file will help us facilitate your contribution - this one, and others in the future.  

Please let me know, if you have any questions.

Thank you for your interest in MySQL.
[11 Mar 2020 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[11 Mar 2020 13:33] MySQL Verification Team
Hi Mr. Karuza,

Is there a chance that you sign OCA agreement ???

Thanks in advance.
[24 Mar 2020 7:54] Mario Karuza
OCA is signed.
[24 Mar 2020 13:55] MySQL Verification Team
Thank you , Mr. Karuza.

Both for the report and for your contribution.

Verified as reported.
[5 Jan 2023 18:07] Stefan Hinz
Posted by developer:
Fixed in 8.0.33.
Code cleanup. No changelog entry required.
[9 Jan 2023 12:34] MySQL Verification Team
Thank you, Stefan.