В ядре Linux была устранена следующая уязвимость: bpf: Исправлено неопределённое поведение в интерпретаторе sdiv/smod для подписанного 32-битного деления интерпретатора INT_MIN The BPF, а обработчики по модулю используют макрос ядра abs() на s32-операндах. Документация макроса abs() (include/linux/math.h) явно заявляет, что результат не определен, когда ввод является минимальным. Когда DST содержит S32_MIN (0x80000000), abs(s32)DST запускает неопределённое поведение и возвращает S32_MIN без изменений на arm64/x86.
Затем это значение расширяется до u64 как 0xFFFFFFFF80000000, в результате чего do_div () вычисляет неправильный результат. Абстрактная интерпретация верификатора (scalar32_min_max_sdiv) вычисляет математически правильный результат для отслеживания диапазона, создавая несоответствие верификатора / интерпретатора, которое может быть использовано для доступа к значению карты out-of-bounds. Введите abs_s32(), который корректно обрабатывает S32_MIN, отдавая u32 перед отрицанием, полностью избегая подписанного переполнения.
Замените все 8 узлов вызова abs(s32...) в обработчиках sdiv32/smod32 интерпретатора. s32 является единственным затронутым случаем - обработчики s64 division/modulo не используют abs().
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: bpf: Fix undefined behavior in interpreter sdiv/smod for INT_MIN The BPF interpreter's signed 32-bit division and modulo handlers use the kernel abs() macro on s32 operands. The abs() macro documentation (include/linux/math.h) explicitly states the result is undefined when the input is the type minimum. When DST contains S32_MIN (0x80000000), abs((s32)DST) triggers undefined behavior and returns S32_MIN unchanged on arm64/x86. This value is then sign-extended to u64 as 0xFFFFFFFF80000000, causing do_div() to compute the wrong result. The verifier's abstract interpretation (scalar32_min_max_sdiv) computes the mathematically correct result for range tracking, creating a verifier/interpreter mismatch that can be exploited for out-of-bounds map value access. Introduce abs_s32() which handles S32_MIN correctly by casting to u32 before negating, avoiding signed overflow entirely. Replace all 8 abs((s32)...) call sites in the interpreter's sdiv32/smod32 handlers. s32 is the only affected case -- the s64 division/modulo handlers do not use abs().
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 8
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.6
|
6.6.131
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.7
|
6.12.80
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.13
|
6.18.21
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.19
|
6.19.11
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.0:rc1:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.0:rc2:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.0:rc3:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.0:rc4:*:*:*:*:*:*
|
— | — |