bpf: Fix masking negation logic upon negative dst register
Summary
| CVE | CVE-2021-46974 |
|---|---|
| State | PUBLISHED |
| Assigner | Linux |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2024-02-27 19:04:07 UTC |
| Updated | 2026-08-04 10:16:39 UTC |
| 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. |
Risk And Classification
Primary CVSS: v3.1 5.5 MEDIUM from [email protected]
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Problem Types: NVD-CWE-noinfo
| Version | Source | Type | Score | Severity | Vector |
|---|---|---|---|---|---|
| 3.1 | [email protected] | Primary | 5.5 | MEDIUM | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| 3.1 | 416baaa9-dc9f-4396-8d5f-8c081fb06d67 | Secondary | 7.1 | HIGH | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H |
| 3.1 | CNA | DECLARED | 7.1 | HIGH | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H |
CVSS v3.1 Breakdown
Attack Vector
LocalAttack Complexity
LowPrivileges Required
LowUser Interaction
NoneScope
UnchangedConfidentiality
NoneIntegrity
NoneAvailability
HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
NVD Known Affected Configurations (CPE 2.3)
| Type | Vendor | Product | Version | Update | Edition | Language |
|---|---|---|---|---|---|---|
| Operating System | Linux | Linux Kernel | All | All | All | All |
Vendor Declared Affected Products
| Source | Vendor | Product | Version | Platforms |
|---|---|---|---|---|
| CNA | Linux | Linux | affected ae03b6b1c880a03d4771257336dc3bca156dd51b 4d542ddb88fb2f39bf7f14caa2902f3e8d06f6ba git | Not specified |
| CNA | Linux | Linux | affected f92a819b4cbef8c9527d9797110544b2055a4b96 0e2dfdc74a7f4036127356d42ea59388f153f42c git | Not specified |
| CNA | Linux | Linux | affected 979d63d50c0c0f7bc537bf821e056cc9fe5abd38 53e0db429b37a32b8fc706d0d90eb4583ad13848 git | Not specified |
| CNA | Linux | Linux | affected 979d63d50c0c0f7bc537bf821e056cc9fe5abd38 2cfa537674cd1051a3b8111536d77d0558f33d5d git | Not specified |
| CNA | Linux | Linux | affected 979d63d50c0c0f7bc537bf821e056cc9fe5abd38 6eba92a4d4be8feb4dc33976abac544fa99d6ecc git | Not specified |
| CNA | Linux | Linux | affected 979d63d50c0c0f7bc537bf821e056cc9fe5abd38 7cf64d8679ca1cb20cf57d6a88bfee79a0922a66 git | Not specified |
| CNA | Linux | Linux | affected 979d63d50c0c0f7bc537bf821e056cc9fe5abd38 b9b34ddbe2076ade359cd5ce7537d5ed019e9807 git | Not specified |
| CNA | Linux | Linux | affected 078da99d449f64ca04d459cdbdcce513b64173cd git | Not specified |
| CNA | Linux | Linux | affected 4.14.113 4.14.233 semver | Not specified |
| CNA | Linux | Linux | affected 4.19.19 4.19.190 semver | Not specified |
| CNA | Linux | Linux | affected 4.20.6 4.21 semver | Not specified |
| CNA | Linux | Linux | affected 5.0 | Not specified |
| CNA | Linux | Linux | unaffected 5.0 semver | Not specified |
| CNA | Linux | Linux | unaffected 4.14.233 4.14.* semver | Not specified |
| CNA | Linux | Linux | unaffected 4.19.190 4.19.* semver | Not specified |
| CNA | Linux | Linux | unaffected 5.4.117 5.4.* semver | Not specified |
| CNA | Linux | Linux | unaffected 5.10.35 5.10.* semver | Not specified |
| CNA | Linux | Linux | unaffected 5.11.19 5.11.* semver | Not specified |
| CNA | Linux | Linux | unaffected 5.12.2 5.12.* semver | Not specified |
| CNA | Linux | Linux | unaffected 5.13 * original_commit_for_fix | Not specified |
References
| Reference | Source | Link | Tags |
|---|---|---|---|
| git.kernel.org/stable/c/7cf64d8679ca1cb20cf57d6a88bfee79a0922a66 | af854a3a-2127-422b-91ae-364da2661108 | git.kernel.org | Patch |
| git.kernel.org/stable/c/0e2dfdc74a7f4036127356d42ea59388f153f42c | af854a3a-2127-422b-91ae-364da2661108 | git.kernel.org | Patch |
| git.kernel.org/stable/c/b9b34ddbe2076ade359cd5ce7537d5ed019e9807 | af854a3a-2127-422b-91ae-364da2661108 | git.kernel.org | Patch |
| git.kernel.org/stable/c/4d542ddb88fb2f39bf7f14caa2902f3e8d06f6ba | af854a3a-2127-422b-91ae-364da2661108 | git.kernel.org | Patch |
| git.kernel.org/stable/c/2cfa537674cd1051a3b8111536d77d0558f33d5d | af854a3a-2127-422b-91ae-364da2661108 | git.kernel.org | Patch |
| git.kernel.org/stable/c/53e0db429b37a32b8fc706d0d90eb4583ad13848 | af854a3a-2127-422b-91ae-364da2661108 | git.kernel.org | Patch |
| git.kernel.org/stable/c/6eba92a4d4be8feb4dc33976abac544fa99d6ecc | af854a3a-2127-422b-91ae-364da2661108 | git.kernel.org | Patch |
| CVE Program record | CVE.ORG | www.cve.org | canonical |
| NVD vulnerability detail | NVD | nvd.nist.gov | canonical, analysis |
No vendor comments have been submitted for this CVE.
Legacy QID Mappings
- 755966 SUSE Enterprise Linux Security Update for the linux kernel (SUSE-SU-2024:0857-1)
- 755988 SUSE Enterprise Linux Security Update for the Linux Kernel (SUSE-SU-2024:0975-1)
- 756004 SUSE Enterprise Linux Security Update for the Linux Kernel (SUSE-SU-2024:0926-1)
- 756005 SUSE Enterprise Linux Security Update for the Linux Kernel (SUSE-SU-2024:0925-1)