{"id":"CVE-2026-143354","state":"PUBLISHED","title":"bpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol\n\nWhen an lwt_in prog returns BPF_OK, bpf_input() calls orig_input(), the\ninput handler of the route. This handler is for one IP version and needs a\ndst of the same family. But BPF_LWT_ENCAP_IP lets the prog push a header of\nthe other IP version and thus change skb->protocol. Then the handler reads\nand changes a header of the other IP version. The push of an SRH also\nreplaces the dst, because seg6_lookup_nexthop() puts an rt6_info into the\nskb. Then ip_forward() uses the rt6_info as a struct rtable.\n\nDrop the skb with -EINVAL when skb->protocol changes, as bpf_xmit() does.\nDrop it also when the family of the dst changes, because skb->protocol does\nnot always show this change. Today no such skb leaves as the prog made it.\nA prog works as before if it returns BPF_LWT_REROUTE, or if it pushes an\nSRH on an IPv6 route.\n\nThe commit in the first Fixes tag lets a prog change skb->protocol. The\ncommit in the second tag adds the check to bpf_xmit() only.","publishedAt":"2026-12-03T09:22:10.347Z","updatedAt":"2026-12-03T09:22:10.347Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"52f278774e796a553be0c869dcaaee6f259ca795","status":"affected","lessThan":"35d3016d6b0528bb65cee90b4b34879bdbeabef2","versionType":"git"},{"version":"52f278774e796a553be0c869dcaaee6f259ca795","status":"affected","lessThan":"6f18041922b04300d751956eb9ac805aff02514b","versionType":"git"},{"version":"52f278774e796a553be0c869dcaaee6f259ca795","status":"affected","lessThan":"3e08bbd4772e503bb7f7fe6f9cab95ad414dee16","versionType":"git"},{"version":"52f278774e796a553be0c869dcaaee6f259ca795","status":"affected","lessThan":"d9618a6196953718f7470de5d2e84121bed063f7","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":"5.1","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.1","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/35d3016d6b0528bb65cee90b4b34879bdbeabef2","https://git.kernel.org/stable/c/6f18041922b04300d751956eb9ac805aff02514b","https://git.kernel.org/stable/c/3e08bbd4772e503bb7f7fe6f9cab95ad414dee16","https://git.kernel.org/stable/c/d9618a6196953718f7470de5d2e84121bed063f7"],"weaknesses":[],"ingestedAt":"2026-12-03T09:44:04.436Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/143xxx/CVE-2026-143354.json","commit":"9e309c7c0f08856e2558a1df33f75dca027fab70","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-143354","state":"PUBLISHED","datePublished":"2026-12-03T09:22:10.347Z","dateUpdated":"2026-12-03T09:22:10.347Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-12-03T03:10:28.368Z"},"containers":{"cna":{"title":"bpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol\n\nWhen an lwt_in prog returns BPF_OK, bpf_input() calls orig_input(), the\ninput handler of the route. This handler is for one IP version and needs a\ndst of the same family. But BPF_LWT_ENCAP_IP lets the prog push a header of\nthe other IP version and thus change skb->protocol. Then the handler reads\nand changes a header of the other IP version. The push of an SRH also\nreplaces the dst, because seg6_lookup_nexthop() puts an rt6_info into the\nskb. Then ip_forward() uses the rt6_info as a struct rtable.\n\nDrop the skb with -EINVAL when skb->protocol changes, as bpf_xmit() does.\nDrop it also when the family of the dst changes, because skb->protocol does\nnot always show this change. Today no such skb leaves as the prog made it.\nA prog works as before if it returns BPF_LWT_REROUTE, or if it pushes an\nSRH on an IPv6 route.\n\nThe commit in the first Fixes tag lets a prog change skb->protocol. The\ncommit in the second tag adds the check to bpf_xmit() only."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"52f278774e796a553be0c869dcaaee6f259ca795","status":"affected","lessThan":"35d3016d6b0528bb65cee90b4b34879bdbeabef2","versionType":"git"},{"version":"52f278774e796a553be0c869dcaaee6f259ca795","status":"affected","lessThan":"6f18041922b04300d751956eb9ac805aff02514b","versionType":"git"},{"version":"52f278774e796a553be0c869dcaaee6f259ca795","status":"affected","lessThan":"3e08bbd4772e503bb7f7fe6f9cab95ad414dee16","versionType":"git"},{"version":"52f278774e796a553be0c869dcaaee6f259ca795","status":"affected","lessThan":"d9618a6196953718f7470de5d2e84121bed063f7","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":"5.1","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.1","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/35d3016d6b0528bb65cee90b4b34879bdbeabef2"},{"url":"https://git.kernel.org/stable/c/6f18041922b04300d751956eb9ac805aff02514b"},{"url":"https://git.kernel.org/stable/c/3e08bbd4772e503bb7f7fe6f9cab95ad414dee16"},{"url":"https://git.kernel.org/stable/c/d9618a6196953718f7470de5d2e84121bed063f7"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-12-03T09:22:10.347Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.1","versionEndExcluding":"6.12.120"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.1","versionEndExcluding":"6.18.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.1","versionEndExcluding":"7.3.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.1","versionEndExcluding":"7.4-rc2"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}