{"id":"CVE-2025-38502","published":"2025-08-16T09:34:25Z","modified":"2026-10-15T21:52:17Z","title":"bpf: Fix oob access in cgroup local storage","vendor":"Linux","product":"Linux","tier":"tail","description":{"text":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix oob access in cgroup local storage\n\nLonial reported that an out-of-bounds access in cgroup local storage\ncan be crafted via tail calls. Given two programs each utilizing a\ncgroup local storage with a different value size, and one program\ndoing a tail call into the other. The verifier will validate each of\nthe indivial programs just fine. However, in the runtime context\nthe bpf_cg_run_ctx holds an bpf_prog_array_item which contains the\nBPF program as well as any cgroup local storage flavor the program\nuses. Helpers such as bpf_get_local_storage() pick this up from the\nruntime context:\n\n  ctx = container_of(current->bpf_ctx, struct bpf_cg_run_ctx, run_ctx);\n  storage = ctx->prog_item->cgroup_storage[stype];\n\n  if (stype == BPF_CGROUP_STORAGE_SHARED)\n    ptr = &READ_ONCE(storage->buf)->data[0];\n  else\n    ptr = this_cpu_ptr(storage->percpu_buf);\n\nFor the second program which was called from the originally attached\none, this means bpf_get_local_storage() will pick up the former\nprogram's map, not its own. With mismatching sizes, this can result\nin an unintended out-of-bounds access.\n\nTo fix this issue, we need to extend bpf_map_owner with an array of\nstorage_cookie[] to match on i) the exact maps from the original\nprogram if the second program was using bpf_get_local_storage(), or\nii) allow the tail call combination if the second program was not\nusing any of the cgroup local storage maps.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.8,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00298,"percentile":0.14828,"provenance":"source"},"cwes":[],"references":[{"url":"https://git.kernel.org/stable/c/c1c74584b9b4043c52e41fec415226e582d266a3","tags":[]},{"url":"https://git.kernel.org/stable/c/66da7cee78590259b400e51a70622ccd41da7bb2","tags":[]},{"url":"https://git.kernel.org/stable/c/7acfa07c585e3d7a64654d38f0a5c762877d0b9b","tags":[]},{"url":"https://git.kernel.org/stable/c/41688d1fc5d163a6c2c0e95c0419e2cb31a44648","tags":[]},{"url":"https://git.kernel.org/stable/c/19341d5c59e8c7e8528e40f8663e99d67810473c","tags":[]},{"url":"https://git.kernel.org/stable/c/abad3d0bad72a52137e0c350c59542d75ae4f513","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html","tags":[]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-032379.html","tags":[]}],"priority":{"score":13.4,"factors":[{"name":"EPSS percentile","points":2.97},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":5.46}]},"exploitSources":{"pocGithub":{"count":1,"skipped":0,"earliest":"2026-09-11","earliestUrl":"https://github.com/abraxas/CVE-2025-38502-Linux-LPE","repos":[{"name":"abraxas/CVE-2025-38502-Linux-LPE","url":"https://github.com/abraxas/CVE-2025-38502-Linux-LPE","stars":2,"created":"2026-09-11"}]},"first":{"date":"2026-09-11","source":"PoC-in-GitHub","url":"https://github.com/abraxas/CVE-2025-38502-Linux-LPE"},"provenance":"source"},"vendorSlug":"linux","affectedVersions":[{"vendor":"Linux","product":"Linux","versions":[">= 7d9c3427894fe70d1347b4820476bf37736d2ff0, < c1c74584b9b4043c52e41fec415226e582d266a3",">= 7d9c3427894fe70d1347b4820476bf37736d2ff0, < 66da7cee78590259b400e51a70622ccd41da7bb2",">= 7d9c3427894fe70d1347b4820476bf37736d2ff0, < 7acfa07c585e3d7a64654d38f0a5c762877d0b9b",">= 7d9c3427894fe70d1347b4820476bf37736d2ff0, < 41688d1fc5d163a6c2c0e95c0419e2cb31a44648",">= 7d9c3427894fe70d1347b4820476bf37736d2ff0, < 19341d5c59e8c7e8528e40f8663e99d67810473c",">= 7d9c3427894fe70d1347b4820476bf37736d2ff0, < abad3d0bad72a52137e0c350c59542d75ae4f513"]},{"vendor":"Linux","product":"Linux","versions":["5.9"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2026-10-15T21:51:03.238888Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2025-25076","exploited":false,"provenance":"source"}}