Skip to content

Commit 7dad24d

Browse files
Mikulas PatockaMike Snitzer
authored andcommitted
dm raid: fix address sanitizer warning in raid_resume
There is a KASAN warning in raid_resume when running the lvm test lvconvert-raid.sh. The reason for the warning is that mddev->raid_disks is greater than rs->raid_disks, so the loop touches one entry beyond the allocated length. Cc: [email protected] Signed-off-by: Mikulas Patocka <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent 1fbeea2 commit 7dad24d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/md/dm-raid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3817,7 +3817,7 @@ static void attempt_restore_of_faulty_devices(struct raid_set *rs)
38173817

38183818
memset(cleared_failed_devices, 0, sizeof(cleared_failed_devices));
38193819

3820-
for (i = 0; i < mddev->raid_disks; i++) {
3820+
for (i = 0; i < rs->raid_disks; i++) {
38213821
r = &rs->dev[i].rdev;
38223822
/* HM FIXME: enhance journal device recovery processing */
38233823
if (test_bit(Journal, &r->flags))

0 commit comments

Comments
 (0)