{"id":"CVE-2021-46974","aliases":["CVE-2021-46974"],"related":[],"kind":"vulnerability","state":"published","title":"bpf: Fix masking negation logic upon negative dst register","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: bpf: corrige la lógica de negación de enmascaramiento en el registro dst negativo. La lógica de negación para el caso en el que off_reg se encuentra en el registro dst no es correcta, dado que entonces no podemos simplemente invertir la adición a un sub o viceversa. Como solución, realice la operación final bit a bit incondicionalmente en AX desde off_reg, luego mueva el puntero de src a dst y finalmente use AX como fuente para la operación aritmética del puntero original de modo que la inversión produzca un resultado correcto. El único movimiento que no sea AX en el medio es posible dado que el cegamiento constante lo retiene, ya que no es una operación inmediata.","source":"nvd"}],"published":"2024-02-27T18:47:08.487Z","modified":"2026-08-05T08:45:20.335Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":7.1,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"ae03b6b1c880a03d4771257336dc3bca156dd51b","fixed":"4d542ddb88fb2f39bf7f14caa2902f3e8d06f6ba","status":"affected"},{"type":"git","introduced":"f92a819b4cbef8c9527d9797110544b2055a4b96","fixed":"0e2dfdc74a7f4036127356d42ea59388f153f42c","status":"affected"},{"type":"git","introduced":"979d63d50c0c0f7bc537bf821e056cc9fe5abd38","fixed":"53e0db429b37a32b8fc706d0d90eb4583ad13848","status":"affected"},{"type":"git","introduced":"979d63d50c0c0f7bc537bf821e056cc9fe5abd38","fixed":"2cfa537674cd1051a3b8111536d77d0558f33d5d","status":"affected"},{"type":"git","introduced":"979d63d50c0c0f7bc537bf821e056cc9fe5abd38","fixed":"6eba92a4d4be8feb4dc33976abac544fa99d6ecc","status":"affected"},{"type":"git","introduced":"979d63d50c0c0f7bc537bf821e056cc9fe5abd38","fixed":"7cf64d8679ca1cb20cf57d6a88bfee79a0922a66","status":"affected"},{"type":"git","introduced":"979d63d50c0c0f7bc537bf821e056cc9fe5abd38","fixed":"b9b34ddbe2076ade359cd5ce7537d5ed019e9807","status":"affected"},{"type":"git","version":"078da99d449f64ca04d459cdbdcce513b64173cd","status":"affected"},{"type":"semver","introduced":"4.14.113","fixed":"4.14.233","status":"affected"},{"type":"semver","introduced":"4.19.19","fixed":"4.19.190","status":"affected"},{"type":"semver","introduced":"4.20.6","fixed":"4.21","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.0","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.0","status":"unaffected"},{"type":"semver","introduced":"4.14.233","lastAffected":"4.14.*","status":"unaffected"},{"type":"semver","introduced":"4.19.190","lastAffected":"4.19.*","status":"unaffected"},{"type":"semver","introduced":"5.4.117","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.35","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.11.19","lastAffected":"5.11.*","status":"unaffected"},{"type":"semver","introduced":"5.12.2","lastAffected":"5.12.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"5.13","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"4.14.113","fixed":"4.14.233"},{"status":"affected","introduced":"4.19.19","fixed":"4.19.190"},{"status":"affected","introduced":"5.0","fixed":"5.4.117"},{"status":"affected","introduced":"5.5","fixed":"5.10.35"},{"status":"affected","introduced":"5.11","fixed":"5.11.19"},{"status":"affected","introduced":"5.12","fixed":"5.12.2"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/4d542ddb88fb2f39bf7f14caa2902f3e8d06f6ba","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0e2dfdc74a7f4036127356d42ea59388f153f42c","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/53e0db429b37a32b8fc706d0d90eb4583ad13848","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/2cfa537674cd1051a3b8111536d77d0558f33d5d","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6eba92a4d4be8feb4dc33976abac544fa99d6ecc","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7cf64d8679ca1cb20cf57d6a88bfee79a0922a66","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/b9b34ddbe2076ade359cd5ce7537d5ed019e9807","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-03-05T16:32:03.243Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-46974","url":"https://www.cve.org/CVERecord?id=CVE-2021-46974","licence":"CVE Terms of Use","modified":"2026-08-05T08:45:20.335Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-46974","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-46974","licence":"Public domain","modified":"2026-08-04T10:16:39.310Z"}],"updatedAt":"2026-11-25T22:58:08.595Z","epss":{"score":0.00249,"percentile":0.17409,"date":"2026-12-01T12:00:22.000Z"}}