diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2022-07-24 14:33:52 -0400 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2022-07-28 17:29:56 -0400 |
commit | 7dad24db59d2d2803576f2e3645728866a056dab (patch) | |
tree | 12ddbf9201351f8d0d17acbe8661935c545c8587 | |
parent | 1fbeea217d8f297fe0e0956a1516d14ba97d0396 (diff) | |
download | linux-7dad24db59d2d2803576f2e3645728866a056dab.tar.gz linux-7dad24db59d2d2803576f2e3645728866a056dab.tar.bz2 linux-7dad24db59d2d2803576f2e3645728866a056dab.zip |
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: stable@vger.kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
-rw-r--r-- | drivers/md/dm-raid.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index f41fd3cf5c7d..e6a9b8cb22d3 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c @@ -3817,7 +3817,7 @@ static void attempt_restore_of_faulty_devices(struct raid_set *rs) memset(cleared_failed_devices, 0, sizeof(cleared_failed_devices)); - for (i = 0; i < mddev->raid_disks; i++) { + for (i = 0; i < rs->raid_disks; i++) { r = &rs->dev[i].rdev; /* HM FIXME: enhance journal device recovery processing */ if (test_bit(Journal, &r->flags)) |