{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2021-46974","id":"CVE-2021-46974","title":"bpf: Fix masking negation logic upon negative dst register","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix masking negation logic upon negative dst register\n\nThe negation logic for the case where the off_reg is sitting in the\ndst register is not correct given then we cannot just invert the add\nto a sub or vice versa. As a fix, perform the final bitwise and-op\nunconditionally into AX from the off_reg, then move the pointer fro","descriptionLong":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix masking negation logic upon negative dst register\n\nThe negation logic for the case where the off_reg is sitting in the\ndst register is not correct given then we cannot just invert the add\nto a sub or vice versa. As a fix, perform the final bitwise and-op\nunconditionally into AX from the off_reg, then move the pointer from\nthe src to dst and finally use AX as the source for the original\npointer arithmetic operation such that the inversion yields a correct\nresult. The single non-AX mov in between is possible given constant\nblinding is retaining it as it's not an immediate based operation.","published":"2024-02-27T18:47:08.487Z","updated":"2026-08-05T08:45:20.335Z","reserved":"2024-02-27T18:42:55.944Z","status":"Modified","rejected":false,"assigner":"Linux","metric":{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","rating":"high","source":"Linux"},"metrics":[{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","rating":"high","source":"Linux"},{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","rating":"high","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"NVD"},{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"OSV"}],"rating":"high","products":["Linux"],"affectedProducts":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"ae03b6b1c880a03d4771257336dc3bca156dd51b","lessThan":"4d542ddb88fb2f39bf7f14caa2902f3e8d06f6ba","status":"affected","versionType":"git"},{"version":"f92a819b4cbef8c9527d9797110544b2055a4b96","lessThan":"0e2dfdc74a7f4036127356d42ea59388f153f42c","status":"affected","versionType":"git"},{"version":"979d63d50c0c0f7bc537bf821e056cc9fe5abd38","lessThan":"53e0db429b37a32b8fc706d0d90eb4583ad13848","status":"affected","versionType":"git"},{"version":"979d63d50c0c0f7bc537bf821e056cc9fe5abd38","lessThan":"2cfa537674cd1051a3b8111536d77d0558f33d5d","status":"affected","versionType":"git"},{"version":"979d63d50c0c0f7bc537bf821e056cc9fe5abd38","lessThan":"6eba92a4d4be8feb4dc33976abac544fa99d6ecc","status":"affected","versionType":"git"},{"version":"979d63d50c0c0f7bc537bf821e056cc9fe5abd38","lessThan":"7cf64d8679ca1cb20cf57d6a88bfee79a0922a66","status":"affected","versionType":"git"},{"version":"979d63d50c0c0f7bc537bf821e056cc9fe5abd38","lessThan":"b9b34ddbe2076ade359cd5ce7537d5ed019e9807","status":"affected","versionType":"git"},{"version":"078da99d449f64ca04d459cdbdcce513b64173cd","status":"affected","versionType":"git"},{"version":"4.14.113","lessThan":"4.14.233","status":"affected","versionType":"semver"},{"version":"4.19.19","lessThan":"4.19.190","status":"affected","versionType":"semver"},{"version":"4.20.6","lessThan":"4.21","status":"affected","versionType":"semver"}],"platforms":[]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.0","status":"affected"},{"version":"0","lessThan":"5.0","status":"unaffected","versionType":"semver"},{"version":"4.14.233","lessThanOrEqual":"4.14.*","status":"unaffected","versionType":"semver"},{"version":"4.19.190","lessThanOrEqual":"4.19.*","status":"unaffected","versionType":"semver"},{"version":"5.4.117","lessThanOrEqual":"5.4.*","status":"unaffected","versionType":"semver"},{"version":"5.10.35","lessThanOrEqual":"5.10.*","status":"unaffected","versionType":"semver"},{"version":"5.11.19","lessThanOrEqual":"5.11.*","status":"unaffected","versionType":"semver"},{"version":"5.12.2","lessThanOrEqual":"5.12.*","status":"unaffected","versionType":"semver"},{"version":"5.13","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}],"platforms":[]}],"packages":[],"cwes":[],"aliases":[],"references":[{"url":"https://git.kernel.org/stable/c/4d542ddb88fb2f39bf7f14caa2902f3e8d06f6ba","tags":["x_transferred","Patch","fix"]},{"url":"https://git.kernel.org/stable/c/0e2dfdc74a7f4036127356d42ea59388f153f42c","tags":["x_transferred","Patch","fix"]},{"url":"https://git.kernel.org/stable/c/53e0db429b37a32b8fc706d0d90eb4583ad13848","tags":["x_transferred","Patch","fix"]},{"url":"https://git.kernel.org/stable/c/2cfa537674cd1051a3b8111536d77d0558f33d5d","tags":["x_transferred","Patch","fix"]},{"url":"https://git.kernel.org/stable/c/6eba92a4d4be8feb4dc33976abac544fa99d6ecc","tags":["x_transferred","Patch","fix"]},{"url":"https://git.kernel.org/stable/c/7cf64d8679ca1cb20cf57d6a88bfee79a0922a66","tags":["x_transferred","Patch","fix"]},{"url":"https://git.kernel.org/stable/c/b9b34ddbe2076ade359cd5ce7537d5ed019e9807","tags":["x_transferred","Patch","fix"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial"},"epss":0.00249,"epssPercentile":0.16456,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2021-46974","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-46974","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2021-46974","ok":true,"note":"0 packages"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2021-46974","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}