В ядре Linux устранена следующая уязвимость:
netfilter: nft_set_pipapo: исправить выход стека за пределы чтения в pipapo_drop()
pipapo_drop() передает rulemap[i + 1].n в pipapo_unmap() в качестве
аргумент to_offset на каждой итерации, включая последнюю, где
i == m->field_count - 1. При этом считывается один элемент после конца
массив карт правил, выделенный стеком (объявленный как карта правил[NFT_PIPAPO_MAX_FIELDS]
с NFT_PIPAPO_MAX_FIELDS == 16). Хотя pipapo_unmap() возвращает значение раньше, если is_last имеет значение true, без
используя значение to_offset, аргумент оценивается на месте вызова
до выполнения тела функции, что делает это настоящим выходом за пределы
Чтение стека подтверждено KASAN:
ОШИБКА: KASAN: стек выходит за границы в pipapo_drop+0x50c/0x57c [nf_tables]
Чтение размера 4 по адресу ffff8000810e71a4.
В этом фрейме есть 1 объект: [32, 160) «карта правил» Адрес ошибки находится по смещению 164 — ровно на 4 байта от конца. массива карт правил. Передайте 0 вместо rulemap[i + 1].n на последней итерации, чтобы избежать чтение за пределами поля.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: netfilter: nft_set_pipapo: fix stack out-of-bounds read in pipapo_drop() pipapo_drop() passes rulemap[i + 1].n to pipapo_unmap() as the to_offset argument on every iteration, including the last one where i == m->field_count - 1. This reads one element past the end of the stack-allocated rulemap array (declared as rulemap[NFT_PIPAPO_MAX_FIELDS] with NFT_PIPAPO_MAX_FIELDS == 16). Although pipapo_unmap() returns early when is_last is true without using the to_offset value, the argument is evaluated at the call site before the function body executes, making this a genuine out-of-bounds stack read confirmed by KASAN: BUG: KASAN: stack-out-of-bounds in pipapo_drop+0x50c/0x57c [nf_tables] Read of size 4 at addr ffff8000810e71a4 This frame has 1 object: [32, 160) 'rulemap' The buggy address is at offset 164 -- exactly 4 bytes past the end of the rulemap array. Pass 0 instead of rulemap[i + 1].n on the last iteration to avoid the out-of-bounds read.
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 10
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.6
|
5.10.253
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.11
|
5.15.203
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.16
|
6.1.167
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.2
|
6.6.130
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.7
|
6.12.78
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.13
|
6.18.19
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.19
|
6.19.9
|
|
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:*:*:*:*:*:*
|
— | — |