From: Damien Le Moal <dlemoal@kernel.org>
To: Bilal Hashim <AeeSec@126.com>, Christoph Hellwig <hch@lst.de>,
Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] zloop: log new device before marking it live
Date: Wed, 2 Dec 2026 14:50:31 +0900 [thread overview]
Message-ID: <0d74aa02-9f93-43b7-bad3-fef36bccb10d@kernel.org> (raw)
In-Reply-To: <179615132148.19728.4925137631421296369@126.com>
On 12/2/26 03:55, Bilal Hashim wrote:
> In zloop_ctl_add(), zlo->state is transitioned to Zlo_live and
> zloop_ctl_mutex is unlocked before logging zlo fields with pr_info().
>
> Once zlo->state becomes Zlo_live, a concurrent zloop_ctl_remove() can
> remove the device and free zlo via put_disk() -> zloop_free_disk() before
> pr_info() reads zlo->id, zlo->nr_zones, zlo->zone_size, zlo->block_size,
> zlo->ordered_zone_append, and zlo->zone_append, resulting in a
> slab-use-after-free read.
>
> Move the two pr_info() calls before transitioning zlo->state to Zlo_live.
>
> Fixes: eb0570c7df23 ("block: new zoned loop block device driver")
> Signed-off-by: Bilal Hashim <AeeSec@126.com>
Looks good.
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2026-12-02 5:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 18:55 Bilal Hashim
2026-12-02 5:50 ` Damien Le Moal [this message]
2026-12-02 6:30 ` Christoph Hellwig
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=0d74aa02-9f93-43b7-bad3-fef36bccb10d@kernel.org \
--to=dlemoal@kernel.org \
--cc=AeeSec@126.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®