{"id":"CVE-2026-143350","state":"PUBLISHED","title":"bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom\n\nWhen an LWT xmit program returns BPF_OK, bpf_xmit() makes sure that\nthe skb still has room for the link layer header. If\npskb_expand_head() fails there, bpf_xmit() returns -ENOMEM without\nfreeing the skb. Its callers, lwtunnel_xmit() and then\nip_finish_output2() or ip6_finish_output2(), take any return value\nother than LWTUNNEL_XMIT_CONTINUE to mean that the skb has been\nconsumed, so nothing frees it.\n\nEach such failure leaks the skb, together with what it holds: its dst\nand its charge to the sending socket, so the socket is never freed\neither. The other error paths of bpf_xmit() (BPF_DROP, an illegal\nreturn code, a changed protocol, a failed reroute) all free the skb.\n\nFree it here too.\n\nThe leak was found with kbound, a static analysis prototype for\nownership mismatches at kernel interfaces, on v7.2.12; it is present in\nmainline.\n\nBuild-tested with x86_64 and arm64 allmodconfig (W=1, sparse): no new\nwarnings. Run-tested on QEMU (x86_64, KVM) with KASAN: a route through a\ndummy device with an LWT xmit program that pushes one byte with\nbpf_skb_change_head(), so the headroom check has to expand the head, and\nfailslab limited to allocations under bpf_xmit(). Each of 10 pings then\nfails with ENOMEM. Without this patch each leaves a raw socket behind\n(RAW slab objects 6 -> 16); with it none does (6 -> 6), and nothing else\nis reported. Without injection both kernels go from 6 to 6.","publishedAt":"2026-12-03T09:22:07.726Z","updatedAt":"2026-12-03T09:22:07.726Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"3a0af8fd61f90920f6fa04e4f1e9a6a73c1b4fd2","status":"affected","lessThan":"28aaef6f21fe0288bd7f0472af07df30df89647d","versionType":"git"},{"version":"3a0af8fd61f90920f6fa04e4f1e9a6a73c1b4fd2","status":"affected","lessThan":"e874c6f8d3dd0369764b44db40b01011821cfadc","versionType":"git"},{"version":"3a0af8fd61f90920f6fa04e4f1e9a6a73c1b4fd2","status":"affected","lessThan":"02315d8352c9dc80075a6cfa493f62369324ec4c","versionType":"git"},{"version":"3a0af8fd61f90920f6fa04e4f1e9a6a73c1b4fd2","status":"affected","lessThan":"5fe7b2bdf2784d5b3614208d4f9d0c37a5137f9a","versionType":"git"},{"version":"3a0af8fd61f90920f6fa04e4f1e9a6a73c1b4fd2","status":"affected","lessThan":"eeb76b21f13aea28d9123feaeaf03cde7db681c0","versionType":"git"},{"version":"3a0af8fd61f90920f6fa04e4f1e9a6a73c1b4fd2","status":"affected","lessThan":"5e96760b25fdedbbf9312827f1f237d6b18b03e8","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/core/lwt_bpf.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.10","versionType":"semver"},{"version":"5.10.276","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.227","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.12.120","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/core/lwt_bpf.c"]}],"references":["https://git.kernel.org/stable/c/28aaef6f21fe0288bd7f0472af07df30df89647d","https://git.kernel.org/stable/c/e874c6f8d3dd0369764b44db40b01011821cfadc","https://git.kernel.org/stable/c/02315d8352c9dc80075a6cfa493f62369324ec4c","https://git.kernel.org/stable/c/5fe7b2bdf2784d5b3614208d4f9d0c37a5137f9a","https://git.kernel.org/stable/c/eeb76b21f13aea28d9123feaeaf03cde7db681c0","https://git.kernel.org/stable/c/5e96760b25fdedbbf9312827f1f237d6b18b03e8"],"weaknesses":[],"ingestedAt":"2026-12-03T09:44:04.436Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/143xxx/CVE-2026-143350.json","commit":"9e309c7c0f08856e2558a1df33f75dca027fab70","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-143350","state":"PUBLISHED","datePublished":"2026-12-03T09:22:07.726Z","dateUpdated":"2026-12-03T09:22:07.726Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-12-03T03:10:28.368Z"},"containers":{"cna":{"title":"bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom\n\nWhen an LWT xmit program returns BPF_OK, bpf_xmit() makes sure that\nthe skb still has room for the link layer header. If\npskb_expand_head() fails there, bpf_xmit() returns -ENOMEM without\nfreeing the skb. Its callers, lwtunnel_xmit() and then\nip_finish_output2() or ip6_finish_output2(), take any return value\nother than LWTUNNEL_XMIT_CONTINUE to mean that the skb has been\nconsumed, so nothing frees it.\n\nEach such failure leaks the skb, together with what it holds: its dst\nand its charge to the sending socket, so the socket is never freed\neither. The other error paths of bpf_xmit() (BPF_DROP, an illegal\nreturn code, a changed protocol, a failed reroute) all free the skb.\n\nFree it here too.\n\nThe leak was found with kbound, a static analysis prototype for\nownership mismatches at kernel interfaces, on v7.2.12; it is present in\nmainline.\n\nBuild-tested with x86_64 and arm64 allmodconfig (W=1, sparse): no new\nwarnings. Run-tested on QEMU (x86_64, KVM) with KASAN: a route through a\ndummy device with an LWT xmit program that pushes one byte with\nbpf_skb_change_head(), so the headroom check has to expand the head, and\nfailslab limited to allocations under bpf_xmit(). Each of 10 pings then\nfails with ENOMEM. Without this patch each leaves a raw socket behind\n(RAW slab objects 6 -> 16); with it none does (6 -> 6), and nothing else\nis reported. Without injection both kernels go from 6 to 6."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"3a0af8fd61f90920f6fa04e4f1e9a6a73c1b4fd2","status":"affected","lessThan":"28aaef6f21fe0288bd7f0472af07df30df89647d","versionType":"git"},{"version":"3a0af8fd61f90920f6fa04e4f1e9a6a73c1b4fd2","status":"affected","lessThan":"e874c6f8d3dd0369764b44db40b01011821cfadc","versionType":"git"},{"version":"3a0af8fd61f90920f6fa04e4f1e9a6a73c1b4fd2","status":"affected","lessThan":"02315d8352c9dc80075a6cfa493f62369324ec4c","versionType":"git"},{"version":"3a0af8fd61f90920f6fa04e4f1e9a6a73c1b4fd2","status":"affected","lessThan":"5fe7b2bdf2784d5b3614208d4f9d0c37a5137f9a","versionType":"git"},{"version":"3a0af8fd61f90920f6fa04e4f1e9a6a73c1b4fd2","status":"affected","lessThan":"eeb76b21f13aea28d9123feaeaf03cde7db681c0","versionType":"git"},{"version":"3a0af8fd61f90920f6fa04e4f1e9a6a73c1b4fd2","status":"affected","lessThan":"5e96760b25fdedbbf9312827f1f237d6b18b03e8","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/core/lwt_bpf.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.10","versionType":"semver"},{"version":"5.10.276","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.227","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.12.120","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/core/lwt_bpf.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/28aaef6f21fe0288bd7f0472af07df30df89647d"},{"url":"https://git.kernel.org/stable/c/e874c6f8d3dd0369764b44db40b01011821cfadc"},{"url":"https://git.kernel.org/stable/c/02315d8352c9dc80075a6cfa493f62369324ec4c"},{"url":"https://git.kernel.org/stable/c/5fe7b2bdf2784d5b3614208d4f9d0c37a5137f9a"},{"url":"https://git.kernel.org/stable/c/eeb76b21f13aea28d9123feaeaf03cde7db681c0"},{"url":"https://git.kernel.org/stable/c/5e96760b25fdedbbf9312827f1f237d6b18b03e8"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-12-03T09:22:07.726Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.10","versionEndExcluding":"5.10.276"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.10","versionEndExcluding":"5.15.227"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.10","versionEndExcluding":"6.12.120"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.10","versionEndExcluding":"6.18.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.10","versionEndExcluding":"7.3.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.10","versionEndExcluding":"7.4-rc2"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}