linux/drivers/md/bcache
Mingzhe Zou 20a8e451ec bcache: fix uninitialized closure object
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.

Signed-off-by: Mingzhe Zou <mingzhe.zou@easystack.cn>
Signed-off-by: Coly Li <colyli@fnnas.com>
Link: https://patch.msgid.link/20260403042135.2221247-1-colyli@fnnas.com
Fixes: fec114a98b ("bcache: fix cached_dev.sb_bio use-after-free and crash")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2026-04-03 05:11:08 -06:00
..
alloc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
bcache_ondisk.h flexible-array transformations for 6.3-rc1 2023-02-25 12:53:42 -08:00
bcache.h bcache: use bio cloning for detached device requests 2026-01-22 07:24:50 -07:00
bset.c Revert "bcache: remove heap-related macros and switch to generic min_heap" 2025-06-19 20:48:03 -07:00
bset.h bcache: Avoid -Wflex-array-member-not-at-end warning 2025-11-13 09:18:06 -07:00
btree.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
btree.h Locking changes for v6.5: 2023-06-27 14:14:30 -07:00
debug.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
debug.h
extents.c Revert "bcache: remove heap-related macros and switch to generic min_heap" 2025-06-19 20:48:03 -07:00
extents.h
features.c
features.h
io.c block: add a bio_init_inline helper 2025-09-09 07:31:59 -06:00
journal.c bcache: get rid of discard code from journal 2025-11-13 09:18:06 -07:00
journal.h bcache: get rid of discard code from journal 2025-11-13 09:18:06 -07:00
Kconfig bcache: remove unnecessary select MIN_HEAP 2025-06-19 20:48:03 -07:00
Makefile bcache: move closures to lib/ 2023-10-19 14:47:33 -04:00
movinggc.c block: remove the bi_inline_vecs variable sized array from struct bio 2025-09-09 07:31:59 -06:00
request.c bcache: fix I/O accounting leak in detached_dev_do_request 2026-01-28 19:06:55 -07:00
request.h closures: CLOSURE_CALLBACK() to fix type punning 2023-11-24 00:29:58 -05:00
stats.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
stats.h bcache: Remove dead references to cache_readaheads 2023-06-15 07:30:11 -06:00
super.c bcache: fix uninitialized closure object 2026-04-03 05:11:08 -06:00
sysfs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
sysfs.h bcache: make kobj_type structures constant 2023-06-15 07:30:11 -06:00
trace.c
util.c bcache: fix typo 2024-06-24 22:24:56 -07:00
util.h Revert "bcache: remove heap-related macros and switch to generic min_heap" 2025-06-19 20:48:03 -07:00
writeback.c bcache: WQ_PERCPU added to alloc_workqueue users 2025-11-13 09:18:06 -07:00
writeback.h