Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp15670308rwb; Mon, 28 Nov 2022 14:42:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf6peSkiGT4aVhOI2khOMih2VgmOWOdGAj3XC1h/2f73a8/ohOexm1CJMa1m1gcG6yenuiGI X-Received: by 2002:a17:902:ce8e:b0:174:b537:266d with SMTP id f14-20020a170902ce8e00b00174b537266dmr33825658plg.144.1669675351306; Mon, 28 Nov 2022 14:42:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669675351; cv=none; d=google.com; s=arc-20160816; b=hu4dKxDpFQRCEKyr6oZX7jG1uSOUwW+HJ4WT94AVzHsdQiQRWs0IBw8+m59WKwMR83 aAqK/hSmIecgT0XAuuCts/NZOoizeNUw03a6bKrer5W6acl6X7cxIbkx+RECZ9bEPEiV 7rwU5+6BAolmAEmLKeIZAXl+OO7FcXmGnMIWSmqyy4Sxo1D+T7lgxBBSqUmKvwXcfqDh Sr1DyU9+4rQC6jf3wedWchvhRmTDxHwVhK6Q0pV2soZ6KJqWi+Tou54hCaVNOcur/46V 6XeDSIKDQSPkU+t5Kxkkjio4DEnN01GQIVONVr1QI52rSTnNPBDIeYMvyrt9kTYj1j+Q VGZw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=93sV9uF9firD2I2yjs8f7J69JyRyRKxsZzFKTMgpo+Q=; b=kE2VSD9WPrSlMPj2MjX3l6tgPlqNloshHZpVV1zBU1JnHQgDCAi1/Tdw+7d4pXPICT lfNgl62ieGZaf3NkgzszsxumN1dOJF6rXFec4g+vo0TAAEq/+D2W1uHANI6roIXmumo0 zXutPPHMQWM+BJzwkBpTHmYexk812PfBM+XJHA86XkqKUW4UrxXxTuzKznU8NXFgydqG w4Z8tV9q3cTR03/nr+6chojqANaXnz+rHsI8uzuxMePZ9XNyD7a24i4UF2+4rv+dLevZ NciaoyHCx+oOfU5ISFuaWIOtSyem+lhHHfQexjT5/9gay9beu2cnnln0FL1X1j3twctn LhXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mit.edu header.s=outgoing header.b=pwBmEyO3; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id iw22-20020a170903045600b001869de3edcasi12363600plb.466.2022.11.28.14.42.15; Mon, 28 Nov 2022 14:42:31 -0800 (PST) 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=fail header.i=@mit.edu header.s=outgoing header.b=pwBmEyO3; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232141AbiK1W2N (ORCPT + 99 others); Mon, 28 Nov 2022 17:28:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233660AbiK1W2M (ORCPT ); Mon, 28 Nov 2022 17:28:12 -0500 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E80EA24B; Mon, 28 Nov 2022 14:28:10 -0800 (PST) Received: from cwcc.thunk.org (pool-173-48-120-46.bstnma.fios.verizon.net [173.48.120.46]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 2ASMS3cc017750 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Nov 2022 17:28:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1669674485; bh=93sV9uF9firD2I2yjs8f7J69JyRyRKxsZzFKTMgpo+Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=pwBmEyO3XgD1rsAnMLjxB8wVG7geyPSPxRrNfE517cO/ImMwSo8wZc5Ca/oUVIKTw 5Y0AAlgYv43YPCIDnPmLu8I+FGroQijVrpq6VG0mhr75lgbLLQHtQGCdoaUihSrls5 KGU8CxwwRLVaQoqwhdG66gZDhdRE5Uh48aIjOt3HhVQwwkiatU8LGRfViX0l8QCyGy ELbAawK9dCLowX8lMWiyMCDRb2Dpr3MsJqB8ufcGF3I01tjF1eBB8G1NNjVdU0AwNg rUlYXFM8/NPONr+zJW0McAH49cZYiR/STAXsWRDpPhTN7RO7uMsIoC1jxkY+qjoW/m 2dhe0FDZ4Uypg== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 42D2615C3AA6; Mon, 28 Nov 2022 17:28:03 -0500 (EST) Date: Mon, 28 Nov 2022 17:28:03 -0500 From: "Theodore Ts'o" To: =?iso-8859-1?Q?Lu=EDs?= Henriques Cc: Andreas Dilger , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2] ext4: fix a NULL pointer when validating an inode bitmap Message-ID: References: <20221010142035.2051-1-lhenriques@suse.de> <20221011155623.14840-1-lhenriques@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE 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 Tue, Nov 08, 2022 at 02:06:29PM +0000, Lu?s Henriques wrote: > > What makes you believe that? Look at how s_group_info is initialized > > in ext4_mb_alloc_groupinfo() in fs/ext4/mballoc.c. It's pretty > > careful to make sure this is not the case. > > Right. I may be missing something, but I don't think we get that far. > __ext4_fill_super() will first call ext4_setup_system_zone() (which is > where this bug occurs) and only after that ext4_mb_init() will be invoked > (which is where ext4_mb_alloc_groupinfo() will eventually be called). I finally got around to taking a closer look at this, and I have a much better understandign of what is going on. For more details, and a suggested fix, please see: https://bugzilla.kernel.org/show_bug.cgi?id=216541#c1 - Ted