# CVE-2024-43843: riscv, bpf: Fix out-of-bounds issue when preparing trampoline image

- Severity: High 7.8 (CVSS:3.1, scored by NVD) `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.31%, higher than 16% of CVEs (2026-11-30)
- Published: 2024-08-17T09:21:57.811Z
- Modified: 2026-06-17T07:51:49.337Z
- Weaknesses: CWE-131
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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

riscv, bpf: Fix out-of-bounds issue when preparing trampoline image

We get the size of the trampoline image during the dry run phase and
allocate memory based on that size. The allocated image will then be
populated with instructions during the real patch phase. But after
commit 26ef208c209a ("bpf: Use arch_bpf_trampoline_size"), the `im`
argument is inconsistent in the dry run and real patch phase. This may
cause emit_imm in RV64 to generate a different number of instructions
when generating the 'im' address, potentially causing out-of-bounds
issues. Let's emit the maximum number of instructions for the "im"
address during dry run to fix this problem.

(As written by CVE List.)

## Affected

- Linux Linux: from 26ef208c209a0e6eed8942a5d191b39dccfa6e38 before 3e6a1b1b179abb643ec3560c02bc3082bc92285f; from 26ef208c209a0e6eed8942a5d191b39dccfa6e38 before 9f1e16fb1fc9826001c69e0551d51fbbcd2d74e9; 6.8 (not affected: before 6.8; from 6.10.3 up to 6.10.*; from 6.11 up to *)
- linux linux_kernel: from 6.8 before 6.10.3

## References

- <https://git.kernel.org/stable/c/3e6a1b1b179abb643ec3560c02bc3082bc92285f> (patch)
- <https://git.kernel.org/stable/c/9f1e16fb1fc9826001c69e0551d51fbbcd2d74e9> (patch)

## Sources

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

---

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