summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sakai <msakai@redhat.com>2026-02-11 18:05:55 +0300
committerMikulas Patocka <mpatocka@redhat.com>2026-03-02 18:37:59 +0300
commitb3929b2cc2a6003b8e301e6540c651e60d24dcb4 (patch)
treef0010410843a48a39271986f4372f2bd10d4e950
parent9e809bb1defe9be7fed2e21552c6b03b2694394d (diff)
downloadlinux-b3929b2cc2a6003b8e301e6540c651e60d24dcb4.tar.xz
dm vdo slab-depot: validate old zone count on load
Verify the old zone count has a valid value before using it to compute slab summary entry offsets. Signed-off-by: Matthew Sakai <msakai@redhat.com> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
-rw-r--r--drivers/md/dm-vdo/slab-depot.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/dm-vdo/slab-depot.c b/drivers/md/dm-vdo/slab-depot.c
index 034ecaa51f48..ad00afc2c168 100644
--- a/drivers/md/dm-vdo/slab-depot.c
+++ b/drivers/md/dm-vdo/slab-depot.c
@@ -4262,6 +4262,10 @@ int vdo_decode_slab_depot(struct slab_depot_state_2_0 state, struct vdo *vdo,
}
slab_size_shift = ilog2(slab_size);
+ if (state.zone_count > MAX_VDO_PHYSICAL_ZONES)
+ return vdo_log_error_strerror(UDS_CORRUPT_DATA,
+ "invalid zone count");
+
result = vdo_allocate_extended(struct slab_depot,
vdo->thread_config.physical_zone_count,
struct block_allocator, __func__, &depot);