From: Christoph Hellwig <hch@lst.de>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org,
Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH 1/3] block: fix NULL pointer dereference in blk_zone_reset_all_bio_endio()
Date: Thu, 13 Nov 2025 15:44:55 +0100 [thread overview]
Message-ID: <20251113144455.GA30779@lst.de> (raw)
In-Reply-To: <20251113134028.890166-2-dlemoal@kernel.org>
On Thu, Nov 13, 2025 at 10:40:26PM +0900, Damien Le Moal wrote:
> For zoned block devices that do not need zone write plugs (e.g. most
> device mapper devices that support zones), the disk hash table of zone
> write plugs is NULL. For such devices, blk_zone_reset_all_bio_endio()
> should not attempt to scan this has table as that causes a NULL pointer
> dereference.
>
> Fix this by checking that the disk does have zone write plugs using the
> atomic counter. This is equivalent to checking for a non-NULL hash table
> but has the advantage to also speed up the execution of
> blk_zone_reset_all_bio_endio() for devices that do use zone write plugs
> but do not have any plug in the hash table (e.g. a disk with only full
> zones).
>
> Fixes: efae226c2ef1 ("block: handle zone management operations completions")
> Reported-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
although maybe factoring that loop into helper might be a tad cleaner?
next prev parent reply other threads:[~2025-11-13 14:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-13 13:40 [PATCH 0/3] Fixes for zoned changes in block/for-next Damien Le Moal
2025-11-13 13:40 ` [PATCH 1/3] block: fix NULL pointer dereference in blk_zone_reset_all_bio_endio() Damien Le Moal
2025-11-13 14:44 ` Christoph Hellwig [this message]
2025-11-13 13:40 ` [PATCH 2/3] block: fix NULL pointer dereference in disk_report_zones() Damien Le Moal
2025-11-13 14:45 ` Christoph Hellwig
2025-11-13 13:40 ` [PATCH 3/3] dm: fix zone reset all operation processing Damien Le Moal
2025-11-13 14:46 ` Christoph Hellwig
2025-11-13 16:16 ` [PATCH 0/3] Fixes for zoned changes in block/for-next 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=20251113144455.GA30779@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=dlemoal@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=shinichiro.kawasaki@wdc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.