]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dm raid: fix address sanitizer warning in raid_resume
authorMikulas Patocka <mpatocka@redhat.com>
Sun, 24 Jul 2022 18:33:52 +0000 (14:33 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Aug 2022 13:16:24 +0000 (15:16 +0200)
commitc2d47bef93fb74aa97d90f9a40ca657b8f376083
treedcd6484074e495dcb9d6656a57392729243910b5
parentd0b495aa2692d50f72b9d18ea3897581b0bacc46
dm raid: fix address sanitizer warning in raid_resume

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@vger.kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-raid.c