I recently upgraded from 15.0-RELEASE-p9 to 15.0-RELEASE-p10 and a ktls test I have running as part of a software build for several years stopped working. This test simply creates a local TLS connection and sends some data to and from the peers. The test uses openssl (base) with SSL_OP_ENABLE_KTLS such that ktls is used if enabled (which it has been for several years). Since the kernel upgrade I get a EBADMSG error in the server when reading the initial data sent from the client. Note that if I dont set SSL_OP_ENABLE_KTLS on either end of the connection the test works fine. It also works fine for kern.ipc.tls.enable=0
The was broken in commit https://cgit.freebsd.org/src/commit/?id=540a315cdb46d6aa3cdbb3797710db652b3c4f4a
^Triage: Cc: committer in question.
Are you able to test patches? If so, does this fix the problem? https://reviews.freebsd.org/D57557
(In reply to Mark Johnston from comment #3) Yes! This does fix it, I applied it directly to the tree at the broken commit (since I had that built)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=815976ee14121bafe8a8ab002459d32f8928f2de commit 815976ee14121bafe8a8ab002459d32f8928f2de Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2026-07-29 18:45:36 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2026-07-29 19:30:37 +0000 ktls: Propagate EPG_FLAG_ANON to mapped mbufs Otherwise ktls_mbuf_crypto_state() will reject mbufs created by _mb_unmapped_to_ext(), which arises when transmitting packets through an interface that doesn't support unmapped mbufs, and the loopback interface in particular. PR: 296498 Fixes: 3444414cb463 ("ktls: Don't attempt to modify non-anonymous mbufs on the receive path") Reviewed by: gallatin, jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57557 sys/kern/kern_mbuf.c | 3 +++ sys/kern/uipc_ktls.c | 3 ++- sys/sys/mbuf.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=0af1065b3a5721a9e5433622dcc8a7adb96ad2ed commit 0af1065b3a5721a9e5433622dcc8a7adb96ad2ed Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2026-07-29 18:45:36 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2026-08-05 15:15:14 +0000 ktls: Propagate EPG_FLAG_ANON to mapped mbufs Otherwise ktls_mbuf_crypto_state() will reject mbufs created by _mb_unmapped_to_ext(), which arises when transmitting packets through an interface that doesn't support unmapped mbufs, and the loopback interface in particular. PR: 296498 Fixes: 3444414cb463 ("ktls: Don't attempt to modify non-anonymous mbufs on the receive path") Reviewed by: gallatin, jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57557 (cherry picked from commit 815976ee14121bafe8a8ab002459d32f8928f2de) sys/kern/kern_mbuf.c | 3 +++ sys/kern/uipc_ktls.c | 3 ++- sys/sys/mbuf.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-)
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=9d2e5039ee18eb9545b26a8934e650c1f06139cb commit 9d2e5039ee18eb9545b26a8934e650c1f06139cb Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2026-07-29 18:45:36 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2026-08-06 13:24:43 +0000 ktls: Propagate EPG_FLAG_ANON to mapped mbufs Otherwise ktls_mbuf_crypto_state() will reject mbufs created by _mb_unmapped_to_ext(), which arises when transmitting packets through an interface that doesn't support unmapped mbufs, and the loopback interface in particular. PR: 296498 Fixes: 3444414cb463 ("ktls: Don't attempt to modify non-anonymous mbufs on the receive path") Reviewed by: gallatin, jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57557 (cherry picked from commit 815976ee14121bafe8a8ab002459d32f8928f2de) sys/kern/kern_mbuf.c | 3 +++ sys/kern/uipc_ktls.c | 3 ++- sys/sys/mbuf.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-)
This seems like it was MFC'd, but I'm still experiencing the problem. Noticed that pkg was complaining about bad checksums from my poudriere builds and finally narrowed it down to this issue. Turning off ktls or using HTTP/2 in lighttpd "bypasses" the issue.
Its not in Its not in 15.1-RELEASE-p3