From: Ming Lei <ming.lei@redhat.com>
To: yebin <yebin@huaweicloud.com>
Cc: Christoph Hellwig <hch@infradead.org>,
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: Thu, 6 Jun 2024 22:30:06 +0800 [thread overview]
Message-ID: <ZmHH7mW0M80RaPlj@fedora> (raw)
In-Reply-To: <66619EB6.4040002@huaweicloud.com>
On Thu, Jun 06, 2024 at 07:34:14PM +0800, yebin wrote:
>
>
> On 2024/6/6 14:44, Christoph Hellwig wrote:
> > What kernel is this on? As of Linux 6.9 we are now always freezing
> v4.18
> > the queue while updating the logical_block_size in the nvme driver,
> > so there should be no inflight I/O while it is changing.
> >
> The root cause of the problem is that there is no concurrency protection
> between
> issuing DIO checks in __ blkdev direct IO simple() and updating logical
> block sizes ,
> resulting in the block layer being able to see DIOs that are not aligned
> with logical
> blocks.
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.
BTW, Yi has one reproducer, and slab is corrupted just like this report
when running 'nvme format' & IO on partitions.
I am not sure if this kind of change can avoid the issue completely, anyway
Yi and I can test it and see if the kind of change works.
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.
Thanks,
Ming
next prev parent reply other threads:[~2024-06-06 14:30 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 [this message]
2024-06-06 14:52 ` Christoph Hellwig
2024-06-06 15:48 ` Keith Busch
2024-06-06 23:46 ` Ming Lei
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=ZmHH7mW0M80RaPlj@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).