mirror-linux/drivers/md/bcache
Zheng Wang 7ecea5ce3d bcache: Fix __bch_btree_node_alloc to make the failure behavior consistent
commit 80fca8a10b upstream.

In some specific situations, the return value of __bch_btree_node_alloc
may be NULL. This may lead to a potential NULL pointer dereference in
caller function like a calling chain :
btree_split->bch_btree_node_alloc->__bch_btree_node_alloc.

Fix it by initializing the return value in __bch_btree_node_alloc.

Fixes: cafe563591 ("bcache: A block layer cache")
Cc: stable@vger.kernel.org
Signed-off-by: Zheng Wang <zyytlz.wz@163.com>
Signed-off-by: Coly Li <colyli@suse.de>
Link: https://lore.kernel.org/r/20230615121223.22502-6-colyli@suse.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-19 16:22:10 +02:00
..
Kconfig bcache: remove EXPERIMENTAL for Kconfig option 'Asynchronous device registration' 2022-08-02 17:22:41 -06:00
Makefile
alloc.c
bcache.h bcache:: fix repeated words in comments 2022-09-19 11:12:35 -06:00
bcache_ondisk.h bcache: Silence memcpy() run-time false positive warnings 2023-02-09 11:28:14 +01:00
bset.c bcache: bset: Fix comment typos 2022-09-19 11:12:35 -06:00
bset.h
btree.c bcache: Fix __bch_btree_node_alloc to make the failure behavior consistent 2023-07-19 16:22:10 +02:00
btree.h bcache: fixup btree_cache_wait list damage 2023-07-19 16:22:10 +02:00
closure.c
closure.h
debug.c
debug.h
extents.c
extents.h
features.c
features.h
io.c
journal.c bcache: Silence memcpy() run-time false positive warnings 2023-02-09 11:28:14 +01:00
journal.h
movinggc.c
request.c treewide: use prandom_u32_max() when possible, part 1 2022-10-11 17:42:55 -06:00
request.h
stats.c
stats.h bcache: remove unused bch_mark_cache_readahead function def in stats.h 2022-09-19 11:12:35 -06:00
super.c bcache: Remove unnecessary NULL point check in node allocations 2023-07-19 16:22:10 +02:00
sysfs.c
sysfs.h
trace.c
util.c
util.h
writeback.c bcache: fixup btree_cache_wait list damage 2023-07-19 16:22:10 +02:00
writeback.h