In the Linux kernel, the following vulnerability has been resolved: fuse: Fix the condition to enable over-io-uring The existing condition in fuse_uring_cmd() is there only to avoid disabling io-uring for connections that already run with it, missing was a condition to refuse any IORING_OP_URING_CMD if the connection/channel didn't get enabled because of missing FUSE_INIT reply flag FUSE_OVER_IO_URING. Без флага ответа барьер в fuse_uring_ready () не работает, и IO может уже продолжаться и вызывать тупиковые состояния (как минимум один между fch->bg_lock и queue->lock). Само изменение тривиально, но приносит изменение поведения, FUSE_OVER_IO_URING должен быть установлен в FUSE_INIT_REPLY на серверах предохранителей, чтобы принять любой IORING_OP_URING_CMD.
Libfuse делает это, и единственная реализация, которую я нашел (фрактальный предохранитель), также делает это. Патчи Qemu для fuse-io-uring еще не объединены, насколько я знаю. Перемещена проверка smp_load_acquire(&fch->initialized), так как реализация предохранителя-сервера может попытаться настроить io-uring до обработки FUSE_INIT и, возможно, получила -EOPNOTSUPP вместо -EAGAIN.
Также исправлен устаревший комментарий, который объясняет обработку флага FUSE_OVER_IO_URING в ранних версиях RFC. Если должен быть отчет из какой-либо библиотеки или приложения, нам, вероятно, нужно отменить это обязательство.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: fuse: Fix the condition to enable over-io-uring The existing condition in fuse_uring_cmd() is there only to avoid disabling io-uring for connections that already run with it, missing was a condition to refuse any IORING_OP_URING_CMD if the connection/channel didn't get enabled because of missing FUSE_INIT reply flag FUSE_OVER_IO_URING. Without the reply flag the barrier in fuse_uring_ready() doesn't work and IO could already be going on and cause deadlock states (at a minimum one between fch->bg_lock and queue->lock). The change itself is trivial, but brings behavior change, FUSE_OVER_IO_URING has to be set in the FUSE_INIT_REPLY by fuse servers to accept any IORING_OP_URING_CMD. Libfuse does that and the only non-libfuse implementation I found (fractal-fuse) also does it. Qemu patches for fuse-io-uring are not merged yet, as far as I know. Moved up is the smp_load_acquire(&fch->initialized) check, as a fuse-server implementation might try to setup io-uring before FUSE_INIT is processed and might have gotten -EOPNOTSUPP instead of -EAGAIN. Also fixed is a stale comment that explains the handling of the FUSE_OVER_IO_URING flag in early RFC versions. If there should be a report from any library or application we probably need to revert this commit.