CVE-2026-139342: net: use the full socket in sk_mc_loop()

Published Nov 30, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

net: use the full socket in skmcloop()

skmcloop() is called from ipmcoutput() and ip6finishoutput2() with skb->sk, which is not always a full socket:

- Since commit ca6fb0651883 ("tcp: attach SYNACK messages to request sockets instead of listener"), a SYNACK is attached to its request socket.

- Since commit 79636038d37e ("ipv4: tcp: give socket pointer to control skbs"), an ACK or RST sent by ipsendunicastreply() on behalf of a TIMEWAIT socket is attached to the timewait socket.

When such a packet uses a multicast route, inettestbit(MCLOOP, sk) reads inetflags past the end of the request or timewait socket.

This happens for instance when a SYN with a multicast source address reaches a listener, after being looped back with its dst attached, so that iprcvfinishcore() skips the martian source check. A raw IPHDRINCL socket sending to a local address does this, as does re-injection by nft dup or the iptables TEE target. The destination can also come from a source route option, or from a route of type multicast covering a unicast prefix.

BUG: KASAN: slab-out-of-bounds in skmcloop+0x111/0x170 Read of size 8 at addr ffff88800f2b7f10 by task repro-raw/470 Call Trace: <IRQ> skmcloop+0x111/0x170 ipmcoutput+0x355/0x930 ipbuildandsendpkt+0xb87/0xc50 tcpv4sendsynack+0x500/0x6f0 tcpconnrequest+0x2135/0x2d90 tcpv4connrequest+0xa5/0x210 tcprcvstateprocess+0x136e/0x6920 tcpv4dorcv+0x339/0xb10 tcpv4rcv+0x34ab/0x3ab0 ipprotocoldeliverrcu+0x6e/0x3e0 iplocaldeliverfinish+0x34d/0x510 iplocaldeliver+0x1bc/0x310 iprcv+0x390/0x410 netifreceiveskbonecore+0x199/0x1e0 processbacklog+0x239/0x680 napipoll+0xb5/0x650 netrxaction+0x980/0xd60 handlesoftirqs+0x17f/0x590 dosoftirq+0x3f/0x60 </IRQ>

The buggy address belongs to the object at ffff88800f2b7d60 which belongs to the cache requestsockTCP of size 312 The buggy address is located 120 bytes to the right of allocated 312-byte region [ffff88800f2b7d60, ffff88800f2b7e98)

Use skconsttofullsk(), which restores the behavior from before the two commits above: a request socket uses the setting of its listener, and a timewait socket gets the default (loop back), as the per-cpu control socket used before had.

[edumazet: rewrote the changelog, added the TIMEWAIT case]

Affected Software

1 affected component
Linux Linux kernel

Event History

Nov 30, 2026
CVE Published
via MITRE·01:33 PM
Data Sourced
via MITRE·01:33 PM
Description

Frequently Asked Questions

1

Which traffic paths can trigger the out-of-bounds read?

The issue can be triggered when a packet associated with a request socket or TIME_WAIT socket uses a multicast route. One described case is a SYN with a multicast source address reaching a listener after loopback; raw IP_HDRINCL traffic sent to a local address, nft dup reinjection, and the iptables TEE target can create this condition.

2

Are only explicitly multicast destinations relevant?

No. The destination may be supplied through a source-route option, and a multicast route that covers a unicast prefix can also cause the affected path to be used.

3

What socket types are involved?

SYNACK packets can be attached to request sockets, while ACK or RST packets sent on behalf of a TIME_WAIT socket can be attached to timewait sockets. These are not full sockets, so reading multicast-loop flags from them can access memory past the object boundary.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203