Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3473588rwa; Tue, 23 Aug 2022 05:28:08 -0700 (PDT) X-Google-Smtp-Source: AA6agR4uGh2g3jGZyrlGU10LJcAfeVF/mt2JSmo6zo4UaA2QiRpvfQXOys++BB02/8Pn5WqHAUo4 X-Received: by 2002:a63:f357:0:b0:423:31a8:8d71 with SMTP id t23-20020a63f357000000b0042331a88d71mr20883053pgj.358.1661257688347; Tue, 23 Aug 2022 05:28:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661257688; cv=none; d=google.com; s=arc-20160816; b=zMYtOelpgmDzjC/wzE2xYBJyNzU4zWHeyu7wCeiKjoxTQITOJnuLkIl06Aa8ArS4HR u/wPkBchTC62Yc+NVMo8jeVsWg55BEXK4jmt3u7TcFs2gyywwANDwTZGOsSyt6EU8gIi shsdIec3y9/fNtY7YgPqiy08uuxI8UI3HAMkRwwS/DsYX+gbL83cCXPsoyMaeLdkkLSf p1mRACRyg4rZQZv3gIZmroKs11ce38qrb6lWrLm823n5nFnxOY1vLGOsRDQtlNiEL4Yx o2/K8Efye81gzIJRelc/hMnw5IT4A65uLSiUZ4cntwo2G8B9fUROAIj1Kb6ME6XbklI6 Ww/g== 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=DuOK+Ob9K24KPm1E0mw+nUfiDJwpk+m0KKiOF0MfY+4=; b=bJDGenE/F8SGDhAkqNP8N8+fIPQSJ759szoTD+TO28RKYH8EbGvXbnJoU0sXWmQQV+ RYXX80X4x/X+EjkzEDe06aMuBrjATr7IEbKMV77R3ZEkVI5aSDg2az5qqPQ8azmQ+wOU ieWd2HQ6WqIC56uHfMidkNfvWq/5XFy0HUBrP0KG4ObpSioH0H535znSJ1ni3Igf0sYX Fm/jI8gb4WmXN85yeq/9HHySvceAEUoVYXFa5KfFxESI6zRO0N07tjYcc+57yz/kCyUv ZabLOXxMTs0BnE0SkFECOobI+3WWQ0GayfsCpSwOISsK9CXFzi8HFtvDgbJ0asEoseZY qKCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=i0SILXfm; 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 nw5-20020a17090b254500b001fb467ce1c1si3969750pjb.12.2022.08.23.05.27.55; Tue, 23 Aug 2022 05:28:08 -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=i0SILXfm; 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 S1351879AbiHWKIn (ORCPT + 99 others); Tue, 23 Aug 2022 06:08:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352526AbiHWKCB (ORCPT ); Tue, 23 Aug 2022 06:02:01 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DBE8A260B; Tue, 23 Aug 2022 01:49:59 -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 A08F2B81B90; Tue, 23 Aug 2022 08:49:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 014EEC433C1; Tue, 23 Aug 2022 08:49:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244597; bh=BONo5jgRyauoo1vO9FpGyfO7DzEIhl66XISMXw96hok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i0SILXfmAfUUYPHFm1Q5gl1NA98kNdK9H6Dd5F/aJBvwTB+4X2klp1xEeF6XgRD6F g2io4jfG1Avh1hClHfRA8D8FgBFApDpW3mFo4L5BPFfPP24WDKCYC1zfde9Za+OHBn DFylVDsY36IU0dMjKT885J3AgR1dS1BIZzis99dA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mikulas Patocka , Mike Snitzer Subject: [PATCH 4.14 162/229] dm raid: fix address sanitizer warning in raid_resume Date: Tue, 23 Aug 2022 10:25:23 +0200 Message-Id: <20220823080059.462238932@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@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 commit 7dad24db59d2d2803576f2e3645728866a056dab upstream. 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: Greg Kroah-Hartman --- drivers/md/dm-raid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c @@ -3669,7 +3669,7 @@ static void attempt_restore_of_faulty_de 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))