From: Ming Lei <ming.lei@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: yebin <yebin@huaweicloud.com>,
axboe@kernel.dk, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, Ye Bin <yebin10@huawei.com>,
Zhang Yi <yizhan@redhat.com>, "Ewan D. Milne" <emilne@redhat.com>,
linux-nvme@lists.infradead.org
Subject: Re: [PATCH] block: bio-integrity: fix potential null-ptr-deref in bio_integrity_free
Date: Fri, 7 Jun 2024 07:46:27 +0800 [thread overview]
Message-ID: <ZmJKU9mMDg1+mO3i@fedora> (raw)
In-Reply-To: <ZmHNQ56C6Ee01Kcv@infradead.org>
On Thu, Jun 06, 2024 at 07:52:51AM -0700, Christoph Hellwig wrote:
> On Thu, Jun 06, 2024 at 10:30:06PM +0800, Ming Lei wrote:
> > Yeah, that is one area queue freezing can't cover logical block size
> > change, but I'd suggest to put the logical bs check into submit_bio() or
> > slow path of __bio_queue_enter() at least.
>
> We really need an alignment check in submit_bio anyway, so doing it
> under the freeze protection would also help with this.
>
> > My concern is that nvme format is started without draining IO, and
> > IO can be submitted to hardware when nvme FW is handling formatting.
> > I am not sure if nvme FW can deal with this situation correctly.
> > Ewan suggested to run 'nvme format' with exclusive nvme disk open, which
> > needs nvme-cli change.
>
> .. and doesn't protect against someone using a different tool anyway.
>
> That beeing said, nvme_passthru_start actually freezes all queues
> based on the commands supported an affects log, and
> nvme_init_known_nvm_effects should force this even for controllers
> not supporting the log or reporting bogus information. So in general
> the queue should be frozen during the actual format.
That is something I missed, thanks for sharing the story.
Thanks,
Ming
next prev parent reply other threads:[~2024-06-06 23:46 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-06 6:26 [PATCH] block: bio-integrity: fix potential null-ptr-deref in bio_integrity_free Ye Bin
2024-06-06 6:44 ` Christoph Hellwig
2024-06-06 11:34 ` yebin
2024-06-06 14:30 ` Ming Lei
2024-06-06 14:52 ` Christoph Hellwig
2024-06-06 15:48 ` Keith Busch
2024-06-06 23:46 ` Ming Lei [this message]
2024-06-07 0:13 ` Ming Lei
2024-06-07 1:32 ` yebin
2024-06-07 1:35 ` Ming Lei
2024-06-11 2:48 ` yebin (H)
2024-06-11 3:29 ` Ming Lei
2024-06-17 3:49 ` yebin (H)
2024-06-18 1:43 ` Ming Lei
2024-06-11 9:15 ` Markus Elfring
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=ZmJKU9mMDg1+mO3i@fedora \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=emilne@redhat.com \
--cc=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=yebin10@huawei.com \
--cc=yebin@huaweicloud.com \
--cc=yizhan@redhat.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;
as well as URLs for NNTP newsgroup(s).