В ядре Linux устранена следующая уязвимость:
Вернуть «libfs: исправить бесконечное чтение каталогов для смещения каталога»
Распределитель смещения текущего каталога (на основе mtree_alloc_cycle).
сохраняет следующее значение смещения для возврата в Octx->next_offset. Это
механизм обычно возвращает значения, которые монотонно увеличиваются с течением времени.
время. Однако в конечном итоге вновь выделенное значение смещения переносится
вернуться к небольшому числу (скажем, 2), которое меньше, чем другие уже-
выделенные значения смещения.
Ю Куай <yukuai3@huawei.com> сообщает, что после фиксации 64a7ce76fb90
(«libfs: исправить бесконечное чтение каталогов для смещения каталога»), если
перенос распределителя смещения каталога, существующие записи больше не являются
виден через readdir/getdents, потому что offset_readdir() прекращает вывод списка
записи, если смещение записи больше, чем Octx->next_offset. Эти записи постоянно исчезают — их можно найти, но
никогда больше не появляться в выводе readdir(3). Причина этого в том, что коммит рассматривает смещения каталогов как
монотонно увеличивающиеся целочисленные значения, а не непрозрачные файлы cookie,
и вводит это сравнение:
if (dentry2offset(dentry) >= последний_индекс) {
На 64-битных платформах верхняя граница значения смещения каталога равна
2^63 - 1.
Смещения каталогов будут монотонно увеличиваться в течение миллионов
лет без упаковки. Однако на 32-битных платформах LONG_MAX равен 2^31 - 1. Распределитель
можно завернуть уже через несколько недель (в худшем случае).
Отменить фиксацию 64a7ce76fb90 («libfs: исправить бесконечное чтение каталогов для
offset dir"), чтобы подготовиться к исправлению, которое будет корректно работать на 32-битной версии.
системах и может применяться к последним ядрам LTS, где shmem использует
механизм simple_offset.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: Revert "libfs: fix infinite directory reads for offset dir" The current directory offset allocator (based on mtree_alloc_cyclic) stores the next offset value to return in octx->next_offset. This mechanism typically returns values that increase monotonically over time. Eventually, though, the newly allocated offset value wraps back to a low number (say, 2) which is smaller than other already- allocated offset values. Yu Kuai <yukuai3@huawei.com> reports that, after commit 64a7ce76fb90 ("libfs: fix infinite directory reads for offset dir"), if a directory's offset allocator wraps, existing entries are no longer visible via readdir/getdents because offset_readdir() stops listing entries once an entry's offset is larger than octx->next_offset. These entries vanish persistently -- they can be looked up, but will never again appear in readdir(3) output. The reason for this is that the commit treats directory offsets as monotonically increasing integer values rather than opaque cookies, and introduces this comparison: if (dentry2offset(dentry) >= last_index) { On 64-bit platforms, the directory offset value upper bound is 2^63 - 1. Directory offsets will monotonically increase for millions of years without wrapping. On 32-bit platforms, however, LONG_MAX is 2^31 - 1. The allocator can wrap after only a few weeks (at worst). Revert commit 64a7ce76fb90 ("libfs: fix infinite directory reads for offset dir") to prepare for a fix that can work properly on 32-bit systems and might apply to recent LTS kernels where shmem employs the simple_offset mechanism.
Характеристики атаки
Последствия
Строка CVSS v3.1
Уязвимые продукты 9
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.11
|
6.12.12
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.13:-:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.13:rc1:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.13:rc2:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.13:rc3:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.13:rc4:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.13:rc5:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.13:rc6:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.13:rc7:*:*:*:*:*:*
|
— | — |