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 A7CC9C4332F for ; Mon, 6 Nov 2023 15:16:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232033AbjKFPQc (ORCPT ); Mon, 6 Nov 2023 10:16:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229839AbjKFPQc (ORCPT ); Mon, 6 Nov 2023 10:16:32 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 876DAD8; Mon, 6 Nov 2023 07:16:29 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC322C433C8; Mon, 6 Nov 2023 15:16:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699283789; bh=zDZFduCEDJmeuVjp8rHp1YK3z18DtyX3wrd2wnaF+Bs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qMMyAp8P8d1YZR+ToLbBSMxg7E0h+nAM09J8k36AJrgWT3pLgMKJv3rUJwYZoBC+5 /7HcfewbvKZBV+XxkAhBXKfAMpJI5v88gc4Hx8N8Z+ws3elm72tPTVmOM+mru/Ax7o hgKcBnrkjrOwDRP6ZT7ROB1Yw66jbjLQJ8E14gCmpX61VhuiBziDh0K7mRiqlcqPKr f2Apj/1uFkrm0Y9QqXxL4Y0uZAXlZ2WeCIdMR3xorlstgRMc5NC4/sI8S+JkZDghFD iwus793QJkToU2FLLBik2jgcjMG6YyKIg5FBdgreEw23GWddN78m4uMrF2NWf2K1cn BhSHwanj5lm1w== Date: Mon, 6 Nov 2023 16:16:16 +0100 From: Christian Brauner To: Paolo Bonzini Cc: Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Sean Christopherson , Alexander Viro , "Matthew Wilcox (Oracle)" , Andrew Morton , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Xiaoyao Li , Xu Yilun , Chao Peng , Fuad Tabba , Jarkko Sakkinen , Anish Moorthy , David Matlack , Yu Zhang , Isaku Yamahata , =?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?= , Vlastimil Babka , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A. Shutemov" Subject: Re: [PATCH 14/34] fs: Rename anon_inode_getfile_secure() and anon_inode_getfd_secure() Message-ID: <20231106-kondor-anfahren-23157efabaef@brauner> References: <20231105163040.14904-1-pbonzini@redhat.com> <20231105163040.14904-15-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231105163040.14904-15-pbonzini@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org On Sun, Nov 05, 2023 at 05:30:17PM +0100, Paolo Bonzini wrote: > The call to the inode_init_security_anon() LSM hook is not the sole > reason to use anon_inode_getfile_secure() or anon_inode_getfd_secure(). > For example, the functions also allow one to create a file with non-zero > size, without needing a full-blown filesystem. In this case, you don't > need a "secure" version, just unique inodes; the current name of the > functions is confusing and does not explain well the difference with > the more "standard" anon_inode_getfile() and anon_inode_getfd(). > > Of course, there is another side of the coin; neither io_uring nor > userfaultfd strictly speaking need distinct inodes, and it is not > that clear anymore that anon_inode_create_get{file,fd}() allow the LSM > to intercept and block the inode's creation. If one was so inclined, > anon_inode_getfile_secure() and anon_inode_getfd_secure() could be kept, > using the shared inode or a new one depending on CONFIG_SECURITY. > However, this is probably overkill, and potentially a cause of bugs in > different configurations. Therefore, just add a comment to io_uring > and userfaultfd explaining the choice of the function. > > While at it, remove the export for what is now anon_inode_create_getfd(). > There is no in-tree module that uses it, and the old name is gone anyway. That's great, thanks. > If anybody actually needs the symbol, they can ask or they can just use > anon_inode_create_getfile(), which will be exported very soon for use > in KVM. > > Suggested-by: Christian Brauner > Signed-off-by: Paolo Bonzini > --- Looks good to me, Reviewed-by: Christian Brauner