summaryrefslogtreecommitdiff
path: root/drivers/md/dm-vdo
diff options
context:
space:
mode:
authorMatthew Sakai <msakai@redhat.com>2024-03-01 00:54:43 +0300
committerMike Snitzer <snitzer@kernel.org>2024-03-04 23:07:57 +0300
commit41c58a36e2c0496abebb1cb3100b38e32f49f80f (patch)
tree4e62caf68458f3c5a41de3608a36c38c09e61273 /drivers/md/dm-vdo
parent7979d907574a7013a1a35f47e798b1b671c334f1 (diff)
downloadlinux-41c58a36e2c0496abebb1cb3100b38e32f49f80f.tar.xz
dm vdo indexer: fix use after free
Fixes: b46d79bdb82a ("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>
Diffstat (limited to 'drivers/md/dm-vdo')
-rw-r--r--drivers/md/dm-vdo/indexer/index-layout.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/dm-vdo/indexer/index-layout.c b/drivers/md/dm-vdo/indexer/index-layout.c
index 349b3022f1e1..74fd44c20e5c 100644
--- a/drivers/md/dm-vdo/indexer/index-layout.c
+++ b/drivers/md/dm-vdo/indexer/index-layout.c
@@ -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);