{"id":"CVE-2024-42068","state":"PUBLISHED","title":"bpf: Take return from set_memory_ro() into account with bpf_prog_lock_ro()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Take return from set_memory_ro() into account with bpf_prog_lock_ro()\n\nset_memory_ro() can fail, leaving memory unprotected.\n\nCheck its return and take it into account as an error.","publishedAt":"2024-07-29T15:52:32.538Z","updatedAt":"2026-10-21T12:34:58.185Z","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":"60a3b2253c413cf601783b070507d7dd6620c954","status":"affected","lessThan":"a359696856ca9409fb97655c5a8ef0f549cb6e03","versionType":"git"},{"version":"60a3b2253c413cf601783b070507d7dd6620c954","status":"affected","lessThan":"e4f602e3ff749ba770bf8ff10196e18358de6720","versionType":"git"},{"version":"60a3b2253c413cf601783b070507d7dd6620c954","status":"affected","lessThan":"2bbfffa802adc30b772d0e0f881a13c3804a965c","versionType":"git"},{"version":"60a3b2253c413cf601783b070507d7dd6620c954","status":"affected","lessThan":"05412471beba313ecded95aa17b25fe84bb2551a","versionType":"git"},{"version":"60a3b2253c413cf601783b070507d7dd6620c954","status":"affected","lessThan":"7d2cc63eca0c993c99d18893214abf8f85d566d8","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/filter.h","kernel/bpf/core.c","kernel/bpf/verifier.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.18","versionType":"semver"},{"version":"5.15.162","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.97","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.160","status":"unaffected","lessThanOrEqual":"6.6.*","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":["include/linux/filter.h","kernel/bpf/core.c","kernel/bpf/verifier.c"]}],"references":["https://git.kernel.org/stable/c/a359696856ca9409fb97655c5a8ef0f549cb6e03","https://git.kernel.org/stable/c/e4f602e3ff749ba770bf8ff10196e18358de6720","https://git.kernel.org/stable/c/2bbfffa802adc30b772d0e0f881a13c3804a965c","https://git.kernel.org/stable/c/05412471beba313ecded95aa17b25fe84bb2551a","https://git.kernel.org/stable/c/7d2cc63eca0c993c99d18893214abf8f85d566d8","https://git.kernel.org/stable/c/fdd411af8178edc6b7bf260f8fa4fba1bedd0a6d","https://git.kernel.org/stable/c/e3540e5a7054d6daaf9a1415a48aacb092112a89","https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html"],"weaknesses":[],"ingestedAt":"2026-10-29T20:07:47.831Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/42xxx/CVE-2024-42068.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-42068","state":"PUBLISHED","datePublished":"2024-07-29T15:52:32.538Z","dateUpdated":"2026-10-21T12:34:58.185Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-07-29T15:50:41.168Z"},"containers":{"cna":{"title":"bpf: Take return from set_memory_ro() into account with bpf_prog_lock_ro()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Take return from set_memory_ro() into account with bpf_prog_lock_ro()\n\nset_memory_ro() can fail, leaving memory unprotected.\n\nCheck its return and take it into account as an error."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"60a3b2253c413cf601783b070507d7dd6620c954","status":"affected","lessThan":"a359696856ca9409fb97655c5a8ef0f549cb6e03","versionType":"git"},{"version":"60a3b2253c413cf601783b070507d7dd6620c954","status":"affected","lessThan":"e4f602e3ff749ba770bf8ff10196e18358de6720","versionType":"git"},{"version":"60a3b2253c413cf601783b070507d7dd6620c954","status":"affected","lessThan":"2bbfffa802adc30b772d0e0f881a13c3804a965c","versionType":"git"},{"version":"60a3b2253c413cf601783b070507d7dd6620c954","status":"affected","lessThan":"05412471beba313ecded95aa17b25fe84bb2551a","versionType":"git"},{"version":"60a3b2253c413cf601783b070507d7dd6620c954","status":"affected","lessThan":"7d2cc63eca0c993c99d18893214abf8f85d566d8","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/filter.h","kernel/bpf/core.c","kernel/bpf/verifier.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.18","versionType":"semver"},{"version":"5.15.162","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.97","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.160","status":"unaffected","lessThanOrEqual":"6.6.*","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":["include/linux/filter.h","kernel/bpf/core.c","kernel/bpf/verifier.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/a359696856ca9409fb97655c5a8ef0f549cb6e03"},{"url":"https://git.kernel.org/stable/c/e4f602e3ff749ba770bf8ff10196e18358de6720"},{"url":"https://git.kernel.org/stable/c/2bbfffa802adc30b772d0e0f881a13c3804a965c"},{"url":"https://git.kernel.org/stable/c/05412471beba313ecded95aa17b25fe84bb2551a"},{"url":"https://git.kernel.org/stable/c/7d2cc63eca0c993c99d18893214abf8f85d566d8"}],"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 - BPF program loading is reachable only through local syscalls — `setsockopt(SO_ATTACH_FILTER)`, `seccomp()`/`prctl(PR_SET_SECCOMP)`, and `bpf(BPF_PROG_LOAD)`. No remote peer can drive `bpf_prog_select_runtime()`.\nAC:L - A local attacker can repeatedly load interpreted BPF programs in a loop while driving the machine into reclaim pressure, which is the condition that makes `split_large_page()`'s page-table allocation fail and return -ENOMEM out of `set_memory_ro()`. Memory pressure is attacker-influenceable rather than a state outside the attacker's control, so the higher-severity value applies.\nPR:L - `SO_ATTACH_FILTER` in net/core/sock.c:1465 has no capability check at all, and the seccomp path is gated only by `no_new_privs`, which any unprivileged task can set — so an ordinary user, including one inside a container or sandbox, reaches the vulnerable code with zero capabilities.\nUI:N - The attacker loads and attaches the BPF program entirely within its own process; no other user or victim action is involved.\nS:U - The unprotected memory and the resulting compromise are both within the kernel's own security authority — this is standard kernel privilege escalation, not a hypervisor or IOMMU boundary crossing.\nC:H - Kernel memory that the hardening design requires to be read-only remains writable, and the introducing commit 60a3b2253c41 states that a modifiable interpreter image yields \"arbitrary read/write memory access\"; rewriting the `insnsi[]` stream turns the BPF interpreter into an arbitrary kernel-memory read primitive.\nI:H - The unprotected region contains both the executed eBPF bytecode and the `bpf_func` function pointer, so the lost `set_memory_ro()` gives an attacker a path to arbitrary kernel writes and arbitrary function calls — exactly the integrity guarantee this code exists to enforce.\nA:H - A BPF program whose instruction stream or `bpf_func` pointer can be altered executes attacker-chosen kernel control flow, trivially producing an oops or panic, so the availability impact of the lost protection is a full kernel crash."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-21T12:34:58.185Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.18","versionEndExcluding":"5.15.162"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.18","versionEndExcluding":"6.1.97"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.18","versionEndExcluding":"6.6.160"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.18","versionEndExcluding":"6.9.8"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.18","versionEndExcluding":"6.10"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CVE Program Container","references":[{"url":"https://git.kernel.org/stable/c/a359696856ca9409fb97655c5a8ef0f549cb6e03","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/e4f602e3ff749ba770bf8ff10196e18358de6720","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/fdd411af8178edc6b7bf260f8fa4fba1bedd0a6d","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/e3540e5a7054d6daaf9a1415a48aacb092112a89","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/05412471beba313ecded95aa17b25fe84bb2551a","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/7d2cc63eca0c993c99d18893214abf8f85d566d8","tags":["x_transferred"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T22:01:05.442Z"}},{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2024-42068","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2024-09-10T16:19:52.600102Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-09-11T17:33:08.404Z"}}]}}}