Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1440611rwb; Fri, 19 Aug 2022 03:55:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR4GVdLkGscEcs2Oj6u5fsN48pmA9WEOGWQ1bhqT9G/qYSK3tsjbt5+vEzW1JopjX3/5U0Xj X-Received: by 2002:a17:907:94d2:b0:73b:f1b0:3b74 with SMTP id dn18-20020a17090794d200b0073bf1b03b74mr3777095ejc.158.1660906503511; Fri, 19 Aug 2022 03:55:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660906503; cv=none; d=google.com; s=arc-20160816; b=KSkiRrE2h/z2Vk2xawNkdBK8U7dUrqdvEJO9fkoYAhd/7ax9Qd3+Zv3hHMJaVy8QcK 1VrttplgXZ8xslJLOoQbd8SwDcR9ovuRgi3+K2taKoRBOPVzfuqTANJW1G0UHJYUibaw 8s0lQyG8UEyZIzLy+U/Eh5UGj8NbPJ75LQ42iMOEEl5OFW8t+5gatA9aej7nfuMLQG9h dlEnX4IVpbq6FeKkLrfMJSxyNjRzo4hzG5hPVuls40J7VlIFFuaSExN1t7n1BDPCRDih HYIMZf4areCgdYuBMi8HKwhRbK/EbzutmsBALPYuYR4FlW9w8KPvLjQtQkUpdnjwH+KZ nuzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=4yWpBR2eezY3o3Am5qf/Qq3bvJAB9/Dku395o2UqhcQ=; b=07AXbQUSWlEoxVoF6mEIw308WFMjn4eEUYImrSdV39LtJ+8yaej2L/+DaCoveMnGv5 yAtiHChWmhBfCeqStXpP5rJ/N8qaQFF7AEt0+UIKU/XHOqhvRSiMT7H/AtpTwExFwPvK 5+28lGDsUYRWM87XysbpTJllCNPLHmG97dsVZHP/BlP0gErmoIggBWQ4XokyPTI/ZOdu j7QtCRhza+6QVGDhyE1ljKW21NPKZVlEHdjvWDUWi6Cll2ZiTR0zCg+8hXYbRYdXR/yz Akj5efxW92kVgQezDfPvKtq3WIVn9Pel5S+2DTvCD15+pNImWKiclOrVmx3cVinDXHZf 1mxQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 10-20020a50874a000000b0043be542b956si2992444edv.262.2022.08.19.03.54.38; Fri, 19 Aug 2022 03:55:03 -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 S1348094AbiHSKpn (ORCPT + 99 others); Fri, 19 Aug 2022 06:45:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347538AbiHSKpj (ORCPT ); Fri, 19 Aug 2022 06:45:39 -0400 Received: from jabberwock.ucw.cz (jabberwock.ucw.cz [46.255.230.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38F4FC2778; Fri, 19 Aug 2022 03:45:37 -0700 (PDT) Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 87D9C1C0003; Fri, 19 Aug 2022 12:45:35 +0200 (CEST) Date: Fri, 19 Aug 2022 12:45:34 +0200 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Mikulas Patocka , Song Liu , Jens Axboe Subject: Re: [PATCH 5.15 089/779] md-raid10: fix KASAN warning Message-ID: <20220819104534.GA11901@duo.ucw.cz> References: <20220815180337.130757997@linuxfoundation.org> <20220815180341.087873206@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OXfL5xGRrasGEqWY" Content-Disposition: inline In-Reply-To: <20220815180341.087873206@linuxfoundation.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NEUTRAL,T_SCC_BODY_TEXT_LINE autolearn=no 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: X-Mailing-List: linux-kernel@vger.kernel.org --OXfL5xGRrasGEqWY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > From: Mikulas Patocka >=20 > commit d17f744e883b2f8d13cca252d71cfe8ace346f7d upstream. >=20 > There's a KASAN warning in raid10_remove_disk when running the lvm > test lvconvert-raid-reshape.sh. We fix this warning by verifying that the > value "number" is valid. >=20 > BUG: KASAN: slab-out-of-bounds in raid10_remove_disk+0x61/0x2a0 [raid10] > Read of size 8 at addr ffff889108f3d300 by task mdX_raid10/124682 Is this place for array_index_nospec? Best regards, Pavel > --- a/drivers/md/raid10.c > +++ b/drivers/md/raid10.c > @@ -2139,9 +2139,12 @@ static int raid10_remove_disk(struct mdd > int err =3D 0; > int number =3D rdev->raid_disk; > struct md_rdev **rdevp; > - struct raid10_info *p =3D conf->mirrors + number; > + struct raid10_info *p; > =20 > print_conf(conf); > + if (unlikely(number >=3D mddev->raid_disks)) > + return 0; > + p =3D conf->mirrors + number; > if (rdev =3D=3D p->rdev) > rdevp =3D &p->rdev; > else if (rdev =3D=3D p->replacement) >=20 --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --OXfL5xGRrasGEqWY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCYv9pzgAKCRAw5/Bqldv6 8v/gAJ4sTX5X3zY3ubBbRZSn/XTq14xIywCeNyHFEYnBxjdVRIz+YCGiu7U2uls= =mCrN -----END PGP SIGNATURE----- --OXfL5xGRrasGEqWY--