Created attachment 220726 [details] openssl-ktls-ebusy-fix.patch Add a handler for EBUSY sendfile error in addition to EAGAIN. Even if sendfile returns EBUSY the data can be partially sent and user code has to be notified about it, otherwise it may try to send data multiple times.
Thanks gonzo! Have you reported this upstream too? Can't find it in Pull Requests or in master branch of github.com/openssl/openssl
(In reply to Bernard Spil from comment #1) Ah, overlooked that part. Created a pull request to the upstream and added link to See Also.
Build and package info is available at https://gitlab.com/swills/freebsd-ports/pipelines/236840888
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=9b2f020c14af71a2606012143432dd717c7cf90e commit 9b2f020c14af71a2606012143432dd717c7cf90e Author: Oleksandr Tymoshenko <gonzo@FreeBSD.org> AuthorDate: 2021-02-17 22:49:30 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2021-02-17 22:51:55 +0000 Handle partial data re-sending on ktls/sendfile on FreeBSD Add a handler for EBUSY sendfile error in addition to EAGAIN. With EBUSY returned the data still can be partially sent and user code has to be notified about it, otherwise it may try to send data multiple times. PR: 251969 Reviewed by: jkim Obtained from: OpenSSL (dfcfd17f2818cf520ce6381aed9ec3d2fc12170d) MFC after: 1 week Sponsored by: Netflix (merging to FreeBSD) Differential Revision: https://reviews.freebsd.org/D28714 crypto/openssl/doc/man3/SSL_write.pod | 3 ++- crypto/openssl/include/internal/ktls.h | 9 +++------ 2 files changed, 5 insertions(+), 7 deletions(-)
A commit references this bug: Author: brnrd Date: Thu Feb 18 09:22:42 UTC 2021 New revision: 565914 URL: https://svnweb.freebsd.org/changeset/ports/565914 Log: security/openssl: Update KTLS patch PR: 251969 Submitted by: gonzo, jhb Obtained from: https://github.com/openssl/openssl/commit/dfcfd17f2818cf520ce6381aed9ec3d2fc12170d Differential Revision: https://reviews.freebsd.org/D28763 Changes: head/security/openssl/Makefile head/security/openssl/files/extra-patch-ktls
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=63241a0764c9414e1bcce3bcb05bfbdba8f1f487 commit 63241a0764c9414e1bcce3bcb05bfbdba8f1f487 Author: Oleksandr Tymoshenko <gonzo@FreeBSD.org> AuthorDate: 2021-02-17 22:49:30 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2021-02-25 22:45:41 +0000 Handle partial data re-sending on ktls/sendfile on FreeBSD Add a handler for EBUSY sendfile error in addition to EAGAIN. With EBUSY returned the data still can be partially sent and user code has to be notified about it, otherwise it may try to send data multiple times. PR: 251969 Obtained from: OpenSSL (dfcfd17f2818cf520ce6381aed9ec3d2fc12170d) Sponsored by: Netflix (merging to FreeBSD) (cherry picked from commit 9b2f020c14af71a2606012143432dd717c7cf90e) crypto/openssl/doc/man3/SSL_write.pod | 3 ++- crypto/openssl/include/internal/ktls.h | 9 +++------ 2 files changed, 5 insertions(+), 7 deletions(-)
A commit in branch releng/13.0 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=9745047839225ede45594ae4ec2b26df6bafbd22 commit 9745047839225ede45594ae4ec2b26df6bafbd22 Author: Oleksandr Tymoshenko <gonzo@FreeBSD.org> AuthorDate: 2021-02-17 22:49:30 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2021-02-26 21:35:05 +0000 Handle partial data re-sending on ktls/sendfile on FreeBSD Add a handler for EBUSY sendfile error in addition to EAGAIN. With EBUSY returned the data still can be partially sent and user code has to be notified about it, otherwise it may try to send data multiple times. PR: 251969 Approved by: re (gjb) Obtained from: OpenSSL (dfcfd17f2818cf520ce6381aed9ec3d2fc12170d) Sponsored by: Netflix (merging to FreeBSD) (cherry picked from commit 9b2f020c14af71a2606012143432dd717c7cf90e) (cherry picked from commit 63241a0764c9414e1bcce3bcb05bfbdba8f1f487) crypto/openssl/doc/man3/SSL_write.pod | 3 ++- crypto/openssl/include/internal/ktls.h | 9 +++------ 2 files changed, 5 insertions(+), 7 deletions(-)