# CVE-2024-49861: bpf: Fix helper writes to read-only maps

- Priority: **Routine**
- Reason: Not severe (CVSS 7.8, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2024-10-21 · Modified: 2026-08-05
- Aliases: UBUNTU-CVE-2024-49861, DEBIAN-CVE-2024-49861
- Record: https://cvemate.com/vulnerability/CVE-2024-49861 · JSON: https://cvemate.com/vulnerability/CVE-2024-49861/json

## Description

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

bpf: Fix helper writes to read-only maps

Lonial found an issue that despite user- and BPF-side frozen BPF map
(like in case of .rodata), it was still possible to write into it from
a BPF program side through specific helpers having ARG_PTR_TO_{LONG,INT}
as arguments.

In check_func_arg() when the argument is as mentioned, the meta->raw_mode
is never set. Later, check_helper_mem_access(), under the case of
PTR_TO_MAP_VALUE as register base type, it assumes BPF_READ for the
subsequent call to check_map_access_type() and given the BPF map is
read-only it succeeds.

The helpers really need to be annotated as ARG_PTR_TO_{LONG,INT} | MEM_UNINIT
when results are written into them as opposed to read out of them. The
latter indicates that it's okay to pass a pointer to uninitialized memory
as the memory is written to anyway.

However, ARG_PTR_TO_{LONG,INT} is a special case of ARG_PTR_TO_FIXED_SIZE_MEM
just with additional alignment requirement. So it is better to just get
rid of the ARG_PTR_TO_{LONG,INT} special cases altogether and reuse the
fixed size memory types. For this, add MEM_ALIGNED to additionally ensure
alignment given these helpers write directly into the args via *<ptr> = val.
The .arg*_size has been initialized reflecting the actual sizeof(*<ptr>).

MEM_ALIGNED can only be used in combination with MEM_FIXED_SIZE annotated
argument types, since in !MEM_FIXED_SIZE cases the verifier does not know
the buffer size a priori and therefore cannot blindly write *<ptr> = val.
```

## Signals

- CVSS: 7.8 high (v3.1, CVE.org) CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- EPSS: 0.245%, percentile 16.834%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 135)

- debian linux (Debian): \< 6.1.123-1 \| \< 6.11.2-1
- ubuntu linux (Ubuntu): All versions (No fix recorded) \| \< 6.8.0-54.56
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): All versions (No fix recorded) \| \< 6.8.0-1023.25
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.15 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.4 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.2 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.5 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.8 (Ubuntu): \< 6.8.0-1023.25~22.04.1
- ubuntu linux-aws-fips (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure (Ubuntu): All versions (No fix recorded) \| \< 6.8.0-1025.30
- ubuntu linux-azure-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.15 (Ubuntu): All versions (No fix recorded)

## References (first 20 of 26)

- <https://git.kernel.org/stable/c/988e55abcf7fdb8fc9a76a7cf3f4e939a4d4fb3a>
- <https://git.kernel.org/stable/c/a2c8dc7e21803257e762b0bf067fd13e9c995da0>
- <https://git.kernel.org/stable/c/2ed98ee02d1e08afee88f54baec39ea78dc8a23c>
- <https://git.kernel.org/stable/c/1e75d25133158b525e0456876e9bcfd6b2993fd5>
- <https://git.kernel.org/stable/c/32556ce93bc45c730829083cb60f95a2728ea48b>
- <https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html>
- <https://ubuntu.com/security/CVE-2024-49861>
- <https://www.cve.org/CVERecord?id=CVE-2024-49861>
- <https://git.kernel.org/linus/32556ce93bc45c730829083cb60f95a2728ea48b>
- <https://ubuntu.com/security/notices/USN-7276-1>
- <https://ubuntu.com/security/notices/USN-7277-1>
- <https://ubuntu.com/security/notices/USN-7301-1>
- <https://ubuntu.com/security/notices/USN-7303-1>
- <https://ubuntu.com/security/notices/USN-7304-1>
- <https://ubuntu.com/security/notices/USN-7303-2>
- <https://ubuntu.com/security/notices/USN-7310-1>
- <https://ubuntu.com/security/notices/USN-7311-1>
- <https://ubuntu.com/security/notices/USN-7303-3>
- <https://ubuntu.com/security/notices/USN-7384-1>
- <https://ubuntu.com/security/notices/USN-7385-1>

---

Data as of 2026-12-05T06:34:44.007Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
