# CVE-2022-49961: bpf: Do mark\_chain\_precision for ARG\_CONST\_ALLOC\_SIZE\_OR\_ZERO

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.1
- **CVSS:** 7.1 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.30% (percentile 15, 2026-11-26)
- **CWE:** CWE-125
- **Published:** 2025-06-18T11:00:22.399Z
- **Modified:** 2026-11-05T20:17:18.880Z

## Who should check

- Anyone running Linux \>= 457f44363a8894135c85b7a9afd2bd8196db24ab, \< 65efb481eb4572fce0f20aa6c13e880816b81579; \>= 457f44363a8894135c85b7a9afd2bd8196db24ab, \< 987b4c465ba28c662ca857be6c20fd2d96bc55f0; \>= 457f44363a8894135c85b7a9afd2bd8196db24ab, \< 2459615a8d7f44ac81f0965bc094e55ccb254717; \>= 457f44363a8894135c85b7a9afd2bd8196db24ab, \< 2fc31465c5373b5ca4edf2e5238558cb62902311
- Anyone running Linux 5.8

## Description

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

bpf: Do mark\_chain\_precision for ARG\_CONST\_ALLOC\_SIZE\_OR\_ZERO

Precision markers need to be propagated whenever we have an ARG\_CONST\_\*
style argument, as the verifier cannot consider imprecise scalars to be
equivalent for the purposes of states\_equal check when such arguments
refine the return value (in this case, set mem\_size for PTR\_TO\_MEM). The
resultant mem\_size for the R0 is derived from the constant value, and if
the verifier incorrectly prunes states considering them equivalent where
such arguments exist (by seeing that both registers have reg-\>precise as
false in regsafe), we can end up with invalid programs passing the
verifier which can do access beyond what should have been the correct
mem\_size in that explored state.

To show a concrete example of the problem:

0000000000000000 \<prog\>:
       0:       r2 = \*(u32 \*)(r1 + 80)
       1:       r1 = \*(u32 \*)(r1 + 76)
       2:       r3 = r1
       3:       r3 += 4
       4:       if r3 \> r2 goto +18 \<LBB5\_5\>
       5:       w2 = 0
       6:       \*(u32 \*)(r1 + 0) = r2
       7:       r1 = \*(u32 \*)(r1 + 0)
       8:       r2 = 1
       9:       if w1 == 0 goto +1 \<LBB5\_3\>
      10:       r2 = -1

0000000000000058 \<LBB5\_3\>:
      11:       r1 = 0 ll
      13:       r3 = 0
      14:       call bpf\_ringbuf\_reserve
      15:       if r0 == 0 goto +7 \<LBB5\_5\>
      16:       r1 = r0
      17:       r1 += 16777215
      18:       w2 = 0
      19:       \*(u8 \*)(r1 + 0) = r2
      20:       r1 = r0
      21:       r2 = 0
      22:       call bpf\_ringbuf\_submit

00000000000000b8 \<LBB5\_5\>:
      23:       w0 = 0
      24:       exit

For the first case, the single line execution's exploration will prune
the search at insn 14 for the branch insn 9's second leg as it will be
verified first using r2 = -1 (UINT\_MAX), while as w1 at insn 9 will
always be 0 so at runtime we don't get error for being greater than
UINT\_MAX/4 from bpf\_ringbuf\_reserve. The verifier during regsafe just
sees reg-\>precise as false for both r2 registers in both states, hence
considers them equal for purposes of states\_equal.

If we propagated precise markers using the backtracking support, we
would use the precise marking to then ensure that old r2 (UINT\_MAX) was
within the new r2 (1) and this would never be true, so the verification
would rightfully fail.

The end result is that the out of bounds access at instruction 19 would
be permitted without this fix.

Note that reg-\>precise is always set to true when user does not have
CAP\_BPF (or when subprog count is greater than 1 (i.e. use of any static
or global functions)), hence this is only a problem when precision marks
need to be explicitly propagated (i.e. privileged users with CAP\_BPF).

A simplified test case has been included in the next patch to prevent
future regressions.

## Affected and fixed versions

- Linux: \>= 457f44363a8894135c85b7a9afd2bd8196db24ab, \< 65efb481eb4572fce0f20aa6c13e880816b81579; \>= 457f44363a8894135c85b7a9afd2bd8196db24ab, \< 987b4c465ba28c662ca857be6c20fd2d96bc55f0; \>= 457f44363a8894135c85b7a9afd2bd8196db24ab, \< 2459615a8d7f44ac81f0965bc094e55ccb254717; \>= 457f44363a8894135c85b7a9afd2bd8196db24ab, \< 2fc31465c5373b5ca4edf2e5238558cb62902311 (cvelist)
- Linux: 5.8 (cvelist)

## Mitigation

- Upgrade Linux to 2fc31465c5373b5ca4edf2e5238558cb62902311 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-49961. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-49961.md
Affected: Linux >= 457f44363a8894135c85b7a9afd2bd8196db24ab, < 65efb481eb4572fce0f20aa6c13e880816b81579; >= 457f44363a8894135c85b7a9afd2bd8196db24ab, < 987b4c465ba28c662ca857be6c20fd2d96bc55f0; >= 457f44363a8894135c85b7a9afd2bd8196db24ab, < 2459615a8d7f44ac81f0965bc094e55ccb254717; >= 457f44363a8894135c85b7a…
Fixed in: Linux 65efb481eb4572fce0f20aa6c13e880816b81579, Linux 987b4c465ba28c662ca857be6c20fd2d96bc55f0, Linux 2459615a8d7f44ac81f0965bc094e55ccb254717, Linux 2fc31465c5373b5ca4edf2e5238558cb62902311

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-49961 being exploited?

There is no confirmed exploitation: CVE-2022-49961 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.30% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-49961?

High: CVSS 7.1 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2022-49961?

Linux \>= 457f44363a8894135c85b7a9afd2bd8196db24ab, \< 65efb481eb4572fce0f20aa6c13e880816b81579; \>= 457f44363a8894135c85b7a9afd2bd8196db24ab, \< 987b4c465ba28c662ca857be6c20fd2d96bc55f0; \>= 457f44363a8894135c85b7a9afd2bd8196db24ab, \< 2459615a8d7f44ac81f0965bc094e55ccb254717; \>= 457f44363a8894135c85b7a9afd2bd8196db24ab, \< 2fc31465c5373b5ca4edf2e5238558cb62902311; Linux 5.8.

### Is there a fix for CVE-2022-49961?

Yes. Fixed in Linux 65efb481eb4572fce0f20aa6c13e880816b81579, Linux 987b4c465ba28c662ca857be6c20fd2d96bc55f0, Linux 2459615a8d7f44ac81f0965bc094e55ccb254717, Linux 2fc31465c5373b5ca4edf2e5238558cb62902311. Upgrade Linux to 2fc31465c5373b5ca4edf2e5238558cb62902311 or later.

### How do I check if I'm affected by CVE-2022-49961?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/2459615a8d7f44ac81f0965bc094e55ccb254717>
- patch: <https://git.kernel.org/stable/c/2fc31465c5373b5ca4edf2e5238558cb62902311>
- other: <https://git.kernel.org/stable/c/65efb481eb4572fce0f20aa6c13e880816b81579>
- other: <https://git.kernel.org/stable/c/987b4c465ba28c662ca857be6c20fd2d96bc55f0>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-49961>

HTML: <https://flawdb.com/CVE-2022-49961> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-49961>
