Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9506762rwd; Wed, 21 Jun 2023 08:15:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6NAVqM2PRbclqVnPSfOJDbsJqOn4efE2NhLn2xywG09ZVBYflXlngKhxnOnZ1MEesIbpNV X-Received: by 2002:a05:6808:200e:b0:39a:ab69:778e with SMTP id q14-20020a056808200e00b0039aab69778emr16416306oiw.23.1687360535100; Wed, 21 Jun 2023 08:15:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360535; cv=none; d=google.com; s=arc-20160816; b=SfVnuDyHf/sPw7SC/SIGMXuFPJM5utsBDZ0MFs0pkgJ/c9EUA20mTg4YiNy/blPoMW sCRMsm7KR+4TaCePqW9eR84M9oVxRZqp2QOk/RVkBrGYvW1ewMPz/9uIiQwqBtwCPG7L 8tfJMdQAIs67f7SS52jTRQVaiLhYTMe7OCuLbJxniCDqaaJBxZoGVSce+BMCVebei1AX A916zdkpDzovvKbiI71rEKPr76DULFLvQwp77js4uJE5spleIdEjBA0A4KD7Ncv9s7xB DJEF0Z2EsvseYdRtsimk0rage9TG+GEyv4DqFLJTlAcTs//DMofgHb7ZZkYp/QICISK1 k84w== 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=P/S1P3OMvt32FkOL+BS2zKSFIy8MKzwk7N4UYyercEI=; b=r+AAIBmZXPeSDBenpHrxIFCp+T5YxXK2ZUqXR8nWrBe7TCTHoUZYwJunmyVC8V8GTX 1HkMP9ZHmdf/NSwkpFPSAEIua9z+wq2CdRLDNfLfHks98XxIe2H8qls+aILpng7OkxK8 bKZNs1smO2N+qvnjZ1IKAVpBncPCcfiT6hHJbpEoBCfjxRsuem/Lk5JUF+Z0ybIyKIbp KvtBQuMsBrv2QNW7rOJCWaU5Ji5fCZyxtIpNb0yHsIJBoyYtGjiIUVSnAnUv21o1DPl4 JJAUKWyPOan4L/atB9AwbpSjHfRwNBE3fasqh/VPOm18PlC7BagVGvAouQDwTs0WvFM4 TJyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=1XKsiTjj; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-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 c5-20020a6566c5000000b0054fe7c52b0asi4283488pgw.823.2023.06.21.08.15.15; Wed, 21 Jun 2023 08:15:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=1XKsiTjj; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232724AbjFUO6q (ORCPT + 99 others); Wed, 21 Jun 2023 10:58:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233118AbjFUO60 (ORCPT ); Wed, 21 Jun 2023 10:58:26 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D555D525A; Wed, 21 Jun 2023 07:53:17 -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=P/S1P3OMvt32FkOL+BS2zKSFIy8MKzwk7N4UYyercEI=; b=1XKsiTjjucNPkB1y4htZ+KeKzl ng924PIgrB8Hr7841puBQKkoiIhrehLLPg6c2Dv1uOly/e5ynDFbtmMStFZrDZeaTg3Bj//kj2h79 4glnzbay+OGhzBNoqrRDJJ4SP7c3gt7I3DqWmeluekCMFkhTab6dwyIUYuiGPZ8boj9w8VUYz5FSU 01KchMUfQsa+xkQkXEoPHGHEKMdtVS+DDNyNPCNZyeIDqJrtCujgVslNWWnLANhaGCpqDVNubAaXu b6Hwx130i9rfva2YMz39pnK7/5YNWk+0imh8f8Ndd3qGpwYjsUh5+oeGAp/QataEBzLf2HselRgd2 PDHmAT0w==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1qBzC7-00Es1Y-0C; Wed, 21 Jun 2023 14:52:27 +0000 Date: Wed, 21 Jun 2023 07:52:27 -0700 From: Christoph Hellwig To: Jan Kara Cc: Jens Axboe , linux-block@vger.kernel.org, Christoph Hellwig , linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org Subject: Re: [PATCH 1/2] ext4: Fix crash in ext4_bdev_mark_dead() Message-ID: References: <20230621144354.10915-1-jack@suse.cz> <20230621144744.1580-1-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230621144744.1580-1-jack@suse.cz> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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-ext4@vger.kernel.org On Wed, Jun 21, 2023 at 04:47:42PM +0200, Jan Kara wrote: > ext4_bdev_mark_dead() passes bdev->bd_holder to ext4_force_shutdown() > instead of bdev->bd_super leading to crashes. Fix it. How does this crash? ext4_blkdev_get passes the sb as holder, and I actually tested this code. This is not to be confused with the blkdev_get_by_path in get_tree_bdev, but that never ends up in ext4_bdev_mark_dead.