В ядре Linux устранена следующая уязвимость:
netfilter: nft_set_pipapo_avx2: не возвращать несовпадающую запись по истечении срока действия
Новый тестовый пример неожиданно завершается сбоем при использовании функций сопоставления avx2. Сначала тест загружает случайно сгенерированный набор pipapo.
с «ipv4. ключ порта, то есть nft -f foo. Это работает.
Затем он перезагружает набор после сброса: (echo flash set t s; cat foo) | нфт -ф - Ожидается, что это сработает, потому что в конце концов это тот же набор, и он был уже загружался один раз. Но с avx2 это не получается: nft сообщает о конфликтующем элементе. Сообщается о столкновении следующей формы: Мы успешно повторно вставили а. б в. д Затем мы пытаемся вставить файл . д avx2 находит уже существующий файл . d, который (из-за «установки заподлицо») отмечен как недействительный в новом поколении.
Он пропускает элемент и переходит к следующему. Из-за неправильной маскировки шаг пропуска находит следующее совпадение.
элемент *учитывая только первое поле*,
то есть мы возвращаем уже повторно вставленный "a. b", даже несмотря на то, что
последнее поле отличается, и запись не должна совпадать. О такой ошибке не сообщается для общей реализации c (без avx2) или когда
последнее поле должно использовать резервный вариант nft_pipapo_avx2_lookup_slow.
Бисекция указывает на
7711f4bb4b36 («сетевой фильтр: nft_set_pipapo: исправлено обнаружение перекрытия диапазонов»)
но это исправление просто раскрывает эту ошибку. Перед этим коммитом возвращается не тот элемент, но ошибочно
сообщается как полный идентичный дубликат. Основная причина — слишком ранний возврат функций сопоставления avx2.
Когда мы обработаем последнее поле, нам следует продолжить обработку данных до тех пор, пока весь входной размер не будет использован, чтобы убедиться в отсутствии устаревших биты остаются в карте.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: netfilter: nft_set_pipapo_avx2: don't return non-matching entry on expiry New test case fails unexpectedly when avx2 matching functions are used. The test first loads a ranomly generated pipapo set with 'ipv4 . port' key, i.e. nft -f foo. This works. Then, it reloads the set after a flush: (echo flush set t s; cat foo) | nft -f - This is expected to work, because its the same set after all and it was already loaded once. But with avx2, this fails: nft reports a clashing element. The reported clash is of following form: We successfully re-inserted a . b c . d Then we try to insert a . d avx2 finds the already existing a . d, which (due to 'flush set') is marked as invalid in the new generation. It skips the element and moves to next. Due to incorrect masking, the skip-step finds the next matching element *only considering the first field*, i.e. we return the already reinserted "a . b", even though the last field is different and the entry should not have been matched. No such error is reported for the generic c implementation (no avx2) or when the last field has to use the 'nft_pipapo_avx2_lookup_slow' fallback. Bisection points to 7711f4bb4b36 ("netfilter: nft_set_pipapo: fix range overlap detection") but that fix merely uncovers this bug. Before this commit, the wrong element is returned, but erronously reported as a full, identical duplicate. The root-cause is too early return in the avx2 match functions. When we process the last field, we should continue to process data until the entire input size has been consumed to make sure no stale bits remain in the map.
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 9
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.7
|
6.6.136
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.7
|
6.12.83
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.13
|
6.18.24
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.19
|
6.19.14
|
|
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:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.0:rc5:*:*:*:*:*:*
|
— | — |