Message ID | 20230522072535.1523740-3-linan666@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1272983vqo; Mon, 22 May 2023 00:46:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7eWRY9wDLDlqUZMKwyLflmeVKx4+hLaaSaPwH60Zmvz8xH4COtvI+NkpCOL/Lui8JIG1yq X-Received: by 2002:aa7:88c4:0:b0:64c:c65f:7322 with SMTP id k4-20020aa788c4000000b0064cc65f7322mr12673320pff.30.1684741585883; Mon, 22 May 2023 00:46:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684741585; cv=none; d=google.com; s=arc-20160816; b=t6CdBu7urawop9nBIv+TPc9A3SDqpkKgFalfcChBM0JeEtxnoZRWfYDUdSpDxSiZEx T0wQT8/U4qei04pSMi/32dg+UerUHuaTp2LMPa5EE4o4eJ34qFiGK+pRgrcYhTHJhK+v LLjCPINrvXT6osJD0TwdmQ2oruXiAlFrJ2KfosL9rWqIVuAPiNGO7OHN25Hww2MDopIR Qv+C2COqS/fiHBfCzQLm/WlPRNMaMrjUYuQAGGWvmzzxEv7K4GVvP7OnD3/kvT3aNhuH SRVI5p0NEidb5YGZtO+mLQ4WGRO4B1TZhhCVQHgMsAqqm8M+Z1pxUtQ1YIY5UElgRuxO pOyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=JHq+i2pEaogviQJ4omG2nlrzDfT94IMHySUa+rXc+LI=; b=FUT39u/03gIM8o68XhAoSVZ/rb3Vdqi3ftr8CMdb+fmKdy2RqOdaUc+c1QF6OsV97f 79zVwm+17cxnNcMul/uB5HQ4iFdHo34f+FQfCaUCZShLGo75X/P+sZCReJzHGmbd2nGt YErWnAPs7bURglzXi4mJ6yyNjeJiT57yg3Rsep4/t4l3h+20vUSHgVIpNEqnSljk2UGZ OSeMs3yt8NGtSWeyHLzCplg5kljI7vcGQw+6/B5WuYm6z/1emM2HeV7WExja17SLTx92 5Q3s1jVkwFTwyQ11xsue6THms5CncbcOgW/cYHyCxfMnMDYvwm0Ieo79LgSJu3yfkNn5 Fj+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c9-20020aa79529000000b0064678cefdd5si4442632pfp.223.2023.05.22.00.46.13; Mon, 22 May 2023 00:46:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232592AbjEVH1Y (ORCPT <rfc822;cscallsign@gmail.com> + 99 others); Mon, 22 May 2023 03:27:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232439AbjEVH1R (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 22 May 2023 03:27:17 -0400 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FA0ABF; Mon, 22 May 2023 00:27:10 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4QPptL5nDLz4f3p17; Mon, 22 May 2023 15:27:06 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP2 (Coremail) with SMTP id Syh0CgBH7epJGWtkztVuJw--.34097S6; Mon, 22 May 2023 15:27:07 +0800 (CST) From: linan666@huaweicloud.com To: song@kernel.org, neilb@suse.de, Rob.Becker@riverbed.com Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, linan122@huawei.com, yukuai3@huawei.com, yi.zhang@huawei.com, houtao1@huawei.com, yangerkun@huawei.com Subject: [PATCH v4 2/3] md/raid10: fix wrong setting of max_corr_read_errors Date: Mon, 22 May 2023 15:25:34 +0800 Message-Id: <20230522072535.1523740-3-linan666@huaweicloud.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230522072535.1523740-1-linan666@huaweicloud.com> References: <20230522072535.1523740-1-linan666@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: Syh0CgBH7epJGWtkztVuJw--.34097S6 X-Coremail-Antispam: 1UD129KBjvdXoWrur4kXF4fGw18JF4fZrWxtFb_yoW3ZFg_Ca 1Fqay3Xr9Iyr12ywn8Zr4SvrW2y3yv9ryDWF1Ika45A3WrZ34Iqa4ru3s8Xr1rJrWkua45 Xr1kK3yIvr4DKjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbk8YFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l82xGYIkIc2x26280x7IE14v26r15M2 8IrcIa0xkI8VCY1x0267AKxVW8JVW5JwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK 021l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r 4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ GcCE3s1lnxkEFVAIw20F6cxK64vIFxWle2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64 xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j 6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwACI402YVCY1x02628vn2 kIc2xKxwAKzVCY07xG64k0F24l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_ Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17 CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0 I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I 8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73 UjIFyTuYvjxUc-txDUUUU X-CM-SenderInfo: polqt0awwwqx5xdzvxpfor3voofrz/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766579592916816666?= X-GMAIL-MSGID: =?utf-8?q?1766579592916816666?= |
Series |
md: bugfix of writing raid sysfs
|
|
Commit Message
Li Nan
May 22, 2023, 7:25 a.m. UTC
From: Li Nan <linan122@huawei.com> 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> --- drivers/md/md.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/drivers/md/md.c b/drivers/md/md.c index b2d69260b5b1..350094f1cb09 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -4478,6 +4478,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; }