# CVE-2021-46974: bpf: Fix masking negation logic upon negative dst register

> 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, CNA) `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.25% (percentile 10, 2026-11-26)
- **Published:** 2024-02-27T18:47:08.487Z
- **Modified:** 2026-08-05T08:45:20.335Z

## Who should check

- Anyone running Linux \>= ae03b6b1c880a03d4771257336dc3bca156dd51b, \< 4d542ddb88fb2f39bf7f14caa2902f3e8d06f6ba; \>= f92a819b4cbef8c9527d9797110544b2055a4b96, \< 0e2dfdc74a7f4036127356d42ea59388f153f42c; \>= 979d63d50c0c0f7bc537bf821e056cc9fe5abd38, \< 53e0db429b37a32b8fc706d0d90eb4583ad13848; \>= 979d63d50c0c0f7bc537bf821e056cc9fe5abd38, \< 2cfa537674cd1051a3b8111536d77d0558f33d5d; \>= 979d63d50c0c0f7bc537bf821e056cc9fe5abd38, \< 6eba92a4d4be8feb4dc33976abac544fa99d6ecc; \>= 979d63d50c0c0f7bc537bf821e056cc9fe5abd38, \< 7cf64d8679ca1cb20cf57d6a88bfee79a0922a66; \>= 979d63d50c0c0f7bc537bf821e056cc9fe5abd38, \< b9b34ddbe2076ade359cd5ce7537d5ed019e9807; 078da99d449f64ca04d459cdbdcce513b64173cd; \>= 4.14.113, \< 4.14.233; \>= 4.19.19, \< 4.19.190; …
- Anyone running Linux 5.0

## Description

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

bpf: Fix masking negation logic upon negative dst register

The negation logic for the case where the off\_reg is sitting in the
dst register is not correct given then we cannot just invert the add
to a sub or vice versa. As a fix, perform the final bitwise and-op
unconditionally into AX from the off\_reg, then move the pointer from
the src to dst and finally use AX as the source for the original
pointer arithmetic operation such that the inversion yields a correct
result. The single non-AX mov in between is possible given constant
blinding is retaining it as it's not an immediate based operation.

## Affected and fixed versions

- Linux: \>= ae03b6b1c880a03d4771257336dc3bca156dd51b, \< 4d542ddb88fb2f39bf7f14caa2902f3e8d06f6ba; \>= f92a819b4cbef8c9527d9797110544b2055a4b96, \< 0e2dfdc74a7f4036127356d42ea59388f153f42c; \>= 979d63d50c0c0f7bc537bf821e056cc9fe5abd38, \< 53e0db429b37a32b8fc706d0d90eb4583ad13848; \>= 979d63d50c0c0f7bc537bf821e056cc9fe5abd38, \< 2cfa537674cd1051a3b8111536d77d0558f33d5d; \>= 979d63d50c0c0f7bc537bf821e056cc9fe5abd38, \< 6eba92a4d4be8feb4dc33976abac544fa99d6ecc; \>= 979d63d50c0c0f7bc537bf821e056cc9fe5abd38, \< 7cf64d8679ca1cb20cf57d6a88bfee79a0922a66; \>= 979d63d50c0c0f7bc537bf821e056cc9fe5abd38, \< b9b34ddbe2076ade359cd5ce7537d5ed019e9807; 078da99d449f64ca04d459cdbdcce513b64173cd; \>= 4.14.113, \< 4.14.233; \>= 4.19.19, \< 4.19.190; … (cvelist)
- Linux: 5.0 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2021-46974.md
Affected: Linux >= ae03b6b1c880a03d4771257336dc3bca156dd51b, < 4d542ddb88fb2f39bf7f14caa2902f3e8d06f6ba; >= f92a819b4cbef8c9527d9797110544b2055a4b96, < 0e2dfdc74a7f4036127356d42ea59388f153f42c; >= 979d63d50c0c0f7bc537bf821e056cc9fe5abd38, < 53e0db429b37a32b8fc706d0d90eb4583ad13848; >= 979d63d50c0c0f7bc537bf8…
Fixed in: Linux 4d542ddb88fb2f39bf7f14caa2902f3e8d06f6ba, Linux 0e2dfdc74a7f4036127356d42ea59388f153f42c, Linux 53e0db429b37a32b8fc706d0d90eb4583ad13848, Linux 2cfa537674cd1051a3b8111536d77d0558f33d5d, Linux 6eba92a4d4be8feb4dc33976abac544fa99d6ecc, Linux 7cf64d8679ca1cb20cf57d6a88bfee79a0922a66, Linux 4.14.…

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-2021-46974 being exploited?

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

### How serious is CVE-2021-46974?

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

### Which versions are affected by CVE-2021-46974?

Linux \>= ae03b6b1c880a03d4771257336dc3bca156dd51b, \< 4d542ddb88fb2f39bf7f14caa2902f3e8d06f6ba; \>= f92a819b4cbef8c9527d9797110544b2055a4b96, \< 0e2dfdc74a7f4036127356d42ea59388f153f42c; \>= 979d63d50c0c0f7bc537bf821e056cc9fe5abd38, \< 53e0db429b37a32b8fc706d0d90eb4583ad13848; \>= 979d63d50c0c0f7bc537bf821e056cc9fe5abd38, \< 2cfa537674cd1051a3b8111536d77d0558f33d5d; \>= 979d63d50c0c0f7bc537bf821e056cc9fe5abd38, \< 6eba92a4d4be8feb4dc33976abac544fa99d6ecc; \>= 979d63d50c0c0f7bc537bf821e056cc9fe5abd38, \< 7cf64d8679ca1cb20cf57d6a88bfee79a0922a66; \>= 979d63d50c0c0f7bc537bf821e056cc9fe5abd38, \< b9b34ddbe2076ade359cd5ce7537d5ed019e9807; 078da99d449f64ca04d459cdbdcce513b64173cd; \>= 4.14.113, \< 4.14.233; \>= 4.19.19, \< 4.19.190; …; Linux 5.0.

### Is there a fix for CVE-2021-46974?

Yes. Fixed in Linux 4d542ddb88fb2f39bf7f14caa2902f3e8d06f6ba, Linux 0e2dfdc74a7f4036127356d42ea59388f153f42c, Linux 53e0db429b37a32b8fc706d0d90eb4583ad13848, Linux 2cfa537674cd1051a3b8111536d77d0558f33d5d, Linux 6eba92a4d4be8feb4dc33976abac544fa99d6ecc, Linux 7cf64d8679ca1cb20cf57d6a88bfee79a0922a66, Linux 4.14.233, Linux 4.19.190. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2021-46974?

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/4d542ddb88fb2f39bf7f14caa2902f3e8d06f6ba>
- patch: <https://git.kernel.org/stable/c/0e2dfdc74a7f4036127356d42ea59388f153f42c>
- patch: <https://git.kernel.org/stable/c/53e0db429b37a32b8fc706d0d90eb4583ad13848>
- patch: <https://git.kernel.org/stable/c/2cfa537674cd1051a3b8111536d77d0558f33d5d>
- patch: <https://git.kernel.org/stable/c/6eba92a4d4be8feb4dc33976abac544fa99d6ecc>
- patch: <https://git.kernel.org/stable/c/7cf64d8679ca1cb20cf57d6a88bfee79a0922a66>
- patch: <https://git.kernel.org/stable/c/b9b34ddbe2076ade359cd5ce7537d5ed019e9807>

## 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-2021-46974>

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