Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2886999rwb; Mon, 15 Aug 2022 13:19:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR7ZfFXIo3W6KQ77WTj/TgNEoVlxK4f9ArABPvdPqkDXTXglwL7IgjCtQroBA55qNXDPRTQP X-Received: by 2002:a17:907:6eaa:b0:730:9fb6:41a5 with SMTP id sh42-20020a1709076eaa00b007309fb641a5mr11269607ejc.675.1660594792829; Mon, 15 Aug 2022 13:19:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594792; cv=none; d=google.com; s=arc-20160816; b=D2p+pz4/g6IOWEqIQwkTBvshtkcqOT3Oo7eLSEG+WRZGCu3opg4Gv/zKycsONrveqU q/Eut5iHNZUo8lIj+M0gu7iu09WRMhdyLayGApm0ZFaKYwHGaVj7NHEctNSxyQbAqUII 0rMHoReoHgf+CVDb9FkTyOKEKkH3bVXlmaJBj16vDQCpSma77fos4lnNdKulyPU31V7I X/o715IqUqwN6qj6VBs7fSsbAquBRUgdIlcp3t0dPN8wBlTtrM6mP65N/5bhxiIYTFjR TOtYe4Xaa7724EjP3tKIfinEzzh381KSJTTFBhCaY7gFw+QtxNVKgRoEIFJvjL5gAboK dFug== 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=ameNnnHSNU4/J9vPCyo7DNfhz6n2F/A5/Nw/P/sK1K0=; b=Rhj+yKUmeRktCnAZM4RUGThCnik8IW5ihOp1Vinl4kZG4adKIr8dQucrSX/qg0UPA0 cUiEDjpi1j/D8D6mWw0ONshC65d0Wqgebo1WOLY48CRVJZYKrj+y5HfOlBdA1arWVfYJ vAdeZrfuTYt6vC+DxIlt8JgrzqXfy0Cv/FHwiCDGVB0Y//s8+Ek8El9AZ5/JHXie7rLM mpWkvwsxszK0F0oNVfxTuHDpVOcUC0SAJJEEgFZlDEAl/J4zUPyODbjAn6zoTuaBe9LY UMywVbnIKOj2tKIlueN5N4lx+W/sYQ5XZAvqK+iJzCOuuK1TAgc+pZ5mTvWVji75gti4 5RmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="lv3/okei"; 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 z4-20020a056402274400b0043df391fc57si9739414edd.542.2022.08.15.13.19.25; Mon, 15 Aug 2022 13:19:52 -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="lv3/okei"; 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 S1345376AbiHOTza (ORCPT + 99 others); Mon, 15 Aug 2022 15:55:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345475AbiHOTxb (ORCPT ); Mon, 15 Aug 2022 15:53:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08CF43205A; Mon, 15 Aug 2022 11:51:43 -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 A97B6B810A0; Mon, 15 Aug 2022 18:51:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1650CC433D6; Mon, 15 Aug 2022 18:51:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589500; bh=TxKAbx4QRMRivSlFf4ukwAugW2WTjATdCUdXwMbEo6w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lv3/okeiv1yeL6R35tpxVFk4JHyeasWAm2ag1NRnrhVasJu1K63ZvRElrtN+VpNKP kNTH3T5earBbb4Jx0TTkfLXOHCLRRAp/WHR1uPvgutyIXz4dZuVUvheUthhyhgcNfn JtsZxvfj7xu/acwsH+tWKdukNqZNvl3yq7IXM9eM= 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.15 738/779] dm raid: fix address sanitizer warning in raid_resume Date: Mon, 15 Aug 2022 20:06:22 +0200 Message-Id: <20220815180408.984998844@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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 5f7e40c48e47..eba277bb8a1f 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