В ядре Linux устранена следующая уязвимость:
soc: aspeed: lpc-snoop: исправлено переполнение пользовательской копии в snoop_file_read.
put_fifo_with_discard() действует как производитель и потребитель kfifo:
он вызывает kfifo_skip() (выходит) и kfifo_put() (входит) из
обработчик IRQ без синхронизации с snoop_file_read(), что также
потребляет через kfifo_to_user(). В системах SMP этот одновременный доступ может
оставьте (вход-выход) больше, чем кольцевой буфер, поэтому зажим __kfifo_to_user()
to (вход-выход) неэффективно, и kfifo_copy_to_user() может попытаться
copy_to_user() за резервным хранилищем kmalloc-2k:
usercopy: обнаружена попытка раскрытия памяти ядра со стороны объекта SLUB.
'kmalloc-2k' (смещение 0, размер 2049)!
ОШИБКА ядра в mm/usercopy.c!
Трассировка звонков:
usercopy_abort
__check_heap_object
__check_object_size
kfifo_copy_to_user
__kfifo_to_user
snoop_file_read
vfs_read
Сериализуйте доступ к kfifo с помощью поканальной спин-блокировки, разделяемой между
Обработчик IRQ (производитель) и программа чтения файлов (потребитель). Комментировать @fifo
с помощью __guarded_by(&lock) и включите контекстный анализ драйвера, чтобы
компилятор обеспечивает, чтобы весь доступ к Fifo удерживал блокировку.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: soc: aspeed: lpc-snoop: Fix usercopy overflow in snoop_file_read put_fifo_with_discard() acts as both producer and consumer on the kfifo: it calls kfifo_skip() (advances out) and kfifo_put() (advances in) from the IRQ handler without synchronizing with snoop_file_read(), which also consumes via kfifo_to_user(). On SMP systems this concurrent access can leave (in - out) larger than the ring buffer, so __kfifo_to_user()'s clamp to (in - out) is ineffective and kfifo_copy_to_user() can attempt a copy_to_user() past the kmalloc-2k backing store: usercopy: Kernel memory exposure attempt detected from SLUB object 'kmalloc-2k' (offset 0, size 2049)! kernel BUG at mm/usercopy.c! Call trace: usercopy_abort __check_heap_object __check_object_size kfifo_copy_to_user __kfifo_to_user snoop_file_read vfs_read Serialize kfifo access with a per-channel spinlock shared between the IRQ handler (producer) and the file reader (consumer). Annotate @fifo with __guarded_by(&lock) and opt the driver into context analysis so the compiler enforces that all fifo access holds the lock.
Уязвимые продукты 2
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
4.19
|
7.1.9
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
4.19
|
7.2
|