mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 02:44:41 +01:00
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: a4eb7e2555 ("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>
This commit is contained in:
parent
e828a1875e
commit
9ddf6d3fcb
1 changed files with 2 additions and 2 deletions
|
|
@ -836,7 +836,7 @@ static int start_restoring_volume_sub_index(struct volume_sub_index *sub_index,
|
|||
"%zu bytes decoded of %zu expected", offset,
|
||||
sizeof(buffer));
|
||||
if (result != VDO_SUCCESS)
|
||||
result = UDS_CORRUPT_DATA;
|
||||
return UDS_CORRUPT_DATA;
|
||||
|
||||
if (memcmp(header.magic, MAGIC_START_5, MAGIC_SIZE) != 0) {
|
||||
return vdo_log_warning_strerror(UDS_CORRUPT_DATA,
|
||||
|
|
@ -928,7 +928,7 @@ static int start_restoring_volume_index(struct volume_index *volume_index,
|
|||
"%zu bytes decoded of %zu expected", offset,
|
||||
sizeof(buffer));
|
||||
if (result != VDO_SUCCESS)
|
||||
result = UDS_CORRUPT_DATA;
|
||||
return UDS_CORRUPT_DATA;
|
||||
|
||||
if (memcmp(header.magic, MAGIC_START_6, MAGIC_SIZE) != 0)
|
||||
return vdo_log_warning_strerror(UDS_CORRUPT_DATA,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue