{"id":"CVE-2024-42072","state":"PUBLISHED","title":"bpf: Fix may_goto with negative offset.","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix may_goto with negative offset.\n\nZac's syzbot crafted a bpf prog that exposed two bugs in may_goto.\nThe 1st bug is the way may_goto is patched. When offset is negative\nit should be patched differently.\nThe 2nd bug is in the verifier:\nwhen current state may_goto_depth is equal to visited state may_goto_depth\nit means there is an actual infinite loop. It's not correct to prune\nexploration of the program at this point.\nNote, that this check doesn't limit the program to only one may_goto insn,\nsince 2nd and any further may_goto will increment may_goto_depth only\nin the queued state pushed for future exploration. The current state\nwill have may_goto_depth == 0 regardless of number of may_goto insns\nand the verifier has to explore the program until bpf_exit.","publishedAt":"2024-07-29T15:52:35.598Z","updatedAt":"2026-08-05T11:35:30.329Z","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":"011832b97b311bb9e3c27945bc0d1089a14209c9","status":"affected","lessThan":"175827e04f4be53f3dfb57edf12d0d49b18fd939","versionType":"git"},{"version":"011832b97b311bb9e3c27945bc0d1089a14209c9","status":"affected","lessThan":"2b2efe1937ca9f8815884bd4dcd5b32733025103","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/verifier.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.9","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.9","versionType":"semver"},{"version":"6.9.8","status":"unaffected","lessThanOrEqual":"6.9.*","versionType":"semver"},{"version":"6.10","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/verifier.c"]}],"references":["https://git.kernel.org/stable/c/175827e04f4be53f3dfb57edf12d0d49b18fd939","https://git.kernel.org/stable/c/2b2efe1937ca9f8815884bd4dcd5b32733025103"],"weaknesses":[],"ingestedAt":"2026-10-29T20:07:47.831Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/42xxx/CVE-2024-42072.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-42072","state":"PUBLISHED","datePublished":"2024-07-29T15:52:35.598Z","dateUpdated":"2026-08-05T11:35:30.329Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-07-29T15:50:41.168Z"},"containers":{"cna":{"title":"bpf: Fix may_goto with negative offset.","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix may_goto with negative offset.\n\nZac's syzbot crafted a bpf prog that exposed two bugs in may_goto.\nThe 1st bug is the way may_goto is patched. When offset is negative\nit should be patched differently.\nThe 2nd bug is in the verifier:\nwhen current state may_goto_depth is equal to visited state may_goto_depth\nit means there is an actual infinite loop. It's not correct to prune\nexploration of the program at this point.\nNote, that this check doesn't limit the program to only one may_goto insn,\nsince 2nd and any further may_goto will increment may_goto_depth only\nin the queued state pushed for future exploration. The current state\nwill have may_goto_depth == 0 regardless of number of may_goto insns\nand the verifier has to explore the program until bpf_exit."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"011832b97b311bb9e3c27945bc0d1089a14209c9","status":"affected","lessThan":"175827e04f4be53f3dfb57edf12d0d49b18fd939","versionType":"git"},{"version":"011832b97b311bb9e3c27945bc0d1089a14209c9","status":"affected","lessThan":"2b2efe1937ca9f8815884bd4dcd5b32733025103","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/verifier.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.9","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.9","versionType":"semver"},{"version":"6.9.8","status":"unaffected","lessThanOrEqual":"6.9.*","versionType":"semver"},{"version":"6.10","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/verifier.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/175827e04f4be53f3dfb57edf12d0d49b18fd939"},{"url":"https://git.kernel.org/stable/c/2b2efe1937ca9f8815884bd4dcd5b32733025103"}],"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 vulnerability is reached through the bpf(BPF_PROG_LOAD) syscall, which requires local access to the machine; the mis-patched program is then run by attaching it to the attacker's own socket. No network-facing service parses the malicious input.\nAC:L - The attacker fully authors the BPF program and chooses the negative may_goto offset, so the 3-instruction control-flow skew is deterministic and reproducible on every load — no race, timing window, or unpredictable memory layout is involved.\nPR:L - may_goto carries no capability check in the verifier, and an unprivileged local user can load a BPF_PROG_TYPE_SOCKET_FILTER program whenever kernel.unprivileged_bpf_disabled is 0, or via a delegated BPF token / container-granted CAP_BPF (syscall.c:2753). Basic local user access is sufficient.\nUI:N - The attacker loads and attaches the program entirely on their own; execution is triggered by their own socket traffic with no action by any other user or administrator.\nS:U - The corruption occurs in kernel memory of the same host and results in a conventional local privilege escalation; no VM, IOMMU, or other security-authority boundary is crossed.\nC:H - The verified-vs-executed control-flow divergence lets the attacker skip the bounds/mask instructions guarding a load, turning it into a read from an attacker-chosen address — an arbitrary kernel memory read primitive that discloses arbitrary kernel data.\nI:H - The same primitive applied to a store gives an arbitrary kernel memory write with attacker-controlled address and value, a full verifier bypass that enables control-flow hijacking and privilege escalation.\nA:H - With off == -3 the patched JEQ becomes a self-jump, producing an unbreakable in-kernel loop (hard lockup / RCU stall), and the broken is_state_visited() check independently lets genuinely infinite loops pass verification; corrupted memory accesses also readily panic the kernel."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:35:30.329Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.9","versionEndExcluding":"6.9.8"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.9","versionEndExcluding":"6.10"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CVE Program Container","references":[{"url":"https://git.kernel.org/stable/c/175827e04f4be53f3dfb57edf12d0d49b18fd939","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/2b2efe1937ca9f8815884bd4dcd5b32733025103","tags":["x_transferred"]}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2024-08-02T04:54:31.986Z"}},{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2024-42072","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2024-09-10T16:19:39.749938Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-09-11T17:33:57.942Z"}}]}}}