Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3165782rwb; Mon, 15 Aug 2022 19:53:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR5PruJuzsTP0rCrxr6ziZwQo+UBR+/AFgYWfeX2KEwAHFIx501DfR9yXC2BeRPBMW520eMf X-Received: by 2002:a17:907:28c9:b0:730:c053:986f with SMTP id en9-20020a17090728c900b00730c053986fmr11769164ejc.194.1660618409586; Mon, 15 Aug 2022 19:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660618409; cv=none; d=google.com; s=arc-20160816; b=NWkAcEVRj7GvUbkrlwdA6VjXXR89NlAd++RtawUfyC8EyiXh9uVHAtcbzZRjQwzW6q aJUqCjgyJY/89AvO994U66xInext3DoqUOjVZoenFDXF/9VX3Y3gCFSLOxf86+N79zdO p0WHK5/BUAZvFrikf7YYX5/FfQ+kzB0WJkxLfh6nqtpiBISGAqvWt9Xhvd7r14mGMEmc yltvufjVg//kevgA3XaZxjmaDIFQoQJUKVFcDk0HS4wwHU2vdl8JwT5ruNRwoF3GOZVZ a7/nJ8oNZ9erJ6Tljzau2d8plWXHlb6V+X3KYL57u2IQkiy/YhX1xHarywihZ+l/sabK j1tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=jYgL/K8hz07GJiAK21af3KOIMQ0hiyPepA8O+pLBNvg=; b=kxSr2Zvr2Bcku7aNEtuz2yeYOK+wgwD24HBpa7zDsXzj3FSj9nQ3NNeH06i8swLY21 68XEszpsonIoVzjhx2hqdhfIQldKrU4icne2r++zewglSz+nVAC1eIrFUG/i8GlTf+lj nrYL1wkEF1bSTqMo3VoEEQn8j18tOXOYfOiJHKmZ1IQozt0xt79X65hK6ND+s9uJxNyD mthos+O7tT91gY8DS21+pFrb4o+v0Se4WEjvo3Oh2lqeGM3qJMkGv1hzy92qDg2+xmR0 lGEchQrsffnHG+AVT9mlCvYV8rbpJ2HnMJ4qjj20M7xhdl4ogtyfIg+ASO0VM2Ung1EP xKvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=Cr2ibY2f; 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=zeniv.linux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hb32-20020a170907162000b00736ce5254f9si6571857ejc.335.2022.08.15.19.53.03; Mon, 15 Aug 2022 19:53:29 -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=@linux.org.uk header.s=zeniv-20220401 header.b=Cr2ibY2f; 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=zeniv.linux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233677AbiHPCk6 (ORCPT + 99 others); Mon, 15 Aug 2022 22:40:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241687AbiHPCkn (ORCPT ); Mon, 15 Aug 2022 22:40:43 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30BE086054; Mon, 15 Aug 2022 16:04:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=jYgL/K8hz07GJiAK21af3KOIMQ0hiyPepA8O+pLBNvg=; b=Cr2ibY2f3ipwPYhnorMIGpCzis OkyypRYHxZMcLaS1TmKCt0FoLJZKlhHWBHy9ZtXS1cJEHIlhJmT4M6ai9v/Njvp3DngRrGIxCW3+P FpXaHY0gwqKGjnWCBiFml40myGDSCistV8dpo5ukSQJzLn3N1RrSGokCvmER6dw/gYyCIdsr4y9aR TMAuLkutQZPVxj1nUb2iDbIuJ5sx5cXn4OGmDkYh/iTJx96KndAaDqEdRZtIbBnzrcboPDCWlWC/u w4RX9AHXnnBBtdhl2Z5pR07qJLWR82WDfVosJflru3V2IEu1E6m7k2HulPNLFfiG4f8QROUfQPmKp 6R5egiiQ==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oNj87-004qO0-73; Mon, 15 Aug 2022 23:04:19 +0000 Date: Tue, 16 Aug 2022 00:04:19 +0100 From: Al Viro To: Ryusuke Konishi Cc: Andrew Morton , linux-nilfs , LKML , Jiacheng Xu , Mudong Liang Subject: Re: [PATCH] nilfs2: fix use-after-free bug in nilfs_mdt_destroy() Message-ID: References: <20220815175114.23576-1-konishi.ryusuke@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE,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 On Tue, Aug 16, 2022 at 05:34:12AM +0900, Ryusuke Konishi wrote: > Yes, I agree it's better if security_inode_alloc() is moved to the end as > possible in the sense of avoiding similar issues. > But, would that vfs change be safe to backport to stable trees? Yes. > It looks like the error handling for security_inode_alloc() is in the > middle of inode_init_always() for a very long time.. Look at the initializations done after it. The only thing with effects outside of inode itself is (since 2010) an increment of nr_inodes. > If you want to see the impact of the vfs change, I think it's one way > to apply this one in advance. Or if you want to fix it in one step, > I think it's good too. How do you feel about this ? IMO that should go into inode_init_always(), with Cc:stable. If you (or Dongliang Mu, or anybody else) would post such variant with reasonable commit message, I'll pick it into vfs.git and feed to Linus in the next window. E.g. into #work.inode, with that branch being made never-rebased, so that you could pull it into your development branch as soon as it's there...