{"id":"CVE-2026-143355","state":"PUBLISHED","title":"bpf: Reset skb->cb after an lwt prog pushes an IP header","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Reset skb->cb after an lwt prog pushes an IP header\n\nIPCB(skb)->opt holds the offsets from the network header to the IPv4\noptions. But bpf_lwt_push_ip_encap() moves the network header and does not\nchange IPCB(skb). Then ip_forward_options() and __ip_options_echo() use the\nold offsets on the pushed header. Thus the kernel corrupts the skb and the\nstack. If the family changes, the kernel also reads IP6CB(skb) as\nIPCB(skb), or the reverse. With CONFIG_IPV6_MIP6, it reads IPSKB_FORWARDED\nas frag_max_size and adds a needless fragment header.\n\nReset skb->cb after the prog. bpf_lwt_push_ip_encap() cannot do it, because\nbpf_prog_run_save_cb() can restore skb->cb. For IPv4 in IPv4, clear\nIPCB(skb)->opt as ip_tunnel_xmit() does. If the family changes, clear the\ncb of the new family but keep iif, because ip6_forward() gets the input\ndevice from it. Behind a VRF, skb->skb_iif is the VRF device and cannot\nreplace iif. Do nothing for IPv6 in IPv6, as in seg6_do_srh_encap().\n\nDo the reset in bpf_input() only after a push. Without a push,\nip_forward_options() needs the offsets. Do it in bpf_xmit() before each\nreroute, because an lwt_xmit prog can also change the options. Thus after a\nreroute without a push, ip_options_fragment() leaves the options in all\nfragments, and ICMP errors echo none. After BPF_OK or BPF_REDIRECT the skb\ngoes to a device, thus bpf_xmit() does no reset. The inner IPv4 checksum\ncan still be wrong after ip_rcv_options() changes an option.","publishedAt":"2026-12-03T09:22:10.984Z","updatedAt":"2026-12-03T09:22:10.984Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"52f278774e796a553be0c869dcaaee6f259ca795","status":"affected","lessThan":"f8faab33bf6fada08fea4941d8781a7205345c99","versionType":"git"},{"version":"52f278774e796a553be0c869dcaaee6f259ca795","status":"affected","lessThan":"5f8aed23c1b0c839d5f428844b25aafab09b667e","versionType":"git"},{"version":"52f278774e796a553be0c869dcaaee6f259ca795","status":"affected","lessThan":"f1d695ec88d088ce107a3a0b588631e3c02c4184","versionType":"git"},{"version":"52f278774e796a553be0c869dcaaee6f259ca795","status":"affected","lessThan":"b3ad42f6183286ab376389a5d26edf7ee3bdba27","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/f8faab33bf6fada08fea4941d8781a7205345c99","https://git.kernel.org/stable/c/5f8aed23c1b0c839d5f428844b25aafab09b667e","https://git.kernel.org/stable/c/f1d695ec88d088ce107a3a0b588631e3c02c4184","https://git.kernel.org/stable/c/b3ad42f6183286ab376389a5d26edf7ee3bdba27"],"weaknesses":[],"ingestedAt":"2026-12-03T09:44:04.436Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/143xxx/CVE-2026-143355.json","commit":"9e309c7c0f08856e2558a1df33f75dca027fab70","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-143355","state":"PUBLISHED","datePublished":"2026-12-03T09:22:10.984Z","dateUpdated":"2026-12-03T09:22:10.984Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-12-03T03:10:28.368Z"},"containers":{"cna":{"title":"bpf: Reset skb->cb after an lwt prog pushes an IP header","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Reset skb->cb after an lwt prog pushes an IP header\n\nIPCB(skb)->opt holds the offsets from the network header to the IPv4\noptions. But bpf_lwt_push_ip_encap() moves the network header and does not\nchange IPCB(skb). Then ip_forward_options() and __ip_options_echo() use the\nold offsets on the pushed header. Thus the kernel corrupts the skb and the\nstack. If the family changes, the kernel also reads IP6CB(skb) as\nIPCB(skb), or the reverse. With CONFIG_IPV6_MIP6, it reads IPSKB_FORWARDED\nas frag_max_size and adds a needless fragment header.\n\nReset skb->cb after the prog. bpf_lwt_push_ip_encap() cannot do it, because\nbpf_prog_run_save_cb() can restore skb->cb. For IPv4 in IPv4, clear\nIPCB(skb)->opt as ip_tunnel_xmit() does. If the family changes, clear the\ncb of the new family but keep iif, because ip6_forward() gets the input\ndevice from it. Behind a VRF, skb->skb_iif is the VRF device and cannot\nreplace iif. Do nothing for IPv6 in IPv6, as in seg6_do_srh_encap().\n\nDo the reset in bpf_input() only after a push. Without a push,\nip_forward_options() needs the offsets. Do it in bpf_xmit() before each\nreroute, because an lwt_xmit prog can also change the options. Thus after a\nreroute without a push, ip_options_fragment() leaves the options in all\nfragments, and ICMP errors echo none. After BPF_OK or BPF_REDIRECT the skb\ngoes to a device, thus bpf_xmit() does no reset. The inner IPv4 checksum\ncan still be wrong after ip_rcv_options() changes an option."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"52f278774e796a553be0c869dcaaee6f259ca795","status":"affected","lessThan":"f8faab33bf6fada08fea4941d8781a7205345c99","versionType":"git"},{"version":"52f278774e796a553be0c869dcaaee6f259ca795","status":"affected","lessThan":"5f8aed23c1b0c839d5f428844b25aafab09b667e","versionType":"git"},{"version":"52f278774e796a553be0c869dcaaee6f259ca795","status":"affected","lessThan":"f1d695ec88d088ce107a3a0b588631e3c02c4184","versionType":"git"},{"version":"52f278774e796a553be0c869dcaaee6f259ca795","status":"affected","lessThan":"b3ad42f6183286ab376389a5d26edf7ee3bdba27","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/f8faab33bf6fada08fea4941d8781a7205345c99"},{"url":"https://git.kernel.org/stable/c/5f8aed23c1b0c839d5f428844b25aafab09b667e"},{"url":"https://git.kernel.org/stable/c/f1d695ec88d088ce107a3a0b588631e3c02c4184"},{"url":"https://git.kernel.org/stable/c/b3ad42f6183286ab376389a5d26edf7ee3bdba27"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-12-03T09:22:10.984Z"},"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"}}}}}