Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions drivers/md/dm-vdo/indexer/index-layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -1445,6 +1445,9 @@ static int __must_check reconstruct_index_save(struct index_save_layout *isl,
u64 last_block = next_block + isl->index_save.block_count;

isl->zone_count = table->header.region_count - 3;
if (isl->zone_count > MAX_ZONES)
return vdo_log_error_strerror(UDS_CORRUPT_DATA,
"invalid zone count");

last_region = &table->regions[table->header.region_count - 1];
if (last_region->kind == RL_KIND_EMPTY) {
Expand Down
4 changes: 4 additions & 0 deletions drivers/md/dm-vdo/slab-depot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down