From: Ming Lei <tom.leiming@gmail.com>
To: Yang Xiuwei <yangxiuwei@kylinos.cn>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org,
Caleb Sander Mateos <csander@purestorage.com>
Subject: Re: [PATCH v2 1/2] ublk: validate auto buf reg before taking uring_cmd
Date: Fri, 31 Jul 2026 11:10:53 -0500 [thread overview]
Message-ID: <amzJDfYFOL44eMe3@fedora-laptop> (raw)
In-Reply-To: <20260730010910.799346-2-yangxiuwei@kylinos.cn>
On Thu, Jul 30, 2026 at 09:09:09AM +0800, Yang Xiuwei wrote:
> With UBLK_F_AUTO_BUF_REG, invalid sqe->addr can fail after
> ublk_fill_io_cmd() has set UBLK_IO_FLAG_ACTIVE. The uring_cmd is
> completed while the tag stays active, which can hang teardown.
>
> Split validation from buffer apply so the check has no side effects,
> then take the uring_cmd and store the already-validated buffer. Apply
> the same order in FETCH so io->buf is not written before __ublk_fetch()
> state checks.
>
> Fixes: 52460dda3a77 ("ublk: move auto buffer register handling into one dedicated helper")
> Suggested-by: Caleb Sander Mateos <csander@purestorage.com>
> Signed-off-by: Yang Xiuwei <yangxiuwei@kylinos.cn>
Nice catch!
Reviewed-by: Ming Lei <tom.leiming@gmail.com>
Thanks,
Ming
next prev parent reply other threads:[~2026-07-31 16:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-30 1:09 [PATCH v2 0/2] ublk: fix auto buf reg ordering around uring_cmd Yang Xiuwei
2026-07-30 1:09 ` [PATCH v2 1/2] ublk: validate auto buf reg before taking uring_cmd Yang Xiuwei
2026-07-31 16:10 ` Ming Lei [this message]
2026-07-30 1:09 ` [PATCH v2 2/2] ublk: clear auto buf reg before updating io->buf in batch commit Yang Xiuwei
2026-07-30 2:40 ` [PATCH] selftests: ublk: add rotating auto_buf index regression test Yang Xiuwei
2026-07-31 16:24 ` Ming Lei
2026-07-31 16:13 ` [PATCH v2 2/2] ublk: clear auto buf reg before updating io->buf in batch commit Ming Lei
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=amzJDfYFOL44eMe3@fedora-laptop \
--to=tom.leiming@gmail.com \
--cc=axboe@kernel.dk \
--cc=csander@purestorage.com \
--cc=linux-block@vger.kernel.org \
--cc=yangxiuwei@kylinos.cn \
/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