linux/net/tls
Jakub Kicinski 0aeb54ac4c tls: make sure to abort the stream if headers are bogus
Normally we wait for the socket to buffer up the whole record
before we service it. If the socket has a tiny buffer, however,
we read out the data sooner, to prevent connection stalls.
Make sure that we abort the connection when we find out late
that the record is actually invalid. Retrying the parsing is
fine in itself but since we copy some more data each time
before we parse we can overflow the allocated skb space.

Constructing a scenario in which we're under pressure without
enough data in the socket to parse the length upfront is quite
hard. syzbot figured out a way to do this by serving us the header
in small OOB sends, and then filling in the recvbuf with a large
normal send.

Make sure that tls_rx_msg_size() aborts strp, if we reach
an invalid record there's really no way to recover.

Reported-by: Lee Jones <lee@kernel.org>
Fixes: 84c61fe1a7 ("tls: rx: do not use the standard strparser")
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://patch.msgid.link/20250917002814.1743558-1-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2025-09-18 12:43:54 +02:00
..
Kconfig net: skbuff: generalize the skb->decrypted bit 2024-04-06 17:34:31 +01:00
Makefile tls: rx: async: hold onto the input skb 2022-07-18 11:24:11 +01:00
tls.h tls: make sure to abort the stream if headers are bogus 2025-09-18 12:43:54 +02:00
tls_device.c tcp: move icsk_clean_acked to a better location 2025-03-24 09:55:18 -07:00
tls_device_fallback.c net/tls: use the new scatterwalk functions 2025-03-02 15:19:44 +08:00
tls_main.c net: tls: explicitly disallow disconnect 2025-04-08 11:38:49 +02:00
tls_proc.c tls: add counters for rekey 2024-12-16 12:47:30 +00:00
tls_strp.c tls: make sure to abort the stream if headers are bogus 2025-09-18 12:43:54 +02:00
tls_sw.c tls: make sure to abort the stream if headers are bogus 2025-09-18 12:43:54 +02:00
tls_toe.c tls: create an internal header 2022-07-08 18:38:45 -07:00
trace.c
trace.h move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00