HIGH Introduced in 6.0
ipv6 FragGap OOB Write
CVE-2026-53362
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: ipv6: account for fraggap on the paged allocation path In __ip6_append_data(), when the paged-allocation branch is taken (MSG_MORE / NETIF_F_SG / large fraglen), alloclen and pagedlen are computed as alloclen = fragheaderlen + transhdrlen; pagedlen = datalen - transhdrlen; datalen already includes fraggap (datalen = length + fraggap). When fraggap is non-zero, this is not the first skb and transhdrlen is zero. The fraggap bytes carried over from the previous skb are copied just past the fragment headers in the new skb's linear area. The linear area is therefore undersized by fraggap bytes while pagedlen is overstated by the same amount, and the copy writes past skb->end into the trailing skb_shared_info. An unprivileged user can trigger this via a UDPv6 socket using MSG_MORE together with MSG_SPLICE_PAGES. The bad accounting was introduced by commit 773ba4fe9104 ("ipv6: avoid partial copy for zc"). Before commit ce650a166335 ("udp6: Fix __ip6_append_data()'s handling of MSG_SPLICE_PAGES"), the negative copy value caused -EINVAL to be returned. That later commit allowed MSG_SPLICE_PAGES to proceed in this case, making the corruption triggerable. The non-paged branch sets alloclen to fraglen, which already accounts for fraggap because datalen does. Bring the paged branch in line by adding fraggap to alloclen and subtracting it from pagedlen. After this adjustment, copy no longer collapses to -fraggap on the paged path, so remove the stale comment describing that old arithmetic. Since a negative copy is no longer expected for a valid MSG_SPLICE_PAGES case, remove the MSG_SPLICE_PAGES exception from the negative copy check.
02KernelScan AI Analysis
Risk summary
An unprivileged local user can trigger a heap out-of-bounds write in the IPv6 output path by sending UDPv6 data with MSG_MORE and MSG_SPLICE_PAGES flags. The write corrupts the skb_shared_info structure trailing the socket buffer, enabling potential privilege escalation or kernel code execution. The bug is reachable without any special privileges on systems with IPv6 enabled.
Vulnerability analysis
The root cause is an accounting error in __ip6_append_data() in the paged-allocation branch (taken when MSG_MORE, NETIF_F_SG, or large fraglen is in use). When fraggap is non-zero (bytes carried over from a previous skb), datalen already includes fraggap, but alloclen was computed as fragheaderlen + transhdrlen (omitting fraggap), while pagedlen was set to datalen - transhdrlen (overstating by fraggap). This means the linear area of the new skb is undersized by fraggap bytes, and the subsequent memcpy of fraggap bytes past the fragment headers writes beyond skb->end into the trailing skb_shared_info structure — a classic heap out-of-bounds write. The fix adds fraggap to alloclen and subtracts it from pagedlen, bringing the paged branch in line with the non-paged branch. The bug was introduced in commit 773ba4fe9104 and became exploitable after commit ce650a166335 removed the -EINVAL guard for MSG_SPLICE_PAGES. An unprivileged user can trigger this via a UDPv6 socket using MSG_MORE followed by MSG_SPLICE_PAGES, requiring no special capabilities. The corruption of skb_shared_info is a strong heap corruption primitive that, with appropriate grooming (AC:High), can lead to privilege escalation and container escape.
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.1 | 6.0 | 6.1.177 | 14200d435af9 |
| 6.12 | 6.0 | 6.12.95 | 46f201f8b4c3 |
| 6.18 | 6.0 | 6.18.38 | 6374fb9edf72 |
| 6.6 | 6.0 | 6.6.144 | 65fb14cbebb0 |
| 7.1 | 6.0 | 7.1.3 | e9eacf19281e |
| mainline | 6.0 | 7.2-rc1 | 736b380e28d0 |