Re: [PATCH] io_uring/timeout: don't rearm a multishot timeout on cancel
From: Jens Axboe
Date: Mon Nov 16 2026 - 21:41:27 EST
On 11/15/26 9:45 PM, Cheng Yongkang wrote:
> io_timeout_complete() does not check tw.cancel. When it runs from
> io_cancel_local_task_work(), a multishot timeout that has not reached
> its count still posts an IORING_CQE_F_MORE completion and rearms its
> timer. With a zero interval the timer expires again right away and
> queues new task work, so the drain keeps running it until posting a
> CQE fails.
>
> Normally the CQ fills up quickly and the request then completes. But
> if userspace moves the CQ head far ahead of the tail, for example to
> cq.tail + 0x7fffffff, posting keeps succeeding and ring teardown is
> delayed for a long time.
But why would the app do that, to shoot itself in the foot?
I think the fix is fine, but the premise of it is very odd.
--
Jens Axboe