Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3132094rwb; Mon, 15 Aug 2022 18:57:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR4JZkYK/z4i+sk5ny6RRWzPNS1YeT57A2CshEMVaFg6GUtaatY0Csvq8myDQ05AKiBD1FiG X-Received: by 2002:a17:907:868f:b0:730:bc1f:a8d8 with SMTP id qa15-20020a170907868f00b00730bc1fa8d8mr12395855ejc.106.1660615033826; Mon, 15 Aug 2022 18:57:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660615033; cv=none; d=google.com; s=arc-20160816; b=WBjOaGQsKb8geDzERd20pq84A4MDqgt+DbT/wVe3pB1QXgHiLKj0O+A1sH5gfQOjJJ DNvkqmRdOCu9lzMrdhGXKDJyq6zhXYYKnCV7Wszf4GN21MaC0HuCm2p5Mcdjjlt2qiA5 cO9N/zYd4bTUH/rjwicd0QEuJOmVryN5ypRpnA24QgqL6SRz5BnSsJ/rTf1VpISKyDmt t7nMBn4wrRXodUnTit0+5B7khPh8eiUgWazTDKK/cw3lBG5gdKCVmt3Qd3103kNABH2d dcT9DqGCvbTnB2y1z9hJBpXkO4BoRXPJG8lLE8TZNil2YkGuOvDMd928EiQ3d7htL/7g WevQ== 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=5/St7Qdm628VG1Dux26Gfc22Y1ZqVTHxrAtoKA34el0=; b=GwBIooSwNxHiU7B2hlKJ0U6zx1XEmsiF7g8B7MltyI+RIDQgF60pIWT4DHxJcrVyfW cZrzHHwe0Kh6+UUu3ncB/l8skzcrsVuWJHt4BUILgtA2vUgoUh7qMQzVFLZnYC53KT4/ udiqDX2uD9P2nHoJsJxmoHcaqtV5wiJwrfX6o/m9ewORQfx9U7JDRdBBvzGP85URwatm gduSm2JMoONkh5UTfFudlrBL9jXg6LhtuvoLmHolju31vzA/XYDMyZ9qrhREuYatt1cT maGHFIKI9Bfbaw8rwYr/Cmal3URHd4vR5OfU6Fj3i1s2Wz2sgpqrEzBPWZViWkRjtVhz qf2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sk6ab+rf; 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 ne18-20020a1709077b9200b0073086ecd585si9263179ejc.625.2022.08.15.18.56.48; Mon, 15 Aug 2022 18:57:13 -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=sk6ab+rf; 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 S242808AbiHPBD3 (ORCPT + 99 others); Mon, 15 Aug 2022 21:03:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347906AbiHPA51 (ORCPT ); Mon, 15 Aug 2022 20:57:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 634CCDB04D; Mon, 15 Aug 2022 13:49:01 -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 EEAD1B811AC; Mon, 15 Aug 2022 20:48:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45FC2C433D7; Mon, 15 Aug 2022 20:48:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596537; bh=eGA4siiuVAGWxG6012+puccnSKBJVXQuhYiRAMVoPn8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sk6ab+rfnNAedLqDFGby6Sdp2D9gOKmG8GjLO13vkvUQ5hTq8du32ja1IP+r21jBU GwyVtU8AAsmGkGLxFy8FCLuMqs2TxCaxAX13ntPou01UQ/PObJQVnnExcAcl4k7VEI i20vHfmP8UH1WkoqhrWLk6lt8Twd9VRkDccZ3Q68= 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.19 1110/1157] dm raid: fix address sanitizer warning in raid_resume Date: Mon, 15 Aug 2022 20:07:46 +0200 Message-Id: <20220815180524.708973481@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 4e7f870b2277..a55fc28d2a29 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c @@ -3819,7 +3819,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