Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3408171rwa; Tue, 23 Aug 2022 04:24:01 -0700 (PDT) X-Google-Smtp-Source: AA6agR64H7+3Lg+tFfPQaN8uqBAcW0p35Q3PE4AxAwlUUABIYC69WzG82TO9WINM9eJUFcxwyxD6 X-Received: by 2002:a17:902:bd08:b0:16e:e00c:dd48 with SMTP id p8-20020a170902bd0800b0016ee00cdd48mr24186485pls.93.1661253841489; Tue, 23 Aug 2022 04:24:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253841; cv=none; d=google.com; s=arc-20160816; b=QneVM2vgVkk7+uY/pXLlOL6+A+QH3clvmmGq7TeVyZLRYMLVF1U6NbUgCpX1/Ye44K A4eGF8ZFotDZsMQbxdXvBr7WAmEvO1hcd7WVZsW6MRXOIzw74uy7oPdvWrayWdTIPnBk l1lw4jimoGKS0oR2MAaa9KOrgmnyzl7aOuwMpATXriqJ++IoElamYAL1gEsb43dXY7YV abFM/SMTpCeEjSXV7R08zKKv9gSqsczM9BMYVlYss37i6zbJQn4GXjjkmK6g/92tU/U9 knavpZUu28Gq+SA7hIFi0XORAco3OMi5lUUHMleKa8E36gxcngjpHoWysr0tQIVnU8wU aWWQ== 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=Qsy4vrfLjVgLczlyJWEsPmTcS5RLPNpfh9SYhigRQHU=; b=kxALOa3UExnp8KF6MVLUWVvUDLp2K4eWQ/k9ZUkI1mouZbfZLRqWZYwJmbqJqeSRW7 d+fmz5/m7vip1FtZXwgRUP/lW/lgAX9ta0X2bcm+q3q8ONO1BsC3hAwcIoApPOWpsB4h Zj+UzSEoBJV+62B6bGzI/2jfCTRYnyHZqYjYwu0K+qUIsLgUAFhLhEougrISOCvHho8n DjF9DlcMRQ7r8YslD8wjQa0v+bFlxAJ1bh7sXaBCDawDHthfY70kDuoNCzqKgDKsG9w/ J9m+Ly/VY2UokleAHWVdZaqjvi/ZrDx/DVsTihN/CmvNZwV/ABguSy/TLbDYcsXJCFs+ RGhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tj0JvzIX; 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 k10-20020a170902760a00b0016ef52684f8si13706060pll.323.2022.08.23.04.23.50; Tue, 23 Aug 2022 04:24:01 -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=tj0JvzIX; 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 S1356371AbiHWKut (ORCPT + 99 others); Tue, 23 Aug 2022 06:50:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356646AbiHWKmr (ORCPT ); Tue, 23 Aug 2022 06:42:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEFDBAA4D6; Tue, 23 Aug 2022 02:10:15 -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 2275EB81C86; Tue, 23 Aug 2022 09:10:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DE81C433C1; Tue, 23 Aug 2022 09:10:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245812; bh=LbR6paUcR0gagXe0wUqIZ/vi+MQcUnZwf8SleQiJXr0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tj0JvzIXRA7G+GbZbBnwSbM3WXZkdr5sx5hBGFkKOjYbeCeUs7GBlARW2tsdpSr5v yxxxwwADSo0+ZVA+G3tw2IJMh/JdLLCGhhsYHdJ9WCcmBsurm2N7lbGFZf3iLlgBM2 EXlQaeZSltOAz5Q7to22LTlqsR/xIqU9oc0zK8Jw= 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.19 197/287] dm raid: fix address sanitizer warning in raid_resume Date: Tue, 23 Aug 2022 10:26:06 +0200 Message-Id: <20220823080107.474284943@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@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 @@ -3804,7 +3804,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))