{"id":"CVE-2024-38564","state":"PUBLISHED","title":"bpf: Add BPF_PROG_TYPE_CGROUP_SKB attach type enforcement in BPF_LINK_CREATE","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Add BPF_PROG_TYPE_CGROUP_SKB attach type enforcement in BPF_LINK_CREATE\n\nbpf_prog_attach uses attach_type_to_prog_type to enforce proper\nattach type for BPF_PROG_TYPE_CGROUP_SKB. link_create uses\nbpf_prog_get and relies on bpf_prog_attach_check_attach_type\nto properly verify prog_type <> attach_type association.\n\nAdd missing attach_type enforcement for the link_create case.\nOtherwise, it's currently possible to attach cgroup_skb prog\ntypes to other cgroup hooks.","publishedAt":"2024-06-19T13:35:32.222Z","updatedAt":"2026-10-27T15:53:48.399Z","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":"3505cb9fa26cfec9512744466e754a8cbc2365b0","status":"affected","lessThan":"6675c541f540a29487a802d3135280b69b9f568d","versionType":"git"},{"version":"3505cb9fa26cfec9512744466e754a8cbc2365b0","status":"affected","lessThan":"67929e973f5a347f05fef064fea4ae79e7cdb5fd","versionType":"git"},{"version":"3505cb9fa26cfec9512744466e754a8cbc2365b0","status":"affected","lessThan":"b34bbc76651065a5eafad8ddff1eb8d1f8473172","versionType":"git"},{"version":"3505cb9fa26cfec9512744466e754a8cbc2365b0","status":"affected","lessThan":"543576ec15b17c0c93301ac8297333c7b6e84ac7","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/syscall.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.6","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.6","versionType":"semver"},{"version":"6.6.33","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.8.12","status":"unaffected","lessThanOrEqual":"6.8.*","versionType":"semver"},{"version":"6.9.3","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/syscall.c"]}],"references":["https://git.kernel.org/stable/c/6675c541f540a29487a802d3135280b69b9f568d","https://git.kernel.org/stable/c/67929e973f5a347f05fef064fea4ae79e7cdb5fd","https://git.kernel.org/stable/c/b34bbc76651065a5eafad8ddff1eb8d1f8473172","https://git.kernel.org/stable/c/543576ec15b17c0c93301ac8297333c7b6e84ac7"],"weaknesses":[],"ingestedAt":"2026-10-29T20:07:39.287Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/38xxx/CVE-2024-38564.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-38564","state":"PUBLISHED","datePublished":"2024-06-19T13:35:32.222Z","dateUpdated":"2026-10-27T15:53:48.399Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-06-18T19:36:34.922Z"},"containers":{"cna":{"title":"bpf: Add BPF_PROG_TYPE_CGROUP_SKB attach type enforcement in BPF_LINK_CREATE","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Add BPF_PROG_TYPE_CGROUP_SKB attach type enforcement in BPF_LINK_CREATE\n\nbpf_prog_attach uses attach_type_to_prog_type to enforce proper\nattach type for BPF_PROG_TYPE_CGROUP_SKB. link_create uses\nbpf_prog_get and relies on bpf_prog_attach_check_attach_type\nto properly verify prog_type <> attach_type association.\n\nAdd missing attach_type enforcement for the link_create case.\nOtherwise, it's currently possible to attach cgroup_skb prog\ntypes to other cgroup hooks."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"3505cb9fa26cfec9512744466e754a8cbc2365b0","status":"affected","lessThan":"6675c541f540a29487a802d3135280b69b9f568d","versionType":"git"},{"version":"3505cb9fa26cfec9512744466e754a8cbc2365b0","status":"affected","lessThan":"67929e973f5a347f05fef064fea4ae79e7cdb5fd","versionType":"git"},{"version":"3505cb9fa26cfec9512744466e754a8cbc2365b0","status":"affected","lessThan":"b34bbc76651065a5eafad8ddff1eb8d1f8473172","versionType":"git"},{"version":"3505cb9fa26cfec9512744466e754a8cbc2365b0","status":"affected","lessThan":"543576ec15b17c0c93301ac8297333c7b6e84ac7","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/syscall.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.6","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.6","versionType":"semver"},{"version":"6.6.33","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.8.12","status":"unaffected","lessThanOrEqual":"6.8.*","versionType":"semver"},{"version":"6.9.3","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/syscall.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/6675c541f540a29487a802d3135280b69b9f568d"},{"url":"https://git.kernel.org/stable/c/67929e973f5a347f05fef064fea4ae79e7cdb5fd"},{"url":"https://git.kernel.org/stable/c/b34bbc76651065a5eafad8ddff1eb8d1f8473172"},{"url":"https://git.kernel.org/stable/c/543576ec15b17c0c93301ac8297333c7b6e84ac7"}],"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 exclusively through the `bpf(BPF_LINK_CREATE)` syscall and then triggered by an ordinary syscall (e.g. `getsockopt()`) from a process in the target cgroup. Per kernel guidance BPF is Local.\nAC:L - Exploitation is fully deterministic — the attacker authors the cgroup_skb program, chooses the mismatched attach type, picks the target cgroup, and invokes the hook itself; there is no race, no memory-layout dependency, and no special kernel config beyond stock `CONFIG_CGROUP_BPF`.\nPR:L - The attach path requires CAP_NET_ADMIN/CAP_SYS_ADMIN via `bpf_token_capable()`, which on 6.8+ is satisfied by `ns_capable(token->userns, CAP_NET_ADMIN)` — i.e. reachable by container-root inside a BPF-token-delegated user namespace, an unprivileged principal from the host's perspective, matching the PR:L treatment of other BPF-capability-gated kernel.org CVEs.\nUI:N - The attacker attaches the link and then triggers the confused hook from its own process; no action by any other user is required.\nS:U - The type confusion corrupts kernel memory within the same kernel security authority — a standard local privilege escalation with no VM, IOMMU, or sandbox boundary crossed.\nC:H - sk_buff-offset loads against a 12–56 byte stack ctx read kernel stack memory out of bounds, and skb helpers such as `bpf_skb_load_bytes()` dereference wild pointers harvested from that memory, yielding effectively arbitrary kernel memory disclosure exfiltrated through BPF maps.\nI:H - `cg_skb_is_valid_access` permits writes to `__sk_buff->mark`, `->priority` and `->cb[0..4]`, which compile to raw stores ~0x30–0xa8 bytes past the small stack ctx, giving attacker-controlled out-of-bounds kernel stack writes into caller frames — a control-flow hijack primitive.\nA:H - The wild-pointer dereferences and stack corruption reliably produce a general protection fault, KASAN splat, or panic — this is exactly how syzbot (`syzbot+838346b979830606c854`) surfaced the bug."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-27T15:53:48.399Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6","versionEndExcluding":"6.6.33"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6","versionEndExcluding":"6.8.12"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6","versionEndExcluding":"6.9.3"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6","versionEndExcluding":"6.10"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2024-06-20T14:57:28.333210Z","id":"CVE-2024-38564","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-06-20T14:57:37.182Z"}},{"title":"CVE Program Container","references":[{"url":"https://git.kernel.org/stable/c/6675c541f540a29487a802d3135280b69b9f568d","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/67929e973f5a347f05fef064fea4ae79e7cdb5fd","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/b34bbc76651065a5eafad8ddff1eb8d1f8473172","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/543576ec15b17c0c93301ac8297333c7b6e84ac7","tags":["x_transferred"]}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2024-08-02T04:12:25.836Z"}}]}}}