CVE-2026-98432: ipv4: free inet_opt and ireq_opt after an RCU grace period
In the Linux kernel, the following vulnerability has been resolved:
ipv4: free inetopt and ireqopt after an RCU grace period
tcpv4synrecvsock() transfers ownership of ireq->ireqopt to the child socket (newinet->inetopt) without copying it.
Another cpu can concurrently process a retransmitted SYN for the same request socket, and send a SYNACK from tcpcheckreq(). tcpv4sendsynack() and inetcskroutereq() read ireq->ireqopt under rcureadlock() only, and ipbuildandsendpkt() and ipoptionsbuild() then read opt->optlen twice.
Note that the SYNACK timer itself is not an issue: it holds a reference on its request socket, and inetcskreqskqueuedrop() calls timerdeletesync() before the child can be freed.
Since commit 079096f103fa ("tcp/dccp: install synrecv requests into ehash table"), request sockets are processed without holding the listener lock, so nothing prevents the child socket from being freed while the SYNACK is still being built. TCP child sockets do not have SOCKRCUFREE, and inetsockdestruct() frees inetopt with a plain kfree(), leading to a use-after-free in ipoptionsbuild().
A similar issue exists with request socket migration (net.ipv4.tcpmigratereq=1, or a BPFSKREUSEPORTSELECTORMIGRATE program). reqsktimerhandler() clones the request socket with inetreqskclone(), so that the old request socket and its clone share the same ireqopt, then reqskmigratereset() clears the pointer in the old one. Another cpu holding a reference on the old request socket can still be using these options (sending a SYNACK, or creating a child in tcpv4synrecvsock()) when the clone is freed, and tcpv4reqskdestructor() also uses a plain kfree().
Readers already use RCU, and other paths replacing inetopt (doipsetsockopt(), cipsov4socksetattr()...) already use kfreercu(). Use kfreercu() in inetsockdestruct() and tcpv4reqskdestructor() as well.
IPv6 is not affected by the first issue, because tcpv6synrecvsock() duplicates the options. tcpv6reqskdestructor() has the same migration issue with ipv6opt, which is only set by CALIPSO. This will be addressed in a separate patch.
Affected Software
Event History
Frequently Asked Questions
What traffic pattern is required to trigger the race?
The race involves a retransmitted SYN being processed for the same TCP request socket while another CPU is handling the connection request. A SYNACK can then be built using request-socket IP options after ownership has moved to the child socket and that child socket has been freed.
Which systems are exposed?
Systems running the Linux kernel that process IPv4 TCP connection requests are relevant. The affected path uses TCP request sockets, SYNACK generation, and IPv4 IP options; the description does not provide configuration or version boundaries.
How can I determine whether my kernel contains the fix?
Check the kernel source or vendor patch history for the stable commits 11a03ce3c4a62d84c10ccdfe47f8075006498568, a47406c769f72c070386985488f1c4d057df86b2, and 26d4c36d318cffbbd160884a0e4cec0da4da4936. The supplied information does not identify fixed release versions.