md: raid1: fix potential OOB in raid1_remove_disk()
If rddev->raid_disk is greater than mddev->raid_disks, there will be an out-of-bounds in raid1_remove_disk(). We have already found similar reports as follows: 1) commit d17f744e ("md-raid10: fix KASAN warning") 2) commit 1ebc2cec ("dm raid: fix KASAN warning in raid5_remove_disk") Fix this bug by checking whether the "number" variable is valid. Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com> Reviewed-by: Yu Kuai <yukuai3@huawei.com> Link: https://lore.kernel.org/r/tencent_0D24426FAC6A21B69AC0C03CE4143A508F09@qq.com Signed-off-by: Song Liu <song@kernel.org>
parent
a705b11b
-
mentioned in commit beedf40f
-
mentioned in commit 6a65d463
-
mentioned in commit 91fbd4e7
-
mentioned in commit d9096f58
-
mentioned in commit 7993cfc0
-
mentioned in commit 634444de
-
mentioned in commit 4f96c066
-
mentioned in commit d30af15e
-
mentioned in commit 25a68f22
-
mentioned in commit a8403f9f
-
mentioned in commit 4f7d853b
-
mentioned in commit ba4f28a1
-
mentioned in commit 2bf1bdca
Please register or sign in to comment