Patch "md/raid10: fix wrong setting of max_corr_read_errors" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    md/raid10: fix wrong setting of max_corr_read_errors

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     md-raid10-fix-wrong-setting-of-max_corr_read_errors.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit fc949584cca57f4a65bcdce6230955bbdb8fdf22
Author: Li Nan <linan122@xxxxxxxxxx>
Date:   Mon May 22 15:25:34 2023 +0800

    md/raid10: fix wrong setting of max_corr_read_errors
    
    [ 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@xxxxxxxxxx>
    Reviewed-by: Yu Kuai <yukuai3@xxxxxxxxxx>
    Signed-off-by: Song Liu <song@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230522072535.1523740-3-linan666@xxxxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 204838a6d443e..bbf39abc32b79 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4574,6 +4574,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;
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux