linux-stable/drivers/md
Liequan Che fb5fee35bd bcache: revert replacing IS_ERR_OR_NULL with IS_ERR again
commit b2e382ae12 upstream.

Commit 028ddcac47 ("bcache: Remove unnecessary NULL point check in
node allocations") leads a NULL pointer deference in cache_set_flush().

1721         if (!IS_ERR_OR_NULL(c->root))
1722                 list_add(&c->root->list, &c->btree_cache);

>From the above code in cache_set_flush(), if previous registration code
fails before allocating c->root, it is possible c->root is NULL as what
it is initialized. __bch_btree_node_alloc() never returns NULL but
c->root is possible to be NULL at above line 1721.

This patch replaces IS_ERR() by IS_ERR_OR_NULL() to fix this.

Fixes: 028ddcac47 ("bcache: Remove unnecessary NULL point check in node allocations")
Signed-off-by: Liequan Che <cheliequan@inspur.com>
Cc: stable@vger.kernel.org
Cc: Zheng Wang <zyytlz.wz@163.com>
Reviewed-by: Mingzhe Zou <mingzhe.zou@easystack.cn>
Signed-off-by: Coly Li <colyli@suse.de>
Link: https://lore.kernel.org/r/20241202115638.28957-1-colyli@suse.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-12-14 19:51:33 +01:00
..
bcache bcache: revert replacing IS_ERR_OR_NULL with IS_ERR again 2024-12-14 19:51:33 +01:00
persistent-data dm persistent data: fix memory allocation failure 2024-09-04 13:23:16 +02:00
dm-bio-prison-v1.c
dm-bio-prison-v1.h
dm-bio-prison-v2.c
dm-bio-prison-v2.h
dm-bio-record.h
dm-bufio.c
dm-builtin.c
dm-cache-background-tracker.c
dm-cache-background-tracker.h
dm-cache-block-types.h
dm-cache-metadata.c
dm-cache-metadata.h
dm-cache-policy-internal.h
dm-cache-policy-smq.c
dm-cache-policy.c
dm-cache-policy.h
dm-cache-target.c dm cache: fix potential out-of-bounds access on the first resume 2024-11-14 13:13:39 +01:00
dm-clone-metadata.c bitmap: introduce generic optimized bitmap_size() 2024-09-04 13:23:16 +02:00
dm-clone-metadata.h
dm-clone-target.c
dm-core.h dm: limit the number of targets and parameter size area 2024-02-23 08:55:14 +01:00
dm-crypt.c dm-crypt, dm-verity: disable tasklets 2024-10-22 15:40:41 +02:00
dm-delay.c
dm-dust.c
dm-ebs-target.c
dm-era-target.c
dm-exception-store.c
dm-exception-store.h
dm-flakey.c
dm-ima.c
dm-ima.h
dm-init.c dm init: Handle minors larger than 255 2024-09-12 11:07:47 +02:00
dm-integrity.c dm integrity: fix out-of-range warning 2024-04-10 16:19:36 +02:00
dm-io-tracker.h
dm-io.c
dm-ioctl.c dm resume: don't return EINVAL when signalled 2024-09-04 13:23:16 +02:00
dm-kcopyd.c
dm-linear.c
dm-log-userspace-base.c
dm-log-userspace-transfer.c
dm-log-userspace-transfer.h
dm-log-writes.c
dm-log.c
dm-mpath.c
dm-mpath.h
dm-path-selector.c
dm-path-selector.h
dm-ps-historical-service-time.c
dm-ps-io-affinity.c
dm-ps-queue-length.c
dm-ps-round-robin.c
dm-ps-service-time.c
dm-raid1.c
dm-raid.c dm-raid: fix lockdep waring in "pers->hot_add_disk" 2024-04-10 16:18:39 +02:00
dm-region-hash.c
dm-rq.c Revert "dm: requeue IO if mapping table not yet available" 2024-10-17 15:11:06 +02:00
dm-rq.h
dm-snap-persistent.c
dm-snap-transient.c
dm-snap.c dm snapshot: fix lockup in dm_exception_table_exit 2024-04-10 16:18:44 +02:00
dm-stats.c
dm-stats.h
dm-stripe.c
dm-switch.c
dm-sysfs.c
dm-table.c dm: limit the number of targets and parameter size area 2024-02-23 08:55:14 +01:00
dm-target.c
dm-thin-metadata.c
dm-thin-metadata.h
dm-thin.c dm thin: Add missing destroy_work_on_stack() 2024-12-14 19:51:24 +01:00
dm-uevent.c
dm-uevent.h
dm-unstripe.c dm-unstriped: cast an operand to sector_t to prevent potential uint32_t overflow 2024-11-14 13:13:39 +01:00
dm-verity-fec.c
dm-verity-fec.h
dm-verity-target.c
dm-verity-verify-sig.c
dm-verity-verify-sig.h
dm-verity.h dm-verity, dm-crypt: align "struct bvec_iter" correctly 2024-03-26 18:21:13 -04:00
dm-writecache.c
dm-zero.c
dm-zone.c
dm-zoned-metadata.c
dm-zoned-reclaim.c
dm-zoned-target.c
dm-zoned.h
dm.c Revert "dm: requeue IO if mapping table not yet available" 2024-10-17 15:11:06 +02:00
dm.h
Kconfig
Makefile
md-autodetect.c
md-bitmap.c md: fix resync softlockup when bitmap size is less than array size 2024-06-16 13:39:17 +02:00
md-bitmap.h
md-cluster.c
md-cluster.h
md-faulty.c
md-linear.c
md-linear.h
md-multipath.c
md-multipath.h
md.c md: clean up invalid BUG_ON in md_ioctl 2024-09-04 13:23:25 +02:00
md.h
raid0.c
raid0.h
raid1-10.c
raid1.c
raid1.h
raid5-cache.c
raid5-log.h
raid5-ppl.c
raid5.c md/raid5: avoid BUG_ON() while continue reshape after reassembling 2024-08-19 05:45:36 +02:00
raid5.h
raid10.c md/raid10: improve code of mrdev in raid10_sync_request 2024-11-17 15:06:25 +01:00
raid10.h