Bug 251969 - security/openssl: fix ktls sendfile error reporting
Summary: security/openssl: fix ktls sendfile error reporting
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Bernard Spil
URL:
Keywords: buildisok
Depends on:
Blocks:
 
Reported: 2020-12-20 00:57 UTC by Oleksandr Tymoshenko
Modified: 2021-02-26 21:45 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (brnrd)


Attachments
openssl-ktls-ebusy-fix.patch (499 bytes, patch)
2020-12-20 00:57 UTC, Oleksandr Tymoshenko
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oleksandr Tymoshenko freebsd_committer freebsd_triage 2020-12-20 00:57:17 UTC
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.
Comment 1 Bernard Spil freebsd_committer freebsd_triage 2020-12-20 11:32:42 UTC
Thanks gonzo!

Have you reported this upstream too? Can't find it in Pull Requests or in master branch of github.com/openssl/openssl
Comment 2 Oleksandr Tymoshenko freebsd_committer freebsd_triage 2020-12-20 19:09:19 UTC
(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.
Comment 3 Automation User 2021-01-04 00:09:38 UTC
Build and package info is available at https://gitlab.com/swills/freebsd-ports/pipelines/236840888
Comment 4 commit-hook freebsd_committer freebsd_triage 2021-02-17 22:54:00 UTC
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(-)
Comment 5 commit-hook freebsd_committer freebsd_triage 2021-02-18 09:23:23 UTC
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
Comment 6 commit-hook freebsd_committer freebsd_triage 2021-02-26 00:36:51 UTC
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(-)
Comment 7 commit-hook freebsd_committer freebsd_triage 2021-02-26 21:37:17 UTC
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(-)