CVE-2022-49372 Information
Description
In the Linux kernel the following vulnerability has been resolved:
tcp: tcp_rtx_synack() can be called from process context
Laurent reported the enclosed report [1]
This bug triggers with following coditions:
-
Kernel built with CONFIG_DEBUG_PREEMPT=y
-
A new passive FastOpen TCP socket is created. This FO socket waits for an ACK coming from client to be a complete ESTABLISHED one.
-
A socket operation on this socket goes through lock_sock() release_sock() dance.
-
While the socket is owned by the user in step 2) a retransmit of the SYN is received and stored in socket backlog.
-
At release_sock() time the socket backlog is processed while in process context.
-
A SYNACK packet is cooked in response of the SYN retransmit.
-
-> tcp_rtx_synack() is called in process context.
Before blamed commit tcp_rtx_synack() was always called from BH handler from a timer handler.
Fix this by using TCP_INC_STATS() & NET_INC_STATS() which do not assume caller is in non preemptible context.
[1]
BUG: using __this_cpu_add() in preemptible [00000000] code: epollpep/2180
caller is tcp_rtx_synack.part.0+0x36/0xc0
CPU: 10 PID: 2180 Comm: epollpep Tainted: G OE 5.16.0-0.bpo.4-amd64 1 Debian 5.16.12-1~bpo11+1
Hardware name: Supermicro SYS-5039MC-H8TRF/X11SCD-F BIOS 1.7 11/23/2021
Call Trace:
Reference
https://git.kernel.org/stable/c/0a0f7f84148445c9f02f226928803a870139d820 https://git.kernel.org/stable/c/0a375c822497ed6ad6b5da0792a12a6f1af10c0b https://git.kernel.org/stable/c/3db889f883e65bbd3b1401279bfc1e9ed255c481 https://git.kernel.org/stable/c/58bd38cbc961fd799842b7be8c5222310f04b908 https://git.kernel.org/stable/c/88cd232146207ff1d41dededed5e77c0d4438113 https://git.kernel.org/stable/c/bdc28a8fb43cc476e33b11519235adb816ce00e8 https://git.kernel.org/stable/c/c348b0f8d035fc4bdc040796889beec7218bd1b8 https://git.kernel.org/stable/c/d05c2fdf8e10528bb6751bd95243e862d5402a9b https://git.kernel.org/stable/c/d8e1bc6029acac796293310aacef7b7336f35b6a
Share on: