В ядре Linux была устранена следующая уязвимость: dm-pcache: проверка seg_id полей из постоянной памяти cache_pos_decode(), cache_key_decode() и ветвей последнего набора cache_replay(), работник записи и работник GC берут идентификатор сегмента кэша из метаданных кэш-устройства и индекса cache->segments[], не проверяя его против cache->n_segs. Эти метаданные защищены только CRC-защитой с фиксированным общедоступным семенем, поэтому тот, кто поставляет кэш-устройство на загрузку таблицы (CAP_SYS_ADMIN), контролирует идентификатор; значение out-of-range образует дикий указатель pcache_cache_segment, который удаляется и записывается - out-of-bounds читает и записывает, управляемый данными на диске. Добавьте cache_seg_id_valid() и откажитесь от идентификатора out-of-range на каждом сайте декодирования, провалив операцию с -EIO вместо индексации перед массивом.
Связать идентификатор с количеством инициализированных сегментов (cache_info.n_segs), а не с общим количеством физических устройств. Поддельный cache_info.n_segs ниже seg_num в противном случае оставляет segments[cache_info.n_segs..seg_num) в качестве нулевых структур, указатель данных которых NULL, поэтому поддельный идентификатор в этом окне все равно будет удален. Более поздний патч гарантирует cache_info.n_segs seg_num, а созданный драйвером кэш устанавливает два равных, поэтому действительные изображения не затрагиваются.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: dm-pcache: validate seg_id fields from persistent memory cache_pos_decode(), cache_key_decode() and the last-kset branches of cache_replay(), the writeback worker and the GC worker take a cache segment id from the cache device metadata and index cache->segments[] with it without checking it against cache->n_segs. That metadata is only CRC-protected with a fixed public seed, so whoever supplies the cache device on a table load (CAP_SYS_ADMIN) controls the id; an out-of-range value forms a wild pcache_cache_segment pointer that is dereferenced and written through -- an out-of-bounds read and write driven by on-disk data. Add cache_seg_id_valid() and reject an out-of-range id at each decode site, failing the operation with -EIO instead of indexing past the array. Bound the id against the initialized-segment count (cache_info.n_segs) rather than the physical device total. A forged cache_info.n_segs below seg_num otherwise leaves segments[cache_info.n_segs..seg_num) as zeroed structs whose data pointer is NULL, so a forged id in that window would still be dereferenced. A later patch guarantees cache_info.n_segs <= seg_num, and a driver-created cache sets the two equal, so valid images are unaffected.
Характеристики атаки
Последствия
Строка CVSS v3.1
Уязвимые продукты 2
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.18
|
7.2.6
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.18
|
7.3-rc1
|