opnsense-src/sys/opencrypto
John Baldwin 7aee9d6c6d ktls CBC decrypt: Only increment iovec index when an entry is used
If an mbuf in the chain was skipped because it only contained bytes
from the header, the iovec index ('i') was incremented even though the
entry was not populated.  Only increment 'i' when an iovec entry is
consumed.

Add a new type of KTLS receive test which writes a single TLS record
via two separate write(2) calls over a TCP_NODELAY socket to trigger
a split in the mbuf chain in the kernel.  Test various split locations
including after the "plain" TLS header (5 bytes), after the full TLS
header, in the middle of the data payload, just before the start of
the trailer, and in the middle of the trailer.  These tests are also
run against all supported ciphers, not just CBC.  The 'header' test
for CBC ciphersuites was able to trigger the bug.

Approved by:	so
Security:	FreeBSD-SA-26:46.ktls
Security:	CVE-2026-49423
Sponsored by:	Chelsio Communications
2026-06-30 23:16:53 +02:00
..
_cryptodev.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
cbc_mac.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
cbc_mac.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
criov.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
crypto.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
cryptodeflate.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
cryptodev.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
cryptodev.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
cryptodev_if.m sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
cryptosoft.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
deflate.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
gfmult.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
gfmult.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
gmac.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
gmac.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ktls.h ktls: Remove the socket parameter to ktls_ocf_try() 2024-07-23 09:01:30 -04:00
ktls_ocf.c ktls CBC decrypt: Only increment iovec index when an entry is used 2026-06-30 23:16:53 +02:00
rmd160.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
rmd160.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
xform.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
xform_aes_cbc.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
xform_aes_icm.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
xform_aes_xts.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
xform_auth.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
xform_cbc_mac.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
xform_chacha20_poly1305.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
xform_cml.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
xform_comp.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
xform_deflate.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
xform_enc.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
xform_gmac.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
xform_null.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
xform_poly1305.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
xform_rmd160.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
xform_sha1.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
xform_sha2.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00