From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61D38C00140 for ; Tue, 16 Aug 2022 02:41:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233712AbiHPCk7 (ORCPT ); Mon, 15 Aug 2022 22:40:59 -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 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...