diff options
| author | Matthew Sakai <msakai@redhat.com> | 2026-02-11 18:05:54 +0300 |
|---|---|---|
| committer | Mikulas Patocka <mpatocka@redhat.com> | 2026-03-02 18:37:43 +0300 |
| commit | 9e809bb1defe9be7fed2e21552c6b03b2694394d (patch) | |
| tree | 2b3492bf235eae374cef3587334f2625ca87ba11 | |
| parent | 11439c4635edd669ae435eec308f4ab8a0804808 (diff) | |
| download | linux-9e809bb1defe9be7fed2e21552c6b03b2694394d.tar.xz | |
dm vdo indexer: validate saved zone count
Verify that the loaded zone count is in the valid range
before using it as a loop iterator.
Signed-off-by: Matthew Sakai <msakai@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
| -rw-r--r-- | drivers/md/dm-vdo/indexer/index-layout.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/md/dm-vdo/indexer/index-layout.c b/drivers/md/dm-vdo/indexer/index-layout.c index 61edf2b72427..37144249f7ba 100644 --- a/drivers/md/dm-vdo/indexer/index-layout.c +++ b/drivers/md/dm-vdo/indexer/index-layout.c @@ -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) { |
