mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
md/raid10: fix wrong setting of max_corr_read_errors
[ Upstream commitf8b20a4054
] There is no input check when echo md/max_read_errors and overflow might occur. Add check of input number. Fixes:1e50915fe0
("raid: improve MD/raid10 handling of correctable read errors.") Signed-off-by: Li Nan <linan122@huawei.com> Reviewed-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Song Liu <song@kernel.org> Link: https://lore.kernel.org/r/20230522072535.1523740-3-linan666@huaweicloud.com Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
b5cb16d31b
commit
05d10428e8
1 changed files with 2 additions and 0 deletions
|
@ -4513,6 +4513,8 @@ max_corrected_read_errors_store(struct mddev *mddev, const char *buf, size_t len
|
|||
rv = kstrtouint(buf, 10, &n);
|
||||
if (rv < 0)
|
||||
return rv;
|
||||
if (n > INT_MAX)
|
||||
return -EINVAL;
|
||||
atomic_set(&mddev->max_corr_read_errors, n);
|
||||
return len;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue