В ядре Linux устранена следующая уязвимость:
io_uring/msg_ring: убедитесь, что освобождение io_kiocb отложено для RCU.
syzbot сообщает, что отложенное/локальное добавление Task_work через msg_ring может поразить
запрос, который был освобожден:
ЦП: 1 UID: 0 PID: 19356 Связь: iou-wrk-19354 Не испорчено 6.16.0-rc4-syzkaller-00108-g17bbde2e1716 #0 PREEMPT(полный)
Название оборудования: Google Google Compute Engine/Google Compute Engine, BIOS Google 07.05.2025
Отслеживание вызова:
<ЗАДАЧА>
dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
print_address_description мм/kasan/report.c:408 [встроенный]
print_report+0xd2/0x2b0 мм/kasan/report.c:521
kasan_report+0x118/0x150 мм/kasan/report.c:634
io_req_local_work_add io_uring/io_uring.c:1184 [встроенный]
__io_req_task_work_add+0x589/0x950 io_uring/io_uring.c:1252
io_msg_remote_post io_uring/msg_ring.c:103 [встроенный]
io_msg_data_remote io_uring/msg_ring.c:133 [встроенный]
__io_msg_ring_data+0x820/0xaa0 io_uring/msg_ring.c:151
io_msg_ring_data io_uring/msg_ring.c:173 [встроенный]
io_msg_ring+0x134/0xa00 io_uring/msg_ring.c:314
__io_issue_sqe+0x17e/0x4b0 io_uring/io_uring.c:1739
io_issue_sqe+0x165/0xfd0 io_uring/io_uring.c:1762
io_wq_submit_work+0x6e9/0xb90 io_uring/io_uring.c:1874
io_worker_handle_work+0x7cd/0x1180 io_uring/io-wq.c:642
io_wq_worker+0x42f/0xeb0 io_uring/io-wq.c:696
ret_from_fork+0x3fc/0x770 Arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 Arch/x86/entry/entry_64.S:245
</TASK>
который должен быть безопасным при распределении запросов. Но сообщение
кольцевые запросы выделяют и освобождают самостоятельно и, следовательно, должны отложить освобождение
в разумное время. Добавьте rcu_head и используйте kfree_rcu() в обоих местах, где выполняются запросы.
освобожден.
Строго необходим только тот, который находится в io_msg_tw_complete(), поскольку он
был виден на другом кольце, но используйте его постоянно в другом
место тоже. По праву это не должно вызывать каких-либо других проблем за пределами KASAN.
жалуюсь на это.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: io_uring/msg_ring: ensure io_kiocb freeing is deferred for RCU syzbot reports that defer/local task_work adding via msg_ring can hit a request that has been freed: CPU: 1 UID: 0 PID: 19356 Comm: iou-wrk-19354 Not tainted 6.16.0-rc4-syzkaller-00108-g17bbde2e1716 #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: <TASK> dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xd2/0x2b0 mm/kasan/report.c:521 kasan_report+0x118/0x150 mm/kasan/report.c:634 io_req_local_work_add io_uring/io_uring.c:1184 [inline] __io_req_task_work_add+0x589/0x950 io_uring/io_uring.c:1252 io_msg_remote_post io_uring/msg_ring.c:103 [inline] io_msg_data_remote io_uring/msg_ring.c:133 [inline] __io_msg_ring_data+0x820/0xaa0 io_uring/msg_ring.c:151 io_msg_ring_data io_uring/msg_ring.c:173 [inline] io_msg_ring+0x134/0xa00 io_uring/msg_ring.c:314 __io_issue_sqe+0x17e/0x4b0 io_uring/io_uring.c:1739 io_issue_sqe+0x165/0xfd0 io_uring/io_uring.c:1762 io_wq_submit_work+0x6e9/0xb90 io_uring/io_uring.c:1874 io_worker_handle_work+0x7cd/0x1180 io_uring/io-wq.c:642 io_wq_worker+0x42f/0xeb0 io_uring/io-wq.c:696 ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 </TASK> which is supposed to be safe with how requests are allocated. But msg ring requests alloc and free on their own, and hence must defer freeing to a sane time. Add an rcu_head and use kfree_rcu() in both spots where requests are freed. Only the one in io_msg_tw_complete() is strictly required as it has been visible on the other ring, but use it consistently in the other spot as well. This should not cause any other issues outside of KASAN rightfully complaining about it.
Характеристики атаки
Последствия
Строка CVSS v3.1
Уязвимые продукты 7
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.11
|
6.12.46
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.13
|
6.15.7
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.16:rc1:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.16:rc2:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.16:rc3:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.16:rc4:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.16:rc5:*:*:*:*:*:*
|
— | — |