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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5155C4167D for ; Mon, 6 Nov 2023 15:16:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 44D878D001F; Mon, 6 Nov 2023 10:16:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3FDA48D0002; Mon, 6 Nov 2023 10:16:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 29F058D001F; Mon, 6 Nov 2023 10:16:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 1BC748D0002 for ; Mon, 6 Nov 2023 10:16:34 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id D15831CAD3A for ; Mon, 6 Nov 2023 15:16:33 +0000 (UTC) X-FDA: 81427881066.25.F53D47E Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf14.hostedemail.com (Postfix) with ESMTP id B9E0710001A for ; Mon, 6 Nov 2023 15:16:30 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=qMMyAp8P; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf14.hostedemail.com: domain of brauner@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=brauner@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1699283790; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=0I5wvaTYS4rqXi3wybv4PEn6Qv91mt9QiDiz+dRtV3M=; b=0ot6ITU9kn7HnXF4W3RfY5V2/YLZntRj3cFO6zPfpyX/lbJRIJ1HxxdyH35ZjY0DIyWIt0 BlgO2SH0dliNlZdjVV7Oc4R+E9vcr0xujTEbb7oaTDzLDO9a2ONL68ZlxS8WhheVBhe2V2 pXPBtyazTPiE5rR/lA0TbO914yVhCUY= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=qMMyAp8P; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf14.hostedemail.com: domain of brauner@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=brauner@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1699283790; a=rsa-sha256; cv=none; b=TvQ7LiQtgvTmHp0MeD5gaKruCLA1EqMU5HMvtzzvKXKcRcHy3tSQovmBJk031HyzbDW/Om YZ647ltgQtWSWC5IypRHAiiJgKXSPAXPgRD8QJzshVPveFCH/iZV6GKUj6Afj894a6YUmE z9SYu9wP9lH9vrpf9l5fWqJfF6wgANc= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 750E260DDA; Mon, 6 Nov 2023 15:16:29 +0000 (UTC) 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> X-Rspamd-Queue-Id: B9E0710001A X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 9qwz8m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Xc1XWhdGvM52zKsh4pzjLfy2PV+F9wLJWtz0C19ajUhHjnl6OWvMRwGDG4F/I4Z91u7rXiE0KoYpnT2HxQBmuy3B9g11ggDMMz/tPntNO0+a4h4N6AaQ9S5eLko836uCNyrOT0AYXwPulVcZSvg1NlI9C8JFssVJ3Izi436C2ZwWEd5wt0Jtwt+aasSj6kvJBVl9oywNDAfBX0M/c2Z9Bw4eKm+OiTg5gPe9v3TmmOmyLppl0m2Sxnv6DciblrymYwcBo0IHAWtuHaHbUrVMjRzFz/QDwNN6SQaA5qhDknOhgNBIiZXxZYRxOX9lZfACkGhctdMhyT9JdbvdhaXk7csnx7A15z/TvU8EbRco X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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