From 41c58a36e2c0496abebb1cb3100b38e32f49f80f Mon Sep 17 00:00:00 2001 From: Matthew Sakai Date: Thu, 29 Feb 2024 16:54:43 -0500 Subject: dm vdo indexer: fix use after free Fixes: b46d79bdb82a ("dm vdo: add deduplication index storage interface") Reported-by: Harshit Mogalapalli Signed-off-by: Matthew Sakai Signed-off-by: Mike Snitzer --- drivers/md/dm-vdo/indexer/index-layout.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/md/dm-vdo') 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); -- cgit v1.2.3