projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b5cb16d
)
md/raid10: fix wrong setting of max_corr_read_errors
author
Li Nan
<linan122@huawei.com>
Mon, 22 May 2023 07:25:34 +0000
(15:25 +0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 19 Jul 2023 14:20:57 +0000
(16:20 +0200)
[ Upstream commit
f8b20a405428803bd9881881d8242c9d72c6b2b2
]
There is no input check when echo md/max_read_errors and overflow might
occur. Add check of input number.
Fixes: 1e50915fe0bb ("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>
drivers/md/md.c
patch
|
blob
|
history
diff --git
a/drivers/md/md.c
b/drivers/md/md.c
index 0c97531d35038c525d7cf33ff1b6a54733501b57..829e1bd9bcbf9920a24d517c1e115a68afb7522c 100644
(file)
--- a/
drivers/md/md.c
+++ b/
drivers/md/md.c
@@
-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;
}