В ядре Linux была устранена следующая уязвимость: io_uring: откладывать чужеродные io-wq enqueues до task_work An IOPOLL ring без DEFER_TASKRUN можно пожинать с помощью задачи, отличной от той, которая представила I/O. Если опрошенный запрос имеет маркировку REQ_F_REISSUE, io_free_batch_list() вызывает io_queue_iowq() с исходным tctx. Обычный выход из задачи может уничтожить tctx->io_wq после удаления только отслеживаемых запросов.
Запрос в реальном времени фиксирует задачу, но не ее io-wq, поэтому иностранная задача может участвовать в гонке io_wq_put_and_exit () и ставиться в очередь через свободную очередь или очередь NULL. Перед доступом к tctx->io_wq перенаправляет чужое пользовательское пространство в очередь к владельцу задачи. Используйте выделенный обратный звонок task_work, чтобы перевыпуски по-прежнему отправлялись прямо в io-wq, и проваливайте их, если task_work работает в режиме отмены.
Сохранить существующий путь отмены PF_KTHREAD. Это также распространяется на другие абоненты io_queue_iowq (), не меняя путь очереди, принадлежащий работнику.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: io_uring: defer foreign io-wq enqueues to task_work An IOPOLL ring without DEFER_TASKRUN can be reaped by a task other than the one that submitted the I/O. If a polled request is marked REQ_F_REISSUE, io_free_batch_list() calls io_queue_iowq() with the original tctx. Ordinary task exit can tear down tctx->io_wq after draining only the tracked requests. The live request pins the task, but not its io-wq, so the foreign task can race io_wq_put_and_exit() and enqueue through a freed or NULL queue. Forward foreign userspace enqueues to the owning task before accessing tctx->io_wq. Use a dedicated task_work callback so reissues still go straight to io-wq, and fail them if task_work is running in cancellation mode. Preserve the existing PF_KTHREAD cancellation path. This also covers the other callers of io_queue_iowq() without changing the worker-owned enqueue path.
Характеристики атаки
Последствия
Строка CVSS v3.1