Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2192089rdf; Mon, 6 Nov 2023 07:16:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IFMoaYAO//ZPxMlzXb3BT4wo1366zi/tBPNBJL1J2ogR4YRkjIkShom3TXcf3EKNQ7qOdN8 X-Received: by 2002:a05:6a20:728e:b0:14c:daa9:5e22 with SMTP id o14-20020a056a20728e00b0014cdaa95e22mr35234984pzk.45.1699283801536; Mon, 06 Nov 2023 07:16:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699283801; cv=none; d=google.com; s=arc-20160816; b=UWZl2NXr0In23xHYjGpyEAON73+VP5EJIePtkdW/8cLn2giavYqsi0SGn/gYx0aj1x T2CJ1/eDEd477r7huAW0749i46twzVRccmnoqLyda1Zl9tMz61dCk1zw9K3r/jCwa8QW DUwzIs9QFvBh+BG3FImBE2r09pXw5Fwei64Ugii3yvKCPw/cTDhmg2T4QM7Rc4NHxN0y I+dEgkV7mWzleIrTogsY0U9KMKacDT1Oio+2ezgERqpsWNkK80odK8SwXkucqKzndz54 QOYq1pzeT18fbvKjkgfXX3DWEhviohUa/k+Jo8S8mAOImToX3jjVNWP/thTFk8AnqiwP u2xQ== 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=0I5wvaTYS4rqXi3wybv4PEn6Qv91mt9QiDiz+dRtV3M=; fh=rFHQoWdJlxCq6O9xoXPZt9d2SfhK27hMHml6YF0+8fE=; b=g7mas+Z3ZW4r+viAZLktYTfh8CKYwRVDhNCl2p+VEufPqlo6EAwvlwTrQgkM2FMBZg kcUc1sKIc9SQ/VnaaB3wAVTXHU5oye9X+KqnLfRILoIp9eiRl11hptGXh4N1DJqqUz2a T4G3fiuCsu5tYphT4tPenjOzmpNQEvCBMq9KbiFGEwu1h+S9AxYGa6qF7mZvgmjqViWY cXn9UmfJHYwph1/EQrS9xjmiqaFGinVCo1flchrD5uicYVnKQCy6KqV893RGsb2lgKig euhb+Gy6sYGzkeJKj1rvGbi2rHRavy/ee8HHyowy5S6dQpgWVtHjyP1BSbJS6nnZGReb d5kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qMMyAp8P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id 78-20020a630151000000b005895c80c902si7733998pgb.438.2023.11.06.07.16.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 07:16:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qMMyAp8P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id D2B4780267F6; Mon, 6 Nov 2023 07:16:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232088AbjKFPQd (ORCPT + 99 others); Mon, 6 Nov 2023 10:16:33 -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> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 06 Nov 2023 07:16:35 -0800 (PST) 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