# CVE-2024-58237: bpf: consider that tail calls invalidate packet pointers

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.20%, higher than 10% of CVEs (2026-12-01)
- Published: 2025-05-05T14:53:34.153Z
- Modified: 2026-10-15T22:18:06.170Z
- Weaknesses: CWE-476
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

bpf: consider that tail calls invalidate packet pointers

Tail-called programs could execute any of the helpers that invalidate
packet pointers. Hence, conservatively assume that each tail call
invalidates packet pointers.

Making the change in bpf_helper_changes_pkt_data() automatically makes
use of check_cfg() logic that computes 'changes_pkt_data' effect for
global sub-programs, such that the following program could be
rejected:

    int tail_call(struct __sk_buff *sk)
    {
    	bpf_tail_call_static(sk, &jmp_table, 0);
    	return 0;
    }

    SEC("tc")
    int not_safe(struct __sk_buff *sk)
    {
    	int *p = (void *)(long)sk->data;
    	... make p valid ...
    	tail_call(sk);
    	*p = 42; /* this is unsafe */
    	...
    }

The tc_bpf2bpf.c:subprog_tc() needs change: mark it as a function that
can invalidate packet pointers. Otherwise, it can't be freplaced with
tailcall_freplace.c:entry_freplace() that does a tail call.

(As written by CVE List.)

## Affected

- Linux Linux: from 51c39bb1d5d105a02e29aa7960f0a395086e6342 before f1692ee23dcaaddc24ba407b269707ee5df1301f; from 51c39bb1d5d105a02e29aa7960f0a395086e6342 before 1c2244437f9ad3dd91215f920401a14f2542dbfc; from 51c39bb1d5d105a02e29aa7960f0a395086e6342 before 1a4607ffba35bf2a630aab299e34dd3f6e658d70; 5.6 (not affected: before 5.6; from 6.6.90 up to 6.6.*; from 6.12.9 up to 6.12.*; from 6.13 up to *)
- linux linux_kernel: from 5.6 before 6.6.90; from 6.7 before 6.12.9; 6.13

## Every score

- Linux: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/f1692ee23dcaaddc24ba407b269707ee5df1301f> (patch)
- <https://git.kernel.org/stable/c/1c2244437f9ad3dd91215f920401a14f2542dbfc> (patch)
- <https://git.kernel.org/stable/c/1a4607ffba35bf2a630aab299e34dd3f6e658d70> (patch)

## Sources

- CVE List: [CVE-2024-58237](https://www.cve.org/CVERecord?id=CVE-2024-58237), CVE Terms of Use, modified 2026-10-15
- NVD: [CVE-2024-58237](https://nvd.nist.gov/vuln/detail/CVE-2024-58237), Public domain, modified 2026-10-15

---

Page: https://cve.day/CVE-2024-58237 · Whole record: https://cve.day/CVE-2024-58237.json · Rebuilt by cve.day 2026-11-25T22:58:52.580Z
