{"id":"CVE-2024-58237","aliases":["CVE-2024-58237"],"related":[],"kind":"vulnerability","state":"published","title":"bpf: consider that tail calls invalidate packet pointers","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: bpf: considerar que las llamadas de cola invalidan los punteros de paquete. Los programas con llamadas de cola podrían ejecutar cualquiera de los ayudantes que invalidan los punteros de paquete. Por lo tanto, se asume, de forma conservadora, que cada llamada de cola invalida los punteros de paquete. Al realizar el cambio en bpf_helper_changes_pkt_data(), se utiliza automáticamente la lógica check_cfg(), que calcula el efecto de 'changes_pkt_data' para los subprogramas globales, de modo que el siguiente programa podría ser rechazado: int tail_call(struct __sk_buff *sk) { bpf_tail_call_static(sk, &amp;jmp_table, 0); return 0; } SEC(\"tc\") int not_safe(struct __sk_buff *sk) { int *p = (void *)(long)sk-&gt;data; ... make p valid ... tail_call(sk); *p = 42; /* esto no es seguro */ ... } La función tc_bpf2bpf.c:subprog_tc() debe modificarse: márquela como una función que puede invalidar punteros de paquetes. De lo contrario, no se puede reemplazar con tailcall_freplace.c:entry_freplace(), que realiza una llamada de cola.","source":"nvd"}],"published":"2025-05-05T14:53:34.153Z","modified":"2026-10-15T22:18:06.170Z","severity":{"scorer":"Linux","scheme":"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,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"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,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-476"],"affected":[{"ranges":[{"type":"git","introduced":"51c39bb1d5d105a02e29aa7960f0a395086e6342","fixed":"f1692ee23dcaaddc24ba407b269707ee5df1301f","status":"affected"},{"type":"git","introduced":"51c39bb1d5d105a02e29aa7960f0a395086e6342","fixed":"1c2244437f9ad3dd91215f920401a14f2542dbfc","status":"affected"},{"type":"git","introduced":"51c39bb1d5d105a02e29aa7960f0a395086e6342","fixed":"1a4607ffba35bf2a630aab299e34dd3f6e658d70","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.6","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.6","status":"unaffected"},{"type":"semver","introduced":"6.6.90","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.9","lastAffected":"6.12.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.13","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"5.6","fixed":"6.6.90"},{"status":"affected","introduced":"6.7","fixed":"6.12.9"},{"status":"affected","version":"6.13"},{"status":"affected","version":"6.13"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/f1692ee23dcaaddc24ba407b269707ee5df1301f","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/1c2244437f9ad3dd91215f920401a14f2542dbfc","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/1a4607ffba35bf2a630aab299e34dd3f6e658d70","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-10-15T21:42:22.906Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-58237","url":"https://www.cve.org/CVERecord?id=CVE-2024-58237","licence":"CVE Terms of Use","modified":"2026-10-15T21:51:51.261Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-58237","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-58237","licence":"Public domain","modified":"2026-10-15T22:18:06.170Z"}],"updatedAt":"2026-11-25T22:58:52.580Z","epss":{"score":0.00198,"percentile":0.10138,"date":"2026-12-01T12:00:22.000Z"}}