Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp15531925rwb; Mon, 28 Nov 2022 12:46:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf4JrwL+tHWN719D7tL5NaWZBiVzoGQ1Y74LabBcQ490o2XbAzA6FLdVw+J3Tt6efusQ6VEO X-Received: by 2002:a17:906:5052:b0:7a9:6107:572a with SMTP id e18-20020a170906505200b007a96107572amr45685038ejk.729.1669668390754; Mon, 28 Nov 2022 12:46:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669668390; cv=none; d=google.com; s=arc-20160816; b=F4GhgZzP+qVzspuRCeGfIjXze5sEJq1qfqmX1OIchP/NQdehxYUZevnb139d1JQrtH i8bJiMEx4SgEFqD/Oqq2TVogi30DzNk6acfizobN5N3zeUPjqUxDOXd0WR8aWA4vZJwF 5np70PITKLxM6aDRhKxiSNc6IZSy0hSOEYx1i7ujZN0XcGkyF3aif5pQbzn//1gyBNg5 +EErodBpiozXaL4/CzAp0K1KNFpqmycSOJamEvAcxZE0fTi4Vm2+6ubxtVNPhewOgXmu QVjgPajlx/Z3sf8yZ9CRf0hnZVP6/EuS5rOKURJ2GHGVGSCLUqanZE+nX0ozLLzaFA52 /2iQ== 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=pnIQNOAY5vhuqXAYNX8YQgNudtCkLfVvMCmZuAp9r0E=; b=g0b0xRrp6Jzsn0INJoyiyS6ikr4ZV642ImhBnq5axOgA3bxEUe4IJxd1Z0npgJTdw1 vIHCPVM3LPOJRLxcmdqIppjDh15kQt3ci78TmgNlbEpSWgYhMu0PxBjifwKDArnIGwMY ARecJuW6EOxftmF7l7SXsuFoCSu5CXxajMmgd4TkLupeTC48DU00WgPxXNwYqdZe6WsE be+W1LHJdMdYVmdHoDDHCvKiR+S2Tqax2/05HNCNf4hV094j8V+oB7ad6JLU89aXFYPi qThAxGItqpc/g26yrjOzW4VR6gvTiFj3I89d+R3Lc+zC2WfYiAkIVHHcPlhZpANvL9TM orcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mit.edu header.s=outgoing header.b=Rf19edPn; 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 ds5-20020a170907724500b0077a19529760si11129505ejc.65.2022.11.28.12.46.01; Mon, 28 Nov 2022 12:46:30 -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=Rf19edPn; 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 S234228AbiK1Uov (ORCPT + 99 others); Mon, 28 Nov 2022 15:44:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232635AbiK1Uou (ORCPT ); Mon, 28 Nov 2022 15:44:50 -0500 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A69D2E9F3; Mon, 28 Nov 2022 12:44:49 -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 2ASKiJjA009979 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Nov 2022 15:44:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1669668263; bh=pnIQNOAY5vhuqXAYNX8YQgNudtCkLfVvMCmZuAp9r0E=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Rf19edPnUJx8dTG0/rI9l6bTyJ9U7Mp3PrpNwemXd8yEpzei3qiepButayG8JhYqU AU8WjRGHZ8FIO8ISAtR2g0ZtmHCrN9aQih43O16mDvEGaEvtPStm3x/1kfco4JWhyT K8jGKg2sZ6cntVMV2V87lTon4xuzYR2UZNaXiMtcFGMTkbbkoQ+IW7jDEhNiIEfjjE iCTf4ulX59Hg7CbPP5xV3YRjmmGQOPAnNfSPPVvKcoFON71f6X4oMEv7I3shjW+KE4 dYd+5KxxZJfC3PoJ8fBNx/+N3QIWkokZkqLqppGPHSbBqyrLh+Rizdv061V9U0NfWX AYCD60IHa1jCA== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 1C4DF15C3AA6; Mon, 28 Nov 2022 15:44:19 -0500 (EST) Date: Mon, 28 Nov 2022 15:44:19 -0500 From: "Theodore Ts'o" To: "Ritesh Harjani (IBM)" Cc: Jan Kara , Baokun Li , linux-ext4@vger.kernel.org, adilger.kernel@dilger.ca, lczerner@redhat.com, enwlinux@gmail.com, linux-kernel@vger.kernel.org, yi.zhang@huawei.com, yebin10@huawei.com, yukuai3@huawei.com Subject: Re: [PATCH 2/2] ext4: add inode table check in __ext4_get_inode_loc to aovid possible infinite loop Message-ID: References: <20220817132701.3015912-1-libaokun1@huawei.com> <20220817132701.3015912-3-libaokun1@huawei.com> <20220817143138.7krkxzoa3skruiyx@quack3> <20220818144353.q6cq3b7huwkopk5b@riteshh-domain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220818144353.q6cq3b7huwkopk5b@riteshh-domain> 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 Thu, Aug 18, 2022 at 08:13:53PM +0530, Ritesh Harjani (IBM) wrote: > Folding a small patch to implement the simple bound check. Is this the right > approach? > > From: "Ritesh Harjani (IBM)" > Date: Thu, 18 Aug 2022 07:53:58 -0500 > Subject: [RFC] ext4: Add ext4_sb_getblk() wrapper for block bounds checking > > We might need more bounds checking on the block before calling sb_getblk(). > This helper does that and if it is not valid then returns ERR_PTR(-EFSCORRUPTED) > Later we will need to carefully convert the callers to use ext4_sb_getblk() > instead of sb_getblk(). Hey Ritesh, I was going through some old patches and came across this RFC patch. Have you had a chance to polish this up? I don't think I've seen a newer version of this patch, but maybe I missed it. Thanks, - Ted