Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3079691rwb; Mon, 15 Aug 2022 17:37:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR4Yhn5cHIIG2Uh35rgA6MY5hOE7Q9kvKRvUqBFGOsfTCigQ+D97Uhpp69enhdPkddc2cnZB X-Received: by 2002:a17:907:7637:b0:730:6a9b:148f with SMTP id jy23-20020a170907763700b007306a9b148fmr12193579ejc.273.1660610246721; Mon, 15 Aug 2022 17:37:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610246; cv=none; d=google.com; s=arc-20160816; b=Vk8x8NuBaOk1/yJz//X9voA5sXzQSxG/dSqwO28POKdpRigF7cnbpSeQGCKu2IjcJH kiIPaA7Ne51sXBpA1pejT9dlOVjMLuVfXUTvmGiYkSQY5NvyE1gTkiSvvF+BKy7zXwkE L/zErE0KCd+OvBqthhkfX8Yxopa9VnIwRNR782LURj96JC9mQ4Z7/4PXyP2jsZtUeWR7 UbFGcvZ7WZ5UbJeR6qgXgIwa0KqFZKP5m6NvjluyLMh7e1usp/d8n0F872nbFuk+Mbs2 FrF8fbxrj4Y8JeB78482c/koBvS57DsuzfXY+0RJTJHh4vbHz2wKCDaBDvJkmwKhIuos IV2Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IFAVaQVs2DY3vs4+pEGGkiJnaU0q5ymgeNWQkOW+Swk=; b=hHPkzAjFj9J9Jh4htkoQyuXN5gU9CNJmcrJ1WXf6u4YC1WyRGmI62HFX7g4P/oSjUQ AnMVUNUVYq0bOR3Qiry0okEF6R+Vx5kb2j559UnC8/EjP/1WxqWxGvn5+OFB4KCF366Q gyb00fpRInx+YFaK9kK4YLZ7NGY2OAvFCIE/kchE4+bYJqJH1oJXfL5YD0oG3MqFMlBv DPiNrpsMtfhB7bbBDYibrsDFriZ5rXkQIaxO218BI7ZWYvw6DWOnP+1k/0pbXnMJUrSO ZXTxK8KDW0zC2ovw3/nhHOtYUcKLh/CZpp8NoDqpK3/QcjEwthZ5E51qzTYi3aXLRUJb QIRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=U8F1LDmv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hb16-20020a170907161000b00726ed19161bsi10750994ejc.921.2022.08.15.17.37.01; Mon, 15 Aug 2022 17:37:26 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=U8F1LDmv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353388AbiHOXed (ORCPT + 99 others); Mon, 15 Aug 2022 19:34:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345722AbiHOX0y (ORCPT ); Mon, 15 Aug 2022 19:26:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF1E580F5F; Mon, 15 Aug 2022 13:07:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 42581B80EA8; Mon, 15 Aug 2022 20:06:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9CFC4C433D7; Mon, 15 Aug 2022 20:06:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594018; bh=rX//Aoamy1LKUauQAarWRD1cEgjxTas3z55cPZZLqUQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U8F1LDmvBq0NLpXLWbXd+bh9WfQkrpRcN6thyfnrpdCO8T8zWlmb4/EjSlPvKyBXW wmK7WEp8Iyc3pRaZTKEgsORJpEAZAUg12yi0F5dM0sdwX5dYoXi8rMUnuibyG24G51 w0W+DO5qirrih3oeicx07jyvfi5Xuk//qqM8oMsQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mikulas Patocka , Mike Snitzer , Sasha Levin Subject: [PATCH 5.18 1043/1095] dm raid: fix address sanitizer warning in raid_resume Date: Mon, 15 Aug 2022 20:07:22 +0200 Message-Id: <20220815180512.226178217@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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: X-Mailing-List: linux-kernel@vger.kernel.org From: Mikulas Patocka [ Upstream commit 7dad24db59d2d2803576f2e3645728866a056dab ] There is a KASAN warning in raid_resume when running the lvm test lvconvert-raid.sh. The reason for the warning is that mddev->raid_disks is greater than rs->raid_disks, so the loop touches one entry beyond the allocated length. Cc: stable@vger.kernel.org Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer Signed-off-by: Sasha Levin --- drivers/md/dm-raid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index 92e6b731f9d6..a55d6f6f294b 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c @@ -3824,7 +3824,7 @@ static void attempt_restore_of_faulty_devices(struct raid_set *rs) memset(cleared_failed_devices, 0, sizeof(cleared_failed_devices)); - for (i = 0; i < mddev->raid_disks; i++) { + for (i = 0; i < rs->raid_disks; i++) { r = &rs->dev[i].rdev; /* HM FIXME: enhance journal device recovery processing */ if (test_bit(Journal, &r->flags)) -- 2.35.1