mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Cheng Yongkang <teel4res@gmail.com>
Cc: David Wei <davidhwei@meta.com>,
	io-uring@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] io_uring/timeout: don't rearm a multishot timeout on cancel
Date: Mon, 16 Nov 2026 19:41:14 -0700	[thread overview]
Message-ID: <71233dfb-bcac-42df-afd4-45b65dabbc09@kernel.dk> (raw)
In-Reply-To: <20261116044519.281756-1-teel4res@gmail.com>

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


  reply	other threads:[~2026-11-17  2:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  4:45 Cheng Yongkang
2026-11-17  2:41 ` Jens Axboe [this message]
2026-11-17  2:46   ` Cheng Yongkang
2026-11-17  2:48     ` Jens Axboe
2026-11-17  2:49 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=71233dfb-bcac-42df-afd4-45b65dabbc09@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=davidhwei@meta.com \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=teel4res@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®