Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CONC-693 Fix SSL_read/write return value checking in ma_tls_async_check_result #243

Open
wants to merge 1 commit into
base: 3.1
Choose a base branch
from

Conversation

joshuahunt
Copy link

SSL_{read,write}'s return values == 0 signify the operation was unsuccessful, but here it's being treated as success. Other calls of these functions already properly checks the return value.

Please note I found this through code inspection while trying to debug a different issue. I do not have a case where this can be hit, but in principle this should be fixed. Link to openssl man page showing return values <= 0 signify an error https://www.openssl.org/docs/manmaster/man3/SSL_read.html

@joshuahunt
Copy link
Author

joshuahunt commented Mar 28, 2024

It looks like this commit fixed the problem for ma_tls_read() but missed it for ma_tls_async_check_result() @9E0R9

commit f1b08b836931daf5b20405b567a6dee2d6a89400
Author: Georg Richter <[email protected]>
Date:   Fri Jul 8 07:46:00 2022 +0200

    Partial fix for MDEV-27405:
    
    The return value of SSL_read indicates an error if it is <= 0, not
    if it is < 0.

@vuvova vuvova changed the title Fix SSL_read/write return value checking in ma_tls_async_check_result CONC-693 Fix SSL_read/write return value checking in ma_tls_async_check_result Apr 11, 2024
@9EOR9
Copy link
Collaborator

9EOR9 commented Apr 11, 2024

Thanks for your pull request! Could you please provide the PR against 3.1 branch (still included in Server 10.5), I will then merge it from 3.1 into 3.4 (3.3 will be disontinued).

@joshuahunt joshuahunt force-pushed the johunt/fix-async-check-result branch from ee29dfa to 2667a76 Compare April 12, 2024 04:02
@joshuahunt
Copy link
Author

Thanks for your pull request! Could you please provide the PR against 3.1 branch (still included in Server 10.5), I will then merge it from 3.1 into 3.4 (3.3 will be disontinued).

OK I rebased it on top of 3.1. Please let me know if there's anything else you need me to do.

@joshuahunt joshuahunt changed the base branch from 3.3 to 3.1 April 19, 2024 01:41
SSL_{read,write}'s return values == 0 signify the operation was
unsuccessful, but here it's being treated as success. Other calls of
these functions already properly checks the return value.

Signed-off-by: Josh Hunt <[email protected]>
@joshuahunt joshuahunt force-pushed the johunt/fix-async-check-result branch from 2667a76 to cb3fb01 Compare April 19, 2024 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants