В ядре Linux устранена следующая уязвимость:
tracing/user_events: очистить скопированное состояние трассировки перед дублированием вилки.
dup_task_struct() копирует user_event_mm из родительского элемента в дочерний,
не получая ссылку на него. user_event_mm_dup() должен
замените его, но скопированный указатель останется неизмененным, если
user_event_mm_alloc() завершается с ошибкой. Когда дочерний элемент завершает работу, user_event_mm_remove() уменьшает ссылку.
дочерний элемент никогда не принадлежал, что в конечном итоге освобождает user_event_mm, в то время как
родитель все еще является устаревшим указателем на него. Это создает UAF, который
Об этом сообщает КАСАН:
ОШИБКА: KASAN: использование плиты после освобождения
current_user_event_mm+0x51/0x1d0 Запись размера 4 по адресу
ffff888005010d30 по задаче init/44
Отслеживание вызова:
<ЗАДАЧА>
kasan_report+0xce/0x100
kasan_check_range+0x10f/0x1e0
current_user_event_mm+0x51/0x1d0
user_events_ioctl+0x82e/0x15c0
__x64_sys_ioctl+0x139/0x1c0
do_syscall_64+0xce/0x450
запись_SYSCALL_64_after_hwframe+0x77/0x7f
Выделено заданием 44:
__kasan_kmalloc+0x8f/0xa0
__kmalloc_cache_noprof+0x180/0x3a0
user_event_mm_alloc+0x3c/0x1f0
current_user_event_mm+0x88/0x1d0
Освобожден заданием 42:
__kasan_slab_free+0x43/0x70
kfree+0x13a/0x390
процесс_one_work+0x696/0xf90
рабочий_поток+0x420/0xba0
Исправление просто очищает скопированный указатель перед возможным сбоем.
В случае неудачи ребенку нечего освобождать.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: tracing/user_events: Clear copied tracing state before fork duplication dup_task_struct() copies user_event_mm from the parent into the child, without grabbing a reference to it. user_event_mm_dup() should replace it, but it leaves that copied pointer unmodified if user_event_mm_alloc() fails. When the child exits, user_event_mm_remove() decrements a reference the child never owned, which ultimately frees user_event_mm, while the parent still as a stale pointer to it. This creates a UAF, which KASAN reports as: BUG: KASAN: slab-use-after-free in current_user_event_mm+0x51/0x1d0 Write of size 4 at addr ffff888005010d30 by task init/44 Call Trace: <TASK> kasan_report+0xce/0x100 kasan_check_range+0x10f/0x1e0 current_user_event_mm+0x51/0x1d0 user_events_ioctl+0x82e/0x15c0 __x64_sys_ioctl+0x139/0x1c0 do_syscall_64+0xce/0x450 entry_SYSCALL_64_after_hwframe+0x77/0x7f Allocated by task 44: __kasan_kmalloc+0x8f/0xa0 __kmalloc_cache_noprof+0x180/0x3a0 user_event_mm_alloc+0x3c/0x1f0 current_user_event_mm+0x88/0x1d0 Freed by task 42: __kasan_slab_free+0x43/0x70 kfree+0x13a/0x390 process_one_work+0x696/0xf90 worker_thread+0x420/0xba0 The fix simply clears the copied pointer before any possible failure. In case of failure, the child then has nothing to free.
Характеристики атаки
Последствия
Строка CVSS v3.1
Уязвимые продукты 4
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.4
|
6.12.109
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.4
|
6.18.50
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.4
|
7.2.4
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.4
|
7.3-rc1
|