Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1241737imw; Tue, 5 Jul 2022 06:18:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1svUdz5raR2SpyKymqaVNMahGuDSuClecmGxQv8XyShS29ubfljEqx589Ee1f+KOjKCId/5 X-Received: by 2002:a63:3184:0:b0:40d:7801:e7e with SMTP id x126-20020a633184000000b0040d78010e7emr29553377pgx.333.1657027086472; Tue, 05 Jul 2022 06:18:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657027086; cv=none; d=google.com; s=arc-20160816; b=Is33hmBJeZh13RN5FbSKa1S7jGhQjkPdIGPDTnJ+8hiCkGKHLtaUbHmOT2pGl4rqqg Bi0ZcXCcjyt3rbaYT+cHBiF23xGD7DV1Tf0pBtfMPwjTVmMfYT588IEd0K9YBNENI2gs jqCRSwPZPOY/Nx+LkCXUA3jsjl2m4S49WU/XkQQtPGutyGtlDYi/UBe7RfxabVoJHVK2 pfwLc5QrLR4avjB2oiCnwg4qayS5cPxhqYP7glweGajV98Jwn3xZm856Cfb7y9mK63HK uv8asg2BhVl3EJgfe/g/RBGpupe1mXWuoY3OnDWwpz9D0l5ADEP4+o7IWrX5lXy6NhSM oWng== 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=6/62AOT4p6NoITmQhsyTWpS4oGCJZ+gNs/Kg5qyEwPk=; b=jQQiJ6pewqAN3dhsKSSOim/yI67YMwoJW5yfRS736rYjVLoq6ZLEBMydUccU+QG8Z8 d7EnGTH/dIw+QHSUOA7h5pNEJ03pmXXXEv+dXBgFZWPpvAzbyOi5OZjbj5z4qVlSPIUk aLklImwO3hbuTK+aL+9jOkIeedCwEc6l2sUKLGNTdZiDGI40cC0L76dAGBDuiNKm/1sf 8gXpmStmZAW3tEJ5fIN5rYstMl8/5EQM/bWg4bulL2NZD8V4va0ByCA5TTDfrKu65dje mD2rqG5Z5orlOEa/hhh5oGXNdGPDXX7VgGwpUs757MOKXsjTYnY2ZCJSovNN+Pnflqvt 4W1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lc8rGL4O; 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 a6-20020a63cd46000000b004019c5f7652si47960592pgj.640.2022.07.05.06.17.55; Tue, 05 Jul 2022 06:18:06 -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=lc8rGL4O; 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 S231875AbiGEL7Z (ORCPT + 99 others); Tue, 5 Jul 2022 07:59:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231770AbiGEL7X (ORCPT ); Tue, 5 Jul 2022 07:59:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFF7526EA; Tue, 5 Jul 2022 04:59:22 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 6767561786; Tue, 5 Jul 2022 11:59:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 738BDC341C7; Tue, 5 Jul 2022 11:59:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657022361; bh=qOI3ZxHHACL3+QQiOQ3xfjJlVfbHoZv8uvwUZcnjSYc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lc8rGL4ODglQspiE4oHmTEKn8xXmsvCRfcM5/THkB0+iD5OrEPWolqkdyuvspOqSv aSPpgg3Q9LE0QCnlcc9LhDcPCbTi05g5J0il/jpmakpiVAqKlWTDCoTYmo9Bwh4Fyz XViXZz4Ozp8NaTXA/oZplNBxG0WRhEMl/JWgZXtM= 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.9 01/29] dm raid: fix KASAN warning in raid5_add_disks Date: Tue, 5 Jul 2022 13:57:42 +0200 Message-Id: <20220705115605.787481910@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220705115605.742248854@linuxfoundation.org> References: <20220705115605.742248854@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 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 617b365872a247480e9dcd50a32c8d1806b21861 upstream. There's a KASAN warning in raid5_add_disk when running the LVM testsuite. The warning happens in the test lvconvert-raid-reshape-linear_to_raid6-single-type.sh. We fix the warning by verifying that rdev->saved_raid_disk is within limits. Cc: stable@vger.kernel.org Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/raid5.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -7322,6 +7322,7 @@ static int raid5_add_disk(struct mddev * */ if (rdev->saved_raid_disk >= 0 && rdev->saved_raid_disk >= first && + rdev->saved_raid_disk <= last && conf->disks[rdev->saved_raid_disk].rdev == NULL) first = rdev->saved_raid_disk;