Replies: 1 comment
-
|
For a BIO installed with The issue is in libssl TLS record write path: it calls There an issue #31009 opened for this and I have opened PR #31021 to address it. The fix treats |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We have a custom BIO registered via BIO_meth_set_write_ex() to integrate openssl with seastar's async IO. When a write on the BIO fails with EPIPE, we return 0 from our bwrite callback, following the BIO_meth_new documentation:
BIO_read documents BIO_write_ex() as returning 1 on success and 0 on failure:
When our bwrite returns 0 without setting BIO_should_retry, we observe that SSL_write_ex incorrectly reports success. Here is a concrete timeline:
Tracing through the code (3.5.5), bio_write_intern (crypto/bio/bio_lib.c) passes our 0 return through unchanged, which means that a call to BIO_write in this scenario returns 0:
openssl/crypto/bio/bio_lib.c
Lines 342 to 400 in 9ca063a
Then in tls_retry_write_records (ssl/record/methods/tls_common.c:1934), this scenario lands on the success case on L1887:
openssl/ssl/record/methods/tls_common.c
Lines 1880 to 1887 in 9ca063a
BIO_write returning 0 passes the if (i >= 0) check and is classified as success.
The read side appears to have had a similar issue, fixed in commit be42447 ("Fix the converters between the old and new BIO_read functions to handle end-of-file state properly").
Questions:
Beta Was this translation helpful? Give feedback.
All reactions