]> git.baikalelectronics.ru Git - kernel.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>
Wed, 17 Aug 2022 12:24:26 +0000 (14:24 +0200)
commit8d5f3e598ed61ec1e50cc685ac8b2cb8c79b6b07
treedbe10081cb5b9a67b25e316387e20a2aa63ee0a3
parenta2d16a54310c8265183944961892a1fb6387339b
dm raid: fix address sanitizer warning in raid_resume

[ Upstream commit d59d1ab9b4c02b705755e27fef5b5468af29067c ]

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: Sasha Levin <sashal@kernel.org>
drivers/md/dm-raid.c