Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp121570rwp; Wed, 12 Jul 2023 10:34:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlHKygr9TQFYkVTXy7t8UURNSMhT9scYTQ4TVE4MblH+dgQpeoJ5bWolcuBFoSNgE3E/LpF9 X-Received: by 2002:a17:906:9b4f:b0:992:d013:1131 with SMTP id ep15-20020a1709069b4f00b00992d0131131mr16247038ejc.52.1689183251922; Wed, 12 Jul 2023 10:34:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689183251; cv=none; d=google.com; s=arc-20160816; b=HJm5T7zDRWxDGwwOoGWBJDMAdATBiERJlFLeYVBuqS6So59xjKfF30ShmfkK6ZCY9r wKByrIzn3FoilP5Gz2mv1xdLrj6vopX54EuYmVGaW8WtsJtE5KFSzfvfuKgAxYBPy5E0 XBnSQjBzOp7LLEKaabAOMdfddf3ENS15C6Hu52vjbU8XXJTQ4nRGDutfpBKTc+gqB5Cu 1uqs9cm2ig5Mv1WVY/aH76ozFskuJ0woXvGa8lEr6aSjk0ck5lZtKTNDwSZjElXCkw+J dBP2iA6mgWjdNqIbNXi8J4FrgQHdLGDmmYT1dh2+MjI/yeF89a1bKJ2To8xqau9IRyPm g7AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=8saf6uV1XIVQipbIWGpCaD1a2vCHrR1UEMmL0zruzHc=; fh=edWdWG9uiMCJ5dDtpN/Q1PxYHMB4yrunxeAyO06qGcA=; b=nMfHqqlYODgtQLHbLQun86D5dacM+6WExJd507+4XJSuuOxHwLTh1p+/v4vmtAtbS6 UvnnsO8VKayyCb3Pwpn4QXTcfqBxotBkwzrSacP/ftE7aUFT77iexobXTTipA3vxpc8B cNpBq2kB+CyLDZvTl07K6To3xYA4J2xRzdFY4vsjhgiK7x+lvWoS8MzaOGlgIAPo713E E/EbaJqCX/JKK2RcEHUUAYrzwrMFbNPT2y4P2bbeDvEu+OQjTfIaZVQQzffSZndMp0Mx SpO4uU4t+XdGCnRKml6FfAvrntDDCWE2deFmc49NYegwyfOC6UutcM2w97o06+qW8AuH 2D7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=EMwk0Z3V; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k12-20020a170906578c00b00993ac8be754si5740917ejq.106.2023.07.12.10.33.45; Wed, 12 Jul 2023 10:34:11 -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=@infradead.org header.s=bombadil.20210309 header.b=EMwk0Z3V; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233293AbjGLQu0 (ORCPT + 99 others); Wed, 12 Jul 2023 12:50:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232457AbjGLQuZ (ORCPT ); Wed, 12 Jul 2023 12:50:25 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C6DE10C7; Wed, 12 Jul 2023 09:50:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=8saf6uV1XIVQipbIWGpCaD1a2vCHrR1UEMmL0zruzHc=; b=EMwk0Z3VA/RmH/RXU65HyyFpSK 759eq9vUP+uXU6TDEJpCv+lj2WeXVLfAvX0a9hZ+MoP02iybbXgyLOij1IcwD6Ox+jFNqkD+sRJ/i KTeYlrxWqS0iDcwup1ydbgu7xi8Ajhz6t6tXq14yoqL0UOiA1vvpGi9bbIhtnaogN8LK6HQbe52YS jhhsuGmKjSbcT6hYGXXXAdZUrs6ZgMutW/V3IB9U9Br99CYqragVWLFNKyRznt4As9lhxQo45S1bZ Pgzcp4KsOouLXhnO1eoAjmXXXxSOEps0UP5IKvrGpuEmUWyGlhics0+n3dPziV00Wxf008KtMdpRT nbCMl1bA==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1qJd2h-000eJe-1B; Wed, 12 Jul 2023 16:50:19 +0000 Date: Wed, 12 Jul 2023 09:50:19 -0700 From: Christoph Hellwig To: Zhang Shurong Cc: song@kernel.org, linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] md: fix potential OOB in multipath_remove_disk() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Thu, Jul 13, 2023 at 12:46:05AM +0800, Zhang Shurong wrote: > If rddev->raid_disk is greater than mddev->raid_disks, there will be > an out-of-bounds in multipath_remove_disk. We have already found > similar reports as follows: > > 1) commit d17f744e883b ("md-raid10: fix KASAN warning") > 2) commit 1ebc2cec0b7d ("dm raid: fix KASAN warning in raid5_remove_disk") > > Fix this bug by checking whether the "number" variable is > valid. I think it might just be time to finally dropped the deprecated md multipath code instead..