В ядре Linux устранена следующая уязвимость:
Fuse-uring: завершить функциюuse_req при отмене работы задачи io-uring
Когда io_uring выполняет задачу с установленным tw.cancel (PF_EXITING,
Резервный вариант PF_KTHREAD или percpu_ref_is_dying в контексте кольца),
Fuse_uring_send_in_task() принимает ветвь отмены, присваивает
-ECANCELED, и он проваливается в функцию Fuse_uring_send(). Только этот путь
переворачивает запись в FRRS_USERSPACE и завершает команду io_uring;
он никогда не освобождает ссылку, владеющую записью кольца, на
Fuse_req, которому funse_uring_add_req_to_ring_ent() передал его
время отправки.
предохранитель_uring_send_in_task()
tw.cancel == правда
ошибка = -ОТМЕНЕНО
Fuse_uring_send (ent, cmd, err, Issue_flags)
ent->state = FRRS_USERSPACE
list_move(&ent->list, &queue->ent_in_userspace)
ent->cmd = NULL
io_uring_cmd_done (-ECANCELED)
/* ent->fuse_req все еще установлен, req все еще хеширован */
Fuse_req остается связанным при fpq->processing[hash] и
Fuse_request_end() никогда не вызывается. Исходный системный вызов
блоки потоков в D-состоянии в request_wait_answer() до тех пор, пока
фьюз_abort_conn() запускается, что может быть всем соединением
жизнь.
Для запросов FR_BACKGROUND fc->num_background никогда не используется.
также уменьшается, поэтому повторные отмены увеличивают счетчик до тех пор, пока
max_background поражен, и все последующие фоновые операции останавливаются. tw.cancel делает
не подразумевать прерывание соединения (например, выход одного рабочего потока io_uring
пока соединение с предохранителем остается включенным), поэтому это нельзя оставлять без внимания.
Fuse_abort_conn() для очистки. Завершение запроса, но по-прежнему маршрутизация записи через предохранитель_uring_send()
недостаточно: в ent_in_userspace остается запись без необходимости, и
ent_list_request_expired() безоговорочно разыменовывает ent->fuse_req
в начале этого списка, который затем будет разыменован по NULL. Исправьте ветку отмены, чтобы освободить запись напрямую.
Удалите его из
очередь, завершите cmd io_uring, завершите Fuse_req, освободите запись и
отбросьте его query_refs (пробуждая официанта демонтажа, если он был последним).
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: fuse-uring: end fuse_req on io-uring cancel task work When io_uring delivers task work with tw.cancel set (PF_EXITING, PF_KTHREAD fallback, or percpu_ref_is_dying on the ring context), fuse_uring_send_in_task() takes the cancel branch, assigns -ECANCELED, and falls through to fuse_uring_send(). That path only flips the entry to FRRS_USERSPACE and completes the io_uring cmd; it never discharges the ring entry's owning reference to the fuse_req that fuse_uring_add_req_to_ring_ent() handed it at dispatch time. fuse_uring_send_in_task() tw.cancel == true err = -ECANCELED fuse_uring_send(ent, cmd, err, issue_flags) ent->state = FRRS_USERSPACE list_move(&ent->list, &queue->ent_in_userspace) ent->cmd = NULL io_uring_cmd_done(-ECANCELED) /* ent->fuse_req still set, req still hashed */ The fuse_req stays linked on fpq->processing[hash] and fuse_request_end() is never invoked. The originating syscall thread blocks in D-state in request_wait_answer() until fuse_abort_conn() runs, which can be the entire connection lifetime. For FR_BACKGROUND requests fc->num_background is never decremented either, so repeated cancels inflate the counter until max_background is hit and all later background ops stall. tw.cancel does not imply a connection abort (e.g. a single io_uring worker thread exits while the fuse connection stays up), so this cannot be left for fuse_abort_conn() to clean up. Ending the req but still routing the entry through fuse_uring_send() is not enough: that leaves a req-less entry on ent_in_userspace, and ent_list_request_expired() dereferences ent->fuse_req unconditionally on the head of that list, which would then NULL-deref. Fix the cancel branch to release the entry directly. Remove it from the queue, complete the io_uring cmd, end the fuse_req, free the entry, and drop its queue_refs (waking the teardown waiter if it was the last).
Характеристики атаки
Последствия
Строка CVSS v3.1
Уязвимые продукты 2
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.14
|
6.18.39
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.19
|
7.1.4
|