bio: fix wrong wbio pointer on SSL_get_error#20919
bio: fix wrong wbio pointer on SSL_get_error#20919ihciah wants to merge 1 commit intoopenssl:masterfrom
Conversation
t8m
left a comment
There was a problem hiding this comment.
This would be acceptable with CLA: trivial. Please see https://www.openssl.org/policies/cla.html
|
In |
|
I added some |
|
Could you please split these two different changes in separate commits as they are unrelated? |
|
Also the typo in quic call is master branch only thing but the other fix should probably go into all 3.x branches (no need to do a separate PR but definitely separate commit should be done). |
So the original issue has been resolved. I will close this PR. |
@mattcaswell "in another way" means passing flags between bios, it should be done in openssl, as the PR does. I've force pushed the branch which maybe you missed it. |
|
Ah. My apologies. I misunderstood. I've reopened it and will take another look. |
|
If the fix is right, I'm willing to trying fix all similar issue in this PR :) |
| } | ||
| } | ||
| ret = BIO_ctrl(b->next_bio, cmd, num, ptr); | ||
| BIO_copy_next_retry(b); |
There was a problem hiding this comment.
The blanket calls to BIO_copy_next_retry() for all possible IO ctrls does not seem correct to me. Most of those ctrls are not "IO" related ctrls so applications would not expect the "retry" the status to change as a result. The only one where it would is in BIO_CTRL_FLUSH. So I would keep the two you have inserted in this section and remove all the others.
There was a problem hiding this comment.
@mattcaswell
Thanks! I have removed all other insertions. In the new pushed commit I also added some for other BIO_CTRL_FLUSH. Is it correct?
Co-authored-by: suikammd <suikalala@gmail.com> CLA: trivial
|
Ping @t8m @mattcaswell Can it be merged? |
|
Two approvals are required before it can be merged. |
|
@mattcaswell are you OK with CLA: trivial? Also, I wonder, should we special-case this in BIO_ctrl() actually? I.e. instead of patching all BIOs which might be also third party ones so they won't get the fix, should we instead do it automatically when BIO_ctrl() returns and the BIO_CTRL_FLUSH is used? |
|
Actually I think this maybe goes beyond CLA trivial. I think we should have a CLA for this one.
Hmm. Maybe, but that's quite ugly. It doesn't actually apply to all BIOs, only filter BIOs (because source/sink BIOs don't have a "next"). And I wonder if there are special cases where you wouldn't want this to happen. |
|
I've signed and sent the CLA pdf(also with @suikammd which is another co-auther). |
|
Close in favor of #21298 |
This PR fixed a wrong wbio pointer usage on SSL_get_error.
The bug will cause
SSL_get_errorto returnSSL_ERROR_SYSCALLeven afterBIO_set_retry_writein some cases such asBIO_CTRL_FLUSH. Without this fix, whenBIO_CTRL_FLUSH, if BIO writer gets aWOULD_BLOCKerror, it callsBIO_set_retry_writeand returns 0, it will not work and openssl will return a failure.