tcp: fix potential race in tcp_v6_syn_recv_sock()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 · < fe89b2f05b854847784f91127319172945c1fadd| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
tcp: fix potential race in tcp_v6_syn_recv_sock()
Code in tcp_v6_syn_recv_sock() after the call to tcp_v4_syn_recv_sock() is done too late.
After tcp_v4_syn_recv_sock(), the child socket is already visible from TCP ehash table and other cpus might use it.
Since newinet->pinet6 is still pointing to the listener ipv6_pinfo bad things can happen as syzbot found.
Move the problematic code in tcp_v6_mapped_child_init() and call this new helper from tcp_v4_syn_recv_sock() before the ehash insertion.
This allows the removal of one tcp_sync_mss(), since tcp_v4_syn_recv_sock() will call it with the correct context.
From the CVE record · Linux
The Linux kernel has a race in tcp_v6_syn_recv_sock(): a child socket can become visible to other CPUs before its IPv6 state is initialized. The issue can arise during TCP connection setup, but the input does not establish a specific attacker outcome or state whether authentication or user interaction is required.
Engineers running the Linux kernel should check their versions; affected versions are not specified.