]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests: tls: cover splice after a failed decrypt
authorChuck Lever <cel@kernel.org>
Fri, 7 Aug 2026 00:44:08 +0000 (20:44 -0400)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 11 Aug 2026 13:39:00 +0000 (15:39 +0200)
commit8a422297391328b8128e5f6b7e1c49b0240ffa82
tree0fd46ea753d432a7eb993fda696f9c69a0915459
parent976df67f463db1fddaf2a32fb04f57ad2891a23d
selftests: tls: cover splice after a failed decrypt

Nothing in this file splices a socket whose last decrypt failed, so
the check that fails tls_sw_splice_read() on a broken connection can
be removed without a test noticing. Such a splice hands the
application plaintext that recvmsg() and read_sock() already refuse
to return.

Extend the bad_auth pattern. Corrupt an authenticated record, confirm
recvmsg() reports EBADMSG, then splice the same socket and require
EBADMSG again. A synchronous decrypt fails again on the still-queued
record, so only an async decrypt reaches EBADMSG through the
recorded-failure check alone.

bad_auth builds the same corrupted record, so its construction moves
into a helper the two tests share.

Signed-off-by: Chuck Lever <cel@kernel.org>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Link: https://patch.msgid.link/20260806-tls-splice-crypto-fix-v1-2-a2624005a286@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tools/testing/selftests/net/tls.c