bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom

Summary

CVECVE-2026-143350
StatePUBLISHED
AssignerLinux
Source PriorityCVE Program / NVD first with legacy fallback
Published2026-12-03 10:18:23 UTC
Updated2026-12-03 10:18:23 UTC
DescriptionIn the Linux kernel, the following vulnerability has been resolved: bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom When an LWT xmit program returns BPF_OK, bpf_xmit() makes sure that the skb still has room for the link layer header. If pskb_expand_head() fails there, bpf_xmit() returns -ENOMEM without freeing the skb. Its callers, lwtunnel_xmit() and then ip_finish_output2() or ip6_finish_output2(), take any return value other than LWTUNNEL_XMIT_CONTINUE to mean that the skb has been consumed, so nothing frees it. Each such failure leaks the skb, together with what it holds: its dst and its charge to the sending socket, so the socket is never freed either. The other error paths of bpf_xmit() (BPF_DROP, an illegal return code, a changed protocol, a failed reroute) all free the skb. Free it here too. The leak was found with kbound, a static analysis prototype for ownership mismatches at kernel interfaces, on v7.2.12; it is present in mainline. Build-tested with x86_64 and arm64 allmodconfig (W=1, sparse): no new warnings. Run-tested on QEMU (x86_64, KVM) with KASAN: a route through a dummy device with an LWT xmit program that pushes one byte with bpf_skb_change_head(), so the headroom check has to expand the head, and failslab limited to allocations under bpf_xmit(). Each of 10 pings then fails with ENOMEM. Without this patch each leaves a raw socket behind (RAW slab objects 6 -> 16); with it none does (6 -> 6), and nothing else is reported. Without injection both kernels go from 6 to 6.

Risk And Classification

EPSS: 0.003790000 probability, percentile 0.340060000 (date 2026-12-03)

Vendor Declared Affected Products

SourceVendorProductVersionPlatforms
CNA Linux Linux affected 3a0af8fd61f90920f6fa04e4f1e9a6a73c1b4fd2 28aaef6f21fe0288bd7f0472af07df30df89647d git Not specified
CNA Linux Linux affected 3a0af8fd61f90920f6fa04e4f1e9a6a73c1b4fd2 e874c6f8d3dd0369764b44db40b01011821cfadc git Not specified
CNA Linux Linux affected 3a0af8fd61f90920f6fa04e4f1e9a6a73c1b4fd2 02315d8352c9dc80075a6cfa493f62369324ec4c git Not specified
CNA Linux Linux affected 3a0af8fd61f90920f6fa04e4f1e9a6a73c1b4fd2 5fe7b2bdf2784d5b3614208d4f9d0c37a5137f9a git Not specified
CNA Linux Linux affected 3a0af8fd61f90920f6fa04e4f1e9a6a73c1b4fd2 eeb76b21f13aea28d9123feaeaf03cde7db681c0 git Not specified
CNA Linux Linux affected 3a0af8fd61f90920f6fa04e4f1e9a6a73c1b4fd2 5e96760b25fdedbbf9312827f1f237d6b18b03e8 git Not specified
CNA Linux Linux affected 4.10 Not specified
CNA Linux Linux unaffected 4.10 semver Not specified
CNA Linux Linux unaffected 5.10.276 5.10.* semver Not specified
CNA Linux Linux unaffected 5.15.227 5.15.* semver Not specified
CNA Linux Linux unaffected 6.12.120 6.12.* semver Not specified
CNA Linux Linux unaffected 6.18.66 6.18.* semver Not specified
CNA Linux Linux unaffected 7.3.7 7.3.* semver Not specified
CNA Linux Linux unaffected 7.4-rc2 * original_commit_for_fix Not specified

References

ReferenceSourceLinkTags
git.kernel.org/stable/c/02315d8352c9dc80075a6cfa493f62369324ec4c 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/28aaef6f21fe0288bd7f0472af07df30df89647d 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/eeb76b21f13aea28d9123feaeaf03cde7db681c0 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/5fe7b2bdf2784d5b3614208d4f9d0c37a5137f9a 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/5e96760b25fdedbbf9312827f1f237d6b18b03e8 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/e874c6f8d3dd0369764b44db40b01011821cfadc 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
CVE Program record CVE.ORG www.cve.org canonical
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis

© CVE.report 2026

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report