{ "dataType": "CVE_RECORD", "dataVersion": "5.2", "cveMetadata": { "cveId": "CVE-2024-47703", "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "state": "PUBLISHED", "assignerShortName": "Linux", "dateReserved": "2024-09-30T16:00:12.945Z", "datePublished": "2024-10-21T11:53:38.714Z", "dateUpdated": "2026-08-05T11:39:35.083Z" }, "containers": { "cna": { "providerMetadata": { "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "shortName": "Linux", "dateUpdated": "2026-08-05T11:39:35.083Z" }, "descriptions": [ { "lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nbpf, lsm: Add check for BPF LSM return value\n\nA bpf prog returning a positive number attached to file_alloc_security\nhook makes kernel panic.\n\nThis happens because file system can not filter out the positive number\nreturned by the LSM prog using IS_ERR, and misinterprets this positive\nnumber as a file pointer.\n\nGiven that hook file_alloc_security never returned positive number\nbefore the introduction of BPF LSM, and other BPF LSM hooks may\nencounter similar issues, this patch adds LSM return value check\nin verifier, to ensure no unexpected value is returned." } ], "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 flaw is reached by loading and attaching a crafted BPF LSM program through the local `bpf()` syscall and then triggering it with a local `open()`; there is no network or adjacent path into the verifier.\nAC:L - Triggering is fully deterministic and entirely attacker-constructed — load an `SEC(\"lsm/file_alloc_security\")` program that returns a chosen positive constant, attach it, then call `open()` — with no race, no dependence on uncontrolled memory layout, and `CONFIG_BPF_LSM` plus `\"bpf\"` in the default `CONFIG_LSM` list on mainstream distro and Android kernels.\nPR:L - The attacker needs `CAP_BPF`+`CAP_PERFMON`, which were deliberately split out of `CAP_SYS_ADMIN` so BPF tracing/LSM could be granted to non-administrative principals (observability agents, sidecars, containers), and `bpf_token_capable()` resolves to `ns_capable(token->userns, ...)`, so with a delegating bpffs mount a user-namespace-confined non-root principal can load `BPF_LSM_MAC` programs. This is a constrained delegated privilege whose stated boundary is verifier soundness, not administrative control of the kernel.\nUI:N - The attacker performs every step in its own processes — load, attach, and then trigger with its own `open()` call. No victim action, mount, or file access by another user is required.\nS:U - Both the flawed component (BPF verifier return-value check) and the impacted component (VFS/kernel memory) are the kernel itself under a single security authority; no VM, IOMMU, or hypervisor boundary is crossed.\nC:H - The unchecked positive return becomes an attacker-chosen `struct file *` in the `[1, 0x7FFFFFFF]` user range that `IS_ERR()` fails to reject, so a pre-mapped fake `struct file` with a controlled `f_op` yields arbitrary kernel-memory reads and disclosure; the verifier bypass also lets LSM access-control verdicts be forged, defeating confidentiality enforcement.\nI:H - A verifier-sanctioned out-of-contract return value hands the VFS a fully attacker-controlled `struct file`, the canonical primitive for arbitrary kernel write and control-flow hijack via `f_op` after `fd_install()`, and independently allows LSM allow/deny decisions to be forged.\nA:H - The commit message documents that a positive `file_alloc_security` return \"makes kernel panic\" because the filesystem dereferences it as a file pointer; any `open()` on the system then oopses, giving a trivially repeatable full denial of service." } ] } ], "affected": [ { "product": "Linux", "vendor": "Linux", "defaultStatus": "unaffected", "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "programFiles": [ "include/linux/bpf.h", "include/linux/bpf_lsm.h", "kernel/bpf/bpf_lsm.c", "kernel/bpf/btf.c", "kernel/bpf/verifier.c" ], "versions": [ { "version": "520b7aa00d8cd8e411ecc09f63a2acd90feb6d29", "lessThan": "1050727d83e70449991c29dd1cf29fe936a63da3", "status": "affected", "versionType": "git" }, { "version": "520b7aa00d8cd8e411ecc09f63a2acd90feb6d29", "lessThan": "27ca3e20fe80be85a92b10064dfeb56cb2564b1c", "status": "affected", "versionType": "git" }, { "version": "520b7aa00d8cd8e411ecc09f63a2acd90feb6d29", "lessThan": "5d99e198be279045e6ecefe220f5c52f8ce9bfd5", "status": "affected", "versionType": "git" } ] }, { "product": "Linux", "vendor": "Linux", "defaultStatus": "affected", "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "programFiles": [ "include/linux/bpf.h", "include/linux/bpf_lsm.h", "kernel/bpf/bpf_lsm.c", "kernel/bpf/btf.c", "kernel/bpf/verifier.c" ], "versions": [ { "version": "5.7", "status": "affected" }, { "version": "0", "lessThan": "5.7", "status": "unaffected", "versionType": "semver" }, { "version": "6.10.13", "lessThanOrEqual": "6.10.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.11.2", "lessThanOrEqual": "6.11.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.12", "lessThanOrEqual": "*", "status": "unaffected", "versionType": "original_commit_for_fix" } ] } ], "cpeApplicability": [ { "nodes": [ { "operator": "OR", "negate": false, "cpeMatch": [ { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.7", "versionEndExcluding": "6.10.13" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.7", "versionEndExcluding": "6.11.2" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.7", "versionEndExcluding": "6.12" } ] } ] } ], "references": [ { "url": "https://git.kernel.org/stable/c/1050727d83e70449991c29dd1cf29fe936a63da3" }, { "url": "https://git.kernel.org/stable/c/27ca3e20fe80be85a92b10064dfeb56cb2564b1c" }, { "url": "https://git.kernel.org/stable/c/5d99e198be279045e6ecefe220f5c52f8ce9bfd5" } ], "title": "bpf, lsm: Add check for BPF LSM return value", "x_generator": { "engine": "bippy-1.2.0" } }, "adp": [ { "metrics": [ { "other": { "type": "ssvc", "content": { "id": "CVE-2024-47703", "role": "CISA Coordinator", "options": [ { "Exploitation": "none" }, { "Automatable": "no" }, { "Technical Impact": "partial" } ], "version": "2.0.3", "timestamp": "2024-10-21T13:04:16.628163Z" } } } ], "title": "CISA ADP Vulnrichment", "providerMetadata": { "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "shortName": "CISA-ADP", "dateUpdated": "2024-10-21T13:14:13.303Z" } } ] } }