{"id":"CVE-2024-46754","state":"PUBLISHED","title":"bpf: Remove tst_run from lwt_seg6local_prog_ops.","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Remove tst_run from lwt_seg6local_prog_ops.\n\nThe syzbot reported that the lwt_seg6 related BPF ops can be invoked\nvia bpf_test_run() without without entering input_action_end_bpf()\nfirst.\n\nMartin KaFai Lau said that self test for BPF_PROG_TYPE_LWT_SEG6LOCAL\nprobably didn't work since it was introduced in commit 04d4b274e2a\n(\"ipv6: sr: Add seg6local action End.BPF\"). The reason is that the\nper-CPU variable seg6_bpf_srh_states::srh is never assigned in the self\ntest case but each BPF function expects it.\n\nRemove test_run for BPF_PROG_TYPE_LWT_SEG6LOCAL.","publishedAt":"2024-09-18T07:12:13.780Z","updatedAt":"2026-09-02T12:49:13.346Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"004d4b274e2a1a895a0e5dc66158b90a7d463d44","status":"affected","lessThan":"ea3fae6984ba0f054550e4da22219489c12cd8d4","versionType":"git"},{"version":"004d4b274e2a1a895a0e5dc66158b90a7d463d44","status":"affected","lessThan":"a675524cfbe88fd49c05ff8807a08646983e687c","versionType":"git"},{"version":"004d4b274e2a1a895a0e5dc66158b90a7d463d44","status":"affected","lessThan":"b05c2e25a5c168dbb46b6f7fcb741fd4e4f3b54a","versionType":"git"},{"version":"004d4b274e2a1a895a0e5dc66158b90a7d463d44","status":"affected","lessThan":"e217492f6fa2228ad703ee3006d8fc4e5969fbd4","versionType":"git"},{"version":"004d4b274e2a1a895a0e5dc66158b90a7d463d44","status":"affected","lessThan":"9cd15511de7c619bbd0f54bb3f28e6e720ded5d6","versionType":"git"},{"version":"004d4b274e2a1a895a0e5dc66158b90a7d463d44","status":"affected","lessThan":"c13fda93aca118b8e5cd202e339046728ee7dddb","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/core/filter.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.18","versionType":"semver"},{"version":"5.10.269","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.220","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.187","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.156","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.10.10","status":"unaffected","lessThanOrEqual":"6.10.*","versionType":"semver"},{"version":"6.11","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/core/filter.c"]}],"references":["https://git.kernel.org/stable/c/ea3fae6984ba0f054550e4da22219489c12cd8d4","https://git.kernel.org/stable/c/a675524cfbe88fd49c05ff8807a08646983e687c","https://git.kernel.org/stable/c/b05c2e25a5c168dbb46b6f7fcb741fd4e4f3b54a","https://git.kernel.org/stable/c/e217492f6fa2228ad703ee3006d8fc4e5969fbd4","https://git.kernel.org/stable/c/9cd15511de7c619bbd0f54bb3f28e6e720ded5d6","https://git.kernel.org/stable/c/c13fda93aca118b8e5cd202e339046728ee7dddb"],"weaknesses":[],"ingestedAt":"2026-10-29T20:07:47.831Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/46xxx/CVE-2024-46754.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-46754","state":"PUBLISHED","datePublished":"2024-09-18T07:12:13.780Z","dateUpdated":"2026-09-02T12:49:13.346Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-09-11T15:12:18.270Z"},"containers":{"cna":{"title":"bpf: Remove tst_run from lwt_seg6local_prog_ops.","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Remove tst_run from lwt_seg6local_prog_ops.\n\nThe syzbot reported that the lwt_seg6 related BPF ops can be invoked\nvia bpf_test_run() without without entering input_action_end_bpf()\nfirst.\n\nMartin KaFai Lau said that self test for BPF_PROG_TYPE_LWT_SEG6LOCAL\nprobably didn't work since it was introduced in commit 04d4b274e2a\n(\"ipv6: sr: Add seg6local action End.BPF\"). The reason is that the\nper-CPU variable seg6_bpf_srh_states::srh is never assigned in the self\ntest case but each BPF function expects it.\n\nRemove test_run for BPF_PROG_TYPE_LWT_SEG6LOCAL."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"004d4b274e2a1a895a0e5dc66158b90a7d463d44","status":"affected","lessThan":"ea3fae6984ba0f054550e4da22219489c12cd8d4","versionType":"git"},{"version":"004d4b274e2a1a895a0e5dc66158b90a7d463d44","status":"affected","lessThan":"a675524cfbe88fd49c05ff8807a08646983e687c","versionType":"git"},{"version":"004d4b274e2a1a895a0e5dc66158b90a7d463d44","status":"affected","lessThan":"b05c2e25a5c168dbb46b6f7fcb741fd4e4f3b54a","versionType":"git"},{"version":"004d4b274e2a1a895a0e5dc66158b90a7d463d44","status":"affected","lessThan":"e217492f6fa2228ad703ee3006d8fc4e5969fbd4","versionType":"git"},{"version":"004d4b274e2a1a895a0e5dc66158b90a7d463d44","status":"affected","lessThan":"9cd15511de7c619bbd0f54bb3f28e6e720ded5d6","versionType":"git"},{"version":"004d4b274e2a1a895a0e5dc66158b90a7d463d44","status":"affected","lessThan":"c13fda93aca118b8e5cd202e339046728ee7dddb","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/core/filter.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.18","versionType":"semver"},{"version":"5.10.269","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.220","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.187","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.156","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.10.10","status":"unaffected","lessThanOrEqual":"6.10.*","versionType":"semver"},{"version":"6.11","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/core/filter.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/ea3fae6984ba0f054550e4da22219489c12cd8d4"},{"url":"https://git.kernel.org/stable/c/a675524cfbe88fd49c05ff8807a08646983e687c"},{"url":"https://git.kernel.org/stable/c/b05c2e25a5c168dbb46b6f7fcb741fd4e4f3b54a"},{"url":"https://git.kernel.org/stable/c/e217492f6fa2228ad703ee3006d8fc4e5969fbd4"},{"url":"https://git.kernel.org/stable/c/9cd15511de7c619bbd0f54bb3f28e6e720ded5d6"},{"url":"https://git.kernel.org/stable/c/c13fda93aca118b8e5cd202e339046728ee7dddb"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The only entry point is the local `bpf(BPF_PROG_TEST_RUN)` syscall against a `BPF_PROG_TYPE_LWT_SEG6LOCAL` program fd; no packet ever reaches this path from the network, since real SRv6 traffic goes through `input_action_end_bpf()` which initializes the state correctly.\nAC:L - A single `BPF_PROG_TEST_RUN` calling `bpf_lwt_seg6_action(END_B6_ENCAP)` deterministically hits `dev_net(skb_dst(skb)->dev)` with a NULL dst, with no race, no timing window and no layout luck; the UAF variant needs only ordinary heap grooming that the attacker fully drives by choosing `data_size_in` (slab cache), `srhoff` (offset) and CPU affinity.\nPR:L - `bpf_prog_test_run()` itself performs zero capability check — it only does `bpf_prog_get(attr->test.prog_fd)` — so any unprivileged local process that inherits or receives a seg6local program fd (fork/exec, `SCM_RIGHTS`, or a permissively-moded bpffs pin) can trigger it, and BPF tokens in 6.9+ deliberately delegate `CAP_BPF`/`CAP_NET_ADMIN` program loading to unprivileged users inside containers.\nUI:N - The attacker issues the `bpf()` syscalls entirely on their own; no victim action, mount, file open, or administrator step is involved at any point.\nS:U - The NULL dereference, out-of-bounds read and slab use-after-free all occur in kernel context within the same security authority the calling process already interacts with; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The dangling per-CPU `srh_state->srh` lets `seg6_validate_srh()` walk TLVs through a freed, attacker-reclaimed slab object, and `seg6_do_srh_inline()`'s `memmove(hdr, oldhdr, 40)` on a short test packet reads up to 40 bytes past `skb->tail` which are then returned to userspace via `bpf_test_finish()`'s `data_out`.\nI:H - `seg6_bpf_has_valid_srh()` executes `srh->hdrlen = (u8)(srh_state->hdrlen >> 3)` through the stale pointer, giving an attacker-valued one-byte write at an attacker-chosen offset inside a freed object in an attacker-selected kmalloc cache — a reclaim primitive suitable for corrupting length/flag fields of a sprayed victim structure and escalating.\nA:H - `bpf_lwt_seg6_action(END_B6_ENCAP)` reliably oopses the kernel on `dev_net(skb_dst(skb)->dev)` because the test skb carries no dst, and post-`d1542d4ae4df` the same path also trips `lockdep_assert_held()`, which is a panic under `panic_on_warn`."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-09-02T12:49:13.346Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.18","versionEndExcluding":"5.10.269"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.18","versionEndExcluding":"5.15.220"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.18","versionEndExcluding":"6.1.187"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.18","versionEndExcluding":"6.6.156"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.18","versionEndExcluding":"6.10.10"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.18","versionEndExcluding":"6.11"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2024-09-29T14:46:48.262114Z","id":"CVE-2024-46754","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-09-29T14:47:03.068Z"}}]}}}