[dm-devel] Patch "dm raid: fix address sanitizer warning in raid_resume" has been added to the 5.18-stable tree
Sasha Levin
sashal at kernel.org
Mon Aug 15 06:10:13 UTC 2022
This is a note to let you know that I've just added the patch titled
dm raid: fix address sanitizer warning in raid_resume
to the 5.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
dm-raid-fix-address-sanitizer-warning-in-raid_resume.patch
and it can be found in the queue-5.18 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable at vger.kernel.org> know about it.
commit 737fa72cb41c624004f0ab3e93689a3a9cfa1b17
Author: Mikulas Patocka <mpatocka at redhat.com>
Date: Sun Jul 24 14:33:52 2022 -0400
dm raid: fix address sanitizer warning in raid_resume
[ Upstream commit 7dad24db59d2d2803576f2e3645728866a056dab ]
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 at vger.kernel.org
Signed-off-by: Mikulas Patocka <mpatocka at redhat.com>
Signed-off-by: Mike Snitzer <snitzer at kernel.org>
Signed-off-by: Sasha Levin <sashal at kernel.org>
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index 92e6b731f9d6..a55d6f6f294b 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -3824,7 +3824,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))
More information about the dm-devel
mailing list