Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dm vdo: return error on corrupted metadata in start_restoring_volume functions

The return values of VDO_ASSERT calls that validate metadata are not acted
upon.

Return UDS_CORRUPT_DATA in case of an error.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: a4eb7e255517 ("dm vdo: implement the volume index")
Signed-off-by: Ivan Abramov <i.abramov@mt-integration.ru>
Reviewed-by: Matthew Sakai <msakai@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

authored by

Ivan Abramov and committed by
Mikulas Patocka
9ddf6d3f e828a187

+2 -2
+2 -2
drivers/md/dm-vdo/indexer/volume-index.c
··· 836 836 "%zu bytes decoded of %zu expected", offset, 837 837 sizeof(buffer)); 838 838 if (result != VDO_SUCCESS) 839 - result = UDS_CORRUPT_DATA; 839 + return UDS_CORRUPT_DATA; 840 840 841 841 if (memcmp(header.magic, MAGIC_START_5, MAGIC_SIZE) != 0) { 842 842 return vdo_log_warning_strerror(UDS_CORRUPT_DATA, ··· 928 928 "%zu bytes decoded of %zu expected", offset, 929 929 sizeof(buffer)); 930 930 if (result != VDO_SUCCESS) 931 - result = UDS_CORRUPT_DATA; 931 + return UDS_CORRUPT_DATA; 932 932 933 933 if (memcmp(header.magic, MAGIC_START_6, MAGIC_SIZE) != 0) 934 934 return vdo_log_warning_strerror(UDS_CORRUPT_DATA,