{"id":"CVE-2024-42067","state":"PUBLISHED","title":"bpf: Take return from set_memory_rox() into account with bpf_jit_binary_lock_ro()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Take return from set_memory_rox() into account with bpf_jit_binary_lock_ro()\n\nset_memory_rox() can fail, leaving memory unprotected.\n\nCheck return and bail out when bpf_jit_binary_lock_ro() returns\nan error.","publishedAt":"2024-07-29T15:52:31.825Z","updatedAt":"2026-10-21T12:34:57.072Z","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":"d48567c9a0d1e605639f8a8705a61bbb55fb4e84","status":"affected","lessThan":"c20d0fa873039bce82d4b1b2ffcda8bb22242790","versionType":"git"},{"version":"d48567c9a0d1e605639f8a8705a61bbb55fb4e84","status":"affected","lessThan":"044da7ae7afd4ef60806d73654a2e6a79aa4ed7a","versionType":"git"},{"version":"d48567c9a0d1e605639f8a8705a61bbb55fb4e84","status":"affected","lessThan":"e60adf513275c3a38e5cb67f7fd12387e43a3ff5","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/arm/net/bpf_jit_32.c","arch/loongarch/net/bpf_jit.c","arch/mips/net/bpf_jit_comp.c","arch/parisc/net/bpf_jit_core.c","arch/s390/net/bpf_jit_comp.c","arch/sparc/net/bpf_jit_comp_64.c","arch/x86/net/bpf_jit_comp32.c","include/linux/filter.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.2","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":["arch/arm/net/bpf_jit_32.c","arch/loongarch/net/bpf_jit.c","arch/mips/net/bpf_jit_comp.c","arch/parisc/net/bpf_jit_core.c","arch/s390/net/bpf_jit_comp.c","arch/sparc/net/bpf_jit_comp_64.c","arch/x86/net/bpf_jit_comp32.c","include/linux/filter.h"]}],"references":["https://git.kernel.org/stable/c/c20d0fa873039bce82d4b1b2ffcda8bb22242790","https://git.kernel.org/stable/c/044da7ae7afd4ef60806d73654a2e6a79aa4ed7a","https://git.kernel.org/stable/c/e60adf513275c3a38e5cb67f7fd12387e43a3ff5","https://git.kernel.org/stable/c/08f6c05feb1db21653e98ca84ea04ca032d014c7","https://git.kernel.org/stable/c/9fef36cad60d4226f9d06953cd56d1d2f9119730"],"weaknesses":[],"ingestedAt":"2026-10-29T20:07:47.831Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/42xxx/CVE-2024-42067.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-42067","state":"PUBLISHED","datePublished":"2024-07-29T15:52:31.825Z","dateUpdated":"2026-10-21T12:34:57.072Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-07-29T15:50:41.168Z"},"containers":{"cna":{"title":"bpf: Take return from set_memory_rox() into account with bpf_jit_binary_lock_ro()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Take return from set_memory_rox() into account with bpf_jit_binary_lock_ro()\n\nset_memory_rox() can fail, leaving memory unprotected.\n\nCheck return and bail out when bpf_jit_binary_lock_ro() returns\nan error."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"d48567c9a0d1e605639f8a8705a61bbb55fb4e84","status":"affected","lessThan":"c20d0fa873039bce82d4b1b2ffcda8bb22242790","versionType":"git"},{"version":"d48567c9a0d1e605639f8a8705a61bbb55fb4e84","status":"affected","lessThan":"044da7ae7afd4ef60806d73654a2e6a79aa4ed7a","versionType":"git"},{"version":"d48567c9a0d1e605639f8a8705a61bbb55fb4e84","status":"affected","lessThan":"e60adf513275c3a38e5cb67f7fd12387e43a3ff5","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/arm/net/bpf_jit_32.c","arch/loongarch/net/bpf_jit.c","arch/mips/net/bpf_jit_comp.c","arch/parisc/net/bpf_jit_core.c","arch/s390/net/bpf_jit_comp.c","arch/sparc/net/bpf_jit_comp_64.c","arch/x86/net/bpf_jit_comp32.c","include/linux/filter.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.2","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":["arch/arm/net/bpf_jit_32.c","arch/loongarch/net/bpf_jit.c","arch/mips/net/bpf_jit_comp.c","arch/parisc/net/bpf_jit_core.c","arch/s390/net/bpf_jit_comp.c","arch/sparc/net/bpf_jit_comp_64.c","arch/x86/net/bpf_jit_comp32.c","include/linux/filter.h"]}],"references":[{"url":"https://git.kernel.org/stable/c/c20d0fa873039bce82d4b1b2ffcda8bb22242790"},{"url":"https://git.kernel.org/stable/c/044da7ae7afd4ef60806d73654a2e6a79aa4ed7a"},{"url":"https://git.kernel.org/stable/c/e60adf513275c3a38e5cb67f7fd12387e43a3ff5"}],"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 JIT is driven only from local syscalls — `setsockopt(SO_ATTACH_FILTER)`, `seccomp(SECCOMP_SET_MODE_FILTER)`, or `bpf()` — all requiring local access to the machine. No remote peer can cause a BPF program to be JIT-compiled.\nAC:L - The precondition is a page-table allocation failure inside `set_memory_rox()`, and memory pressure is something a local attacker directly influences by ballooning allocations while spraying thousands of concurrent filter attachments. Both sides of the condition are under attacker control, so this is not a state beyond their influence.\nPR:L - A completely unprivileged user reaches `bpf_int_jit_compile()` through `sk_attach_filter()` on any socket or through `seccomp()` under NO_NEW_PRIVS — no CAP_BPF, no CAP_NET_ADMIN, and no user namespace required. Only a basic local account is needed.\nUI:N - The attacker attaches the filter and triggers execution entirely from their own process. No victim action, mount, or file open is involved.\nS:U - The unprotected memory and the resulting crash or code injection are all within the kernel's own security authority. No VM, IOMMU, or sandbox boundary is crossed.\nC:H - A failed lock leaves a writable, executable kernel page containing attacker-influenced JIT output, which is a direct kernel code-injection primitive when paired with any write; injected code yields arbitrary kernel memory disclosure. The loss of the read-only guarantee on executable memory is a full compromise of confidentiality in the worst case.\nI:H - On arm32 the JIT buffer stays RWX with attacker-chosen immediates embedded in it — precisely the JIT-spray/control-flow-hijack scenario that `bpf_jit_binary_lock_ro()` exists to prevent, permitting arbitrary kernel code execution. Kernel executable memory silently remaining writable is an integrity failure of the highest order.\nA:H - On s390 and x86-32 the buffer is allocated NX and only becomes executable via `set_memory_rox()`; on failure the JIT still sets `bpf_func`/`jited = 1`, so the first run of the filter faults on an instruction fetch from a non-executable page and oopses the kernel. An unprivileged user can repeat this to panic the system."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-21T12:34:57.072Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.2","versionEndExcluding":"6.6.160"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.2","versionEndExcluding":"6.9.8"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.2","versionEndExcluding":"6.10"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CVE Program Container","references":[{"url":"https://git.kernel.org/stable/c/08f6c05feb1db21653e98ca84ea04ca032d014c7","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/9fef36cad60d4226f9d06953cd56d1d2f9119730","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/044da7ae7afd4ef60806d73654a2e6a79aa4ed7a","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/e60adf513275c3a38e5cb67f7fd12387e43a3ff5","tags":["x_transferred"]}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2024-08-02T04:54:31.321Z"}},{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2024-42067","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2024-09-10T16:19:56.137791Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-09-11T17:33:58.173Z"}}]}}}