linux/net/tls
Chuck Lever 976df67f46 net/tls: Fail tls_sw_splice_read() after a failed async decrypt
When an async decrypt fails, tls_decrypt_done() records the error in
ctx->async_wait.err and calls tls_err_abort(), which stores it in
sk_err. tls_sw_recvmsg() and tls_sw_read_sock() each read
async_wait.err once they hold the reader lock and fail the call: a
record that did not authenticate breaks the connection.

tls_sw_splice_read() has no such check, and sk_err does not stand in
for one. tls_rx_rec_wait() tests sk_err only inside the loop it
skips whenever a record is already parsed, and the first reader to
reach sock_error() clears it, while async_wait.err persists. A
splice therefore keeps delivering records on a connection that
recvmsg() and read_sock() refuse to read.

Read async_wait.err in tls_sw_splice_read() as the other two readers
do.

Fixes: f314bfee81 ("tls: rx: return the already-copied data on crypto error")
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
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-1-a2624005a286@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-08-11 15:39:00 +02:00
..
Kconfig tls: remove tls_toe and the related driver 2026-06-12 16:43:10 -07:00
Makefile tls: remove tls_toe and the related driver 2026-06-12 16:43:10 -07:00
tls_device_fallback.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-02-26 10:23:00 -08:00
tls_device.c tls: device: push pending open record on splice EOF 2026-07-21 14:50:50 -07:00
tls_main.c tls: remove dead sockmap (psock) handling from the SW path 2026-06-16 08:55:41 -07:00
tls_proc.c tls: snmp: do not use SNMP_MIB_SENTINEL anymore 2025-09-08 18:06:21 -07:00
tls_strp.c tls: Suppress spurious saved_data_ready on all receive paths 2026-06-08 20:10:21 -07:00
tls_sw.c net/tls: Fail tls_sw_splice_read() after a failed async decrypt 2026-08-11 15:39:00 +02:00
tls.h tls: Suppress spurious saved_data_ready on all receive paths 2026-06-08 20:10:21 -07:00
trace.c net/tls: add tracing for device/offload events 2019-10-05 16:29:00 -07:00
trace.h move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00