{"id":"CVE-2025-38502","revision":"fcfc3f2663154ce48acae0f0cfca99e6","records":[{"revision":"fcfc3f2663154ce48acae0f0cfca99e6","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2025-38502","aliases":[],"title":"bpf: Fix oob access in cgroup local storage","description":"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.","state":0,"publishedAt":"2025-08-16T09:34:25.135+00:00","modifiedAt":"2026-10-15T21:52:17.683+00:00","affected":[{"ecosystem":"Vendor product","name":"Linux","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"product\": \"Linux\",\n                    \"vendor\": \"Linux\",\n                    \"defaultStatus\": \"unaffected\",\n                    \"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\n                    \"programFiles\": [\n                        \"include/linux/bpf.h\",\n                        \"kernel/bpf/core.c\"\n                    ],\n                    \"versions\": [\n                        {\n                            \"version\": \"7d9c3427894fe70d1347b4820476bf37736d2ff0\",\n                            \"lessThan\": \"c1c74584b9b4043c52e41fec415226e582d266a3\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"7d9c3427894fe70d1347b4820476bf37736d2ff0\",\n                            \"lessThan\": \"66da7cee78590259b400e51a70622ccd41da7bb2\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"7d9c3427894fe70d1347b4820476bf37736d2ff0\",\n                            \"lessThan\": \"7acfa07c585e3d7a64654d38f0a5c762877d0b9b\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"7d9c3427894fe70d1347b4820476bf37736d2ff0\",\n                            \"lessThan\": \"41688d1fc5d163a6c2c0e95c0419e2cb31a44648\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"7d9c3427894fe70d1347b4820476bf37736d2ff0\",\n                            \"lessThan\": \"19341d5c59e8c7e8528e40f8663e99d67810473c\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"7d9c3427894fe70d1347b4820476bf37736d2ff0\",\n                            \"lessThan\": \"abad3d0bad72a52137e0c350c59542d75ae4f513\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        }\n                    ]\n                }"},{"ecosystem":"Vendor product","name":"Linux","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"product\": \"Linux\",\n                    \"vendor\": \"Linux\",\n                    \"defaultStatus\": \"affected\",\n                    \"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\n                    \"programFiles\": [\n                        \"include/linux/bpf.h\",\n                        \"kernel/bpf/core.c\"\n                    ],\n                    \"versions\": [\n                        {\n                            \"version\": \"5.9\",\n                            \"status\": \"affected\"\n                        },\n                        {\n                            \"version\": \"0\",\n                            \"lessThan\": \"5.9\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"5.15.192\",\n                            \"lessThanOrEqual\": \"5.15.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.1.151\",\n                            \"lessThanOrEqual\": \"6.1.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.6.105\",\n                            \"lessThanOrEqual\": \"6.6.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.12.46\",\n                            \"lessThanOrEqual\": \"6.12.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.16.1\",\n                            \"lessThanOrEqual\": \"6.16.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.17\",\n                            \"lessThanOrEqual\": \"*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"original_commit_for_fix\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"severity":"HIGH"}],"references":["https://git.kernel.org/stable/c/c1c74584b9b4043c52e41fec415226e582d266a3","https://git.kernel.org/stable/c/66da7cee78590259b400e51a70622ccd41da7bb2","https://git.kernel.org/stable/c/7acfa07c585e3d7a64654d38f0a5c762877d0b9b","https://git.kernel.org/stable/c/41688d1fc5d163a6c2c0e95c0419e2cb31a44648","https://git.kernel.org/stable/c/19341d5c59e8c7e8528e40f8663e99d67810473c","https://git.kernel.org/stable/c/abad3d0bad72a52137e0c350c59542d75ae4f513"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2025-38502","license":"CVE Program Terms of Use","key":"cve-program:CVE-2025-38502","identifiers":["CVE-2025-38502"]},"retained":false,"historicalAffected":[]}],"coverage":[]}