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.4-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.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 7dad24db59d2d2803576f2e3645728866a056dab Mon Sep 17 00:00:00 2001 From: Mikulas Patocka <mpatocka@xxxxxxxxxx> Date: Sun, 24 Jul 2022 14:33:52 -0400 Subject: dm raid: fix address sanitizer warning in raid_resume From: Mikulas Patocka <mpatocka@xxxxxxxxxx> commit 7dad24db59d2d2803576f2e3645728866a056dab upstream. 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@xxxxxxxxxxxxxxx Signed-off-by: Mikulas Patocka <mpatocka@xxxxxxxxxx> Signed-off-by: Mike Snitzer <snitzer@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/md/dm-raid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c @@ -3808,7 +3808,7 @@ static void attempt_restore_of_faulty_de 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)) Patches currently in stable-queue which might be from mpatocka@xxxxxxxxxx are queue-5.4/md-raid10-fix-kasan-warning.patch queue-5.4/dm-raid-fix-address-sanitizer-warning-in-raid_status.patch queue-5.4/dm-raid-fix-address-sanitizer-warning-in-raid_resume.patch queue-5.4/add-barriers-to-buffer_uptodate-and-set_buffer_uptodate.patch queue-5.4/dm-writecache-set-a-default-max_writeback_jobs.patch