public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: "Clément Léger" <cleger@meta.com>
To: Jens Axboe <axboe@kernel.dk>, io-uring@vger.kernel.org
Cc: syzbot+79a4cc863a8db58cd92b@syzkaller.appspotmail.com
Subject: Re: [PATCH 2/2] io_uring/tctx: mark io_wq as exiting before error path teardown
Date: Mon, 20 Apr 2026 10:44:49 +0200	[thread overview]
Message-ID: <f43be53b-fb89-4dbf-b20e-d64044fd47d0@meta.com> (raw)
In-Reply-To: <20260416200622.831635-3-axboe@kernel.dk>

On 4/16/26 22:05, Jens Axboe wrote:
> > 
> syzbot reports that it's hitting the below condition for exiting an
> io_wq context:
> 
> WARN_ON_ONCE(!test_bit(IO_WQ_BIT_EXIT, &wq->state))
> 
> in io_wq_put_and_exit(), which can be triggered with memory allocation
> fault injection. Ensure that the io_wq is marked as exiting to silence
> this warning trigger.
> 
> Reported-by: syzbot+79a4cc863a8db58cd92b@syzkaller.appspotmail.com
> Fixes: 7880174e1e5e ("io_uring/tctx: clean up __io_uring_add_tctx_node() error handling")
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> ---
>   io_uring/tctx.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/io_uring/tctx.c b/io_uring/tctx.c
> index c011a593c0ad..80366320276d 100644
> --- a/io_uring/tctx.c
> +++ b/io_uring/tctx.c
> @@ -171,8 +171,10 @@ int __io_uring_add_tctx_node(struct io_ring_ctx *ctx)
>   	}
>   	if (!current->io_uring) {
>   err_free:
> -		if (tctx->io_wq)
> +		if (tctx->io_wq) {
> +			io_wq_exit_start(tctx->io_wq);
>   			io_wq_put_and_exit(tctx->io_wq);
> +		}
>   		percpu_counter_destroy(&tctx->inflight);
>   		kfree(tctx);
>   	}

Hi Jens,

LGTM as well,

Reviewed-by: Clément Léger <cleger@meta.com>

Thanks,

Clément


      reply	other threads:[~2026-04-20  8:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-16 20:05 [PATCH 0/2] Misc minor tctx fixes Jens Axboe
2026-04-16 20:05 ` [PATCH 1/2] io_uring/tctx: check for setup tctx->io_wq before teardown Jens Axboe
2026-04-20  8:42   ` Clément Léger
2026-04-16 20:05 ` [PATCH 2/2] io_uring/tctx: mark io_wq as exiting before error path teardown Jens Axboe
2026-04-20  8:44   ` Clément Léger [this message]

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=f43be53b-fb89-4dbf-b20e-d64044fd47d0@meta.com \
    --to=cleger@meta.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=syzbot+79a4cc863a8db58cd92b@syzkaller.appspotmail.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