{"id":"CVE-2026-31525","aliases":["CVE-2026-31525"],"related":[],"kind":"vulnerability","state":"published","title":"bpf: Fix undefined behavior in interpreter sdiv/smod for INT_MIN","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix undefined behavior in interpreter sdiv/smod for INT_MIN\n\nThe BPF interpreter's signed 32-bit division and modulo handlers use\nthe kernel abs() macro on s32 operands. The abs() macro documentation\n(include/linux/math.h) explicitly states the result is undefined when\nthe input is the type minimum. When DST contains S32_MIN (0x80000000),\nabs((s32)DST) triggers undefined behavior and returns S32_MIN unchanged\non arm64/x86. This value is then sign-extended to u64 as\n0xFFFFFFFF80000000, causing do_div() to compute the wrong result.\n\nThe verifier's abstract interpretation (scalar32_min_max_sdiv) computes\nthe mathematically correct result for range tracking, creating a\nverifier/interpreter mismatch that can be exploited for out-of-bounds\nmap value access.\n\nIntroduce abs_s32() which handles S32_MIN correctly by casting to u32\nbefore negating, avoiding signed overflow entirely. Replace all 8\nabs((s32)...) call sites in the interpreter's sdiv32/smod32 handlers.\n\ns32 is the only affected case -- the s64 division/modulo handlers do\nnot use abs().","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix undefined behavior in interpreter sdiv/smod for INT_MIN\n\nThe BPF interpreter's signed 32-bit division and modulo handlers use\nthe kernel abs() macro on s32 operands. The abs() macro documentation\n(include/linux/math.h) explicitly states the result is undefined when\nthe input is the type minimum. When DST contains S32_MIN (0x80000000),\nabs((s32)DST) triggers undefined behavior and returns S32_MIN unchanged\non arm64/x86. This value is then sign-extended to u64 as\n0xFFFFFFFF80000000, causing do_div() to compute the wrong result.\n\nThe verifier's abstract interpretation (scalar32_min_max_sdiv) computes\nthe mathematically correct result for range tracking, creating a\nverifier/interpreter mismatch that can be exploited for out-of-bounds\nmap value access.\n\nIntroduce abs_s32() which handles S32_MIN correctly by casting to u32\nbefore negating, avoiding signed overflow entirely. Replace all 8\nabs((s32)...) call sites in the interpreter's sdiv32/smod32 handlers.\n\ns32 is the only affected case -- the s64 division/modulo handlers do\nnot use abs().","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nbpf: Corrige el comportamiento indefinido en el intérprete sdiv/smod para INT_MIN\n\nLos manejadores de división y módulo con signo de 32 bits del intérprete BPF usan la macro abs() del kernel en operandos s32. La documentación de la macro abs() (include/linux/math.h) establece explícitamente que el resultado es indefinido cuando la entrada es el mínimo del tipo. Cuando DST contiene S32_MIN (0x 80000000), abs((s32)DST) desencadena un comportamiento indefinido y devuelve S32_MIN sin cambios en arm64/x86. Este valor es luego extendido por signo a u64 como 0x FFFFFFFF80000000, haciendo que do_div() calcule el resultado incorrecto.\n\nLa interpretación abstracta del verificador (scalar32_min_max_sdiv) calcula el resultado matemáticamente correcto para el seguimiento de rangos, creando una discrepancia entre verificador/intérprete que puede ser explotada para acceso a valores de mapa fuera de límites.\n\nSe introduce abs_s32() que maneja S32_MIN correctamente al convertir a u32 antes de negar, evitando completamente el desbordamiento con signo. Reemplazar los 8 sitios de llamada de abs((s32)...) en los manejadores sdiv32/smod32 del intérprete.\n\ns32 es el único caso afectado - - los manejadores de división/módulo s64 no usan abs().","source":"nvd"}],"published":"2026-04-22T13:54:39.144Z","modified":"2026-11-11T23:10:00.263Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"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:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-190","CWE-787"],"affected":[{"ranges":[{"type":"git","introduced":"ec0e2da95f72d4a46050a4d994e4fe471474fd80","fixed":"694ea55f1b1c74f9942d91ec366ae9e822422e42","status":"affected"},{"type":"git","introduced":"ec0e2da95f72d4a46050a4d994e4fe471474fd80","fixed":"9ab1227765c446942f290c83382f0b19887c55cf","status":"affected"},{"type":"git","introduced":"ec0e2da95f72d4a46050a4d994e4fe471474fd80","fixed":"f14ca604c0ff274fba19f73f1f0485c0047c1396","status":"affected"},{"type":"git","introduced":"ec0e2da95f72d4a46050a4d994e4fe471474fd80","fixed":"0d5d8c3ce45c734aaf3c51cbef59155a6746157d","status":"affected"},{"type":"git","introduced":"ec0e2da95f72d4a46050a4d994e4fe471474fd80","fixed":"c77b30bd1dcb61f66c640ff7d2757816210c7cb0","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.6","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.6","status":"unaffected"},{"type":"semver","introduced":"6.6.131","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.80","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.21","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"6.19.11","lastAffected":"6.19.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.0","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":"6.6","fixed":"6.6.131"},{"status":"affected","introduced":"6.7","fixed":"6.12.80"},{"status":"affected","introduced":"6.13","fixed":"6.18.21"},{"status":"affected","introduced":"6.19","fixed":"6.19.11"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/694ea55f1b1c74f9942d91ec366ae9e822422e42","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9ab1227765c446942f290c83382f0b19887c55cf","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f14ca604c0ff274fba19f73f1f0485c0047c1396","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0d5d8c3ce45c734aaf3c51cbef59155a6746157d","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c77b30bd1dcb61f66c640ff7d2757816210c7cb0","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-10-16T15:10:36.308Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-31525","url":"https://www.cve.org/CVERecord?id=CVE-2026-31525","licence":"CVE Terms of Use","modified":"2026-10-19T18:45:54.927Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-31525","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31525","licence":"Public domain","modified":"2026-11-11T23:10:00.263Z"}],"updatedAt":"2026-11-25T22:59:19.311Z","epss":{"score":0.0017,"percentile":0.06622,"date":"2026-12-01T12:00:22.000Z"}}