linux-yocto/net/tls
Pengtao He a11b8c0be6 net/tls: fix kernel panic when alloc_page failed
[ Upstream commit 491deb9b8c4ad12fe51d554a69b8165b9ef9429f ]

We cannot set frag_list to NULL pointer when alloc_page failed.
It will be used in tls_strp_check_queue_ok when the next time
tls_strp_read_sock is called.

This is because we don't reset full_len in tls_strp_flush_anchor_copy()
so the recv path will try to continue handling the partial record
on the next call but we dettached the rcvq from the frag list.
Alternative fix would be to reset full_len.

Unable to handle kernel NULL pointer dereference
at virtual address 0000000000000028
 Call trace:
 tls_strp_check_rcv+0x128/0x27c
 tls_strp_data_ready+0x34/0x44
 tls_data_ready+0x3c/0x1f0
 tcp_data_ready+0x9c/0xe4
 tcp_data_queue+0xf6c/0x12d0
 tcp_rcv_established+0x52c/0x798

Fixes: 84c61fe1a7 ("tls: rx: do not use the standard strparser")
Signed-off-by: Pengtao He <hept.hept.hept@gmail.com>
Link: https://patch.msgid.link/20250514132013.17274-1-hept.hept.hept@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-05-22 14:29:43 +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_device_fallback.c Revert "net: mirror skb frag ref/unref helpers" 2024-05-03 16:05:53 -07:00
tls_device.c tcp: add a helper for setting EOR on tail skb 2024-06-04 13:23:30 +02:00
tls_main.c net: tls: explicitly disallow disconnect 2025-04-20 10:15:06 +02:00
tls_proc.c tls: rx: add counter for NoPad violations 2022-07-11 19:48:33 -07:00
tls_strp.c net/tls: fix kernel panic when alloc_page failed 2025-05-22 14:29:43 +02:00
tls_sw.c tls: Fix tls_sw_sendmsg error handling 2025-01-17 13:40:38 +01:00
tls_toe.c tls: create an internal header 2022-07-08 18:38:45 -07:00
tls.h tls: fix lockless read of strp->msg_ready in ->poll 2024-04-25 08:32:37 -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