Re: [PATCH] bcache: fix uninitialized closure object

Jens Axboe <[email protected]> Fri, 3 Apr 2026 05:11:04 -0600
Newsgroups org.kernel.vger.linux-bcache
Message-ID <[email protected]>
On 4/2/26 10:21 PM, [email protected] wrote:
> From: Mingzhe Zou <[email protected]>
> 
> In the previous patch ("bcache: fix cached_dev.sb_bio use-after-free and
> crash"), we adopted a simple modification suggestion from AI to fix the
> use-after-free.
> 
> But in actual testing, we found an extreme case where the device is
> stopped before calling bch_write_bdev_super().
> 
> At this point, struct closure sb_write has not been initialized yet.
> For this patch, we ensure that sb_bio has been completed via
> sb_write_mutex.

Presumably this should have a:

Fixes: fec114a98b87 ("bcache: fix cached_dev.sb_bio use-after-free and crash")

but for some reason it does not. I'll add it.

-- 
Jens Axboe