{"id":"CVE-2024-58237","revision":"08791916f54d4ff3b7a675e2742095d8","records":[{"revision":"08791916f54d4ff3b7a675e2742095d8","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2024-58237","aliases":[],"title":"bpf: consider that tail calls invalidate packet pointers","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: consider that tail calls invalidate packet pointers\n\nTail-called programs could execute any of the helpers that invalidate\npacket pointers. Hence, conservatively assume that each tail call\ninvalidates packet pointers.\n\nMaking the change in bpf_helper_changes_pkt_data() automatically makes\nuse of check_cfg() logic that computes 'changes_pkt_data' effect for\nglobal sub-programs, such that the following program could be\nrejected:\n\n    int tail_call(struct __sk_buff *sk)\n    {\n    \tbpf_tail_call_static(sk, &jmp_table, 0);\n    \treturn 0;\n    }\n\n    SEC(\"tc\")\n    int not_safe(struct __sk_buff *sk)\n    {\n    \tint *p = (void *)(long)sk->data;\n    \t... make p valid ...\n    \ttail_call(sk);\n    \t*p = 42; /* this is unsafe */\n    \t...\n    }\n\nThe tc_bpf2bpf.c:subprog_tc() needs change: mark it as a function that\ncan invalidate packet pointers. Otherwise, it can't be freplaced with\ntailcall_freplace.c:entry_freplace() that does a tail call.","state":0,"publishedAt":"2025-05-05T14:53:34.153+00:00","modifiedAt":"2026-10-15T21:51:51.261+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                        \"net/core/filter.c\",\n                        \"tools/testing/selftests/bpf/progs/tc_bpf2bpf.c\"\n                    ],\n                    \"versions\": [\n                        {\n                            \"version\": \"51c39bb1d5d105a02e29aa7960f0a395086e6342\",\n                            \"lessThan\": \"f1692ee23dcaaddc24ba407b269707ee5df1301f\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"51c39bb1d5d105a02e29aa7960f0a395086e6342\",\n                            \"lessThan\": \"1c2244437f9ad3dd91215f920401a14f2542dbfc\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"51c39bb1d5d105a02e29aa7960f0a395086e6342\",\n                            \"lessThan\": \"1a4607ffba35bf2a630aab299e34dd3f6e658d70\",\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                        \"net/core/filter.c\",\n                        \"tools/testing/selftests/bpf/progs/tc_bpf2bpf.c\"\n                    ],\n                    \"versions\": [\n                        {\n                            \"version\": \"5.6\",\n                            \"status\": \"affected\"\n                        },\n                        {\n                            \"version\": \"0\",\n                            \"lessThan\": \"5.6\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.6.90\",\n                            \"lessThanOrEqual\": \"6.6.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.12.9\",\n                            \"lessThanOrEqual\": \"6.12.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.13\",\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/f1692ee23dcaaddc24ba407b269707ee5df1301f","https://git.kernel.org/stable/c/1c2244437f9ad3dd91215f920401a14f2542dbfc","https://git.kernel.org/stable/c/1a4607ffba35bf2a630aab299e34dd3f6e658d70"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2024-58237","license":"CVE Program Terms of Use","key":"cve-program:CVE-2024-58237","identifiers":["CVE-2024-58237"]},"retained":false,"historicalAffected":[]}],"coverage":[]}