dm vdo indexer: fix use after free

Fixes: b46d79bdb8 ("dm vdo: add deduplication index storage interface")
Reported-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
This commit is contained in:
Matthew Sakai 2024-02-29 16:54:43 -05:00 committed by Mike Snitzer
parent 7979d90757
commit 41c58a36e2

View file

@ -1561,10 +1561,11 @@ static int __must_check load_index_save(struct index_save_layout *isl,
if (table->header.type != RH_TYPE_SAVE) {
uds_log_error_strerror(UDS_CORRUPT_DATA,
"unexpected index save %u header type %u",
instance, table->header.type);
vdo_free(table);
return uds_log_error_strerror(UDS_CORRUPT_DATA,
"unexpected index save %u header type %u",
instance, table->header.type);
return UDS_CORRUPT_DATA;
}
result = read_index_save_data(reader, isl, table->header.payload);