linux/net/tls
Chuck Lever 3be28e2c9c net/tls: Consume empty data records in tls_sw_read_sock()
A peer may send a zero-length TLS application_data record; TLS 1.3
explicitly permits these as a traffic-analysis countermeasure (RFC
8446, Section 5.1). After decryption such a record has full_len ==
0. tls_sw_read_sock() hands it to the read_actor, which has no
payload to consume and returns zero. The loop treats a zero return
as backpressure (used <= 0), requeues the skb at the head of
rx_list, and stops. rx_list is serviced head-first on the next
call, so the empty record is dequeued, fails the same way, and is
requeued again; every later record on the connection is blocked
behind it.

tls_sw_recvmsg() does not stall on this: a zero-length data record
copies nothing and falls through to consume_skb(). Mirror that in
the read_sock() path by recognizing an empty data record before
the actor runs, consuming it, and continuing.

Fixes: 662fbcec32 ("net/tls: implement ->read_sock()")
Signed-off-by: Chuck Lever <cel@kernel.org>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Link: https://patch.msgid.link/20260630191551.875664-1-cel@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-07 10:12:11 +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 net: tls: reshuffle the device ops check 2026-05-01 16:46:30 -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: Consume empty data records in tls_sw_read_sock() 2026-07-07 10:12:11 +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