Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1762754pxu; Thu, 8 Oct 2020 21:50:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpfCqzp7/7b5Y7hSaKCpb/x8X5G/E5B0TY8NVQnYf24Fnb4F47mysUn4hHyVgGk2iIAA3j X-Received: by 2002:a05:6402:d06:: with SMTP id eb6mr12319350edb.289.1602219044164; Thu, 08 Oct 2020 21:50:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602219044; cv=none; d=google.com; s=arc-20160816; b=S2cuzI6vQX3MiqJ/zqY5l/xpHsifGSzPs9R7lwMKGcWxa2LaeXtfENha7b3+6xR9kE tgso3326ocuLRgg4X+s1rHqt7DG7jH8Cs4bKejw0zds9NMwOP8nAufJaWTTp42vzQFXS D3dBuFMmSjcLcq2SVYap99T7Wg5MiR9OgbLxU6qdTsL/DGEFkrwm9RtEEiyGMdyiIlmp HF6JERxr0RpZmO6PdhOeYTNPpdDTZbUi7qeslZ2SXgyxrCEM0U42ahFt8mxHYDWuOd2M F0a9qHFmiAdlPs66/chRNtCKkNnV8VuMpPMkJ4Yy6F7VRSUUUvFYcE+/wmqJTi8CTM6Z VVfA== 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=i+icfI0nHBjkMnJCnNR3AdYEXb4o8ldCWv+phyzUZUk=; b=hhhS1Wsbm5TH9uLWGdw8XaidoSiJHkOiB0XuUYAClHQ1Fu7Pk2Pi2MicVKUld0gDWK RTglP3rSdN3EqpAuNuGdlDxu8mkc1ykqM5zFjMCzdrEItm5q5VIaZ6w4UQdzg5cDyW2j fsuSF32Dhl93cPstGHL0BiL1dQiisFMzVfG95CdlmmAXnWvg7qli3ffLiY0+D8idiVUs SD664L8WvO/uh5yrxa89bsWuiWVQczq/YpThDp5fMiLtC52hjPYrUfd0GBDx9VXmPkpj psWgzzaz04JMrr4j52Rq+a9XjWzWYiFDoONM3mqryqA0+QE/j78uXqnUa6NszFREfnNG cPjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="tLGRqw/c"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr8si110646ejc.671.2020.10.08.21.50.21; Thu, 08 Oct 2020 21:50:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="tLGRqw/c"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731447AbgJIEpW (ORCPT + 99 others); Fri, 9 Oct 2020 00:45:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:38722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729225AbgJIEpW (ORCPT ); Fri, 9 Oct 2020 00:45:22 -0400 Received: from sol.localdomain (172-10-235-113.lightspeed.sntcca.sbcglobal.net [172.10.235.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CF1A12224A; Fri, 9 Oct 2020 04:45:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602218721; bh=bVXxzIKSpfH7ECr3TKrz6YAJfZpJOUC61PsdKmh6low=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tLGRqw/c8l7VleXD9L/rZ3NH1hiMpxaCGwyfM8OUESAor5SHU1IzGEn49FO4VpNJX SwF8MnAjMl8lhBNOy33EtnG1PhrSD3MJ8h9OpQO3/fj39iAz3VzB2qBdgn6OyYKseq j9T6NSBc1NXmWU/rFIhIWcWy6EjH3chjQEmcJo+Q= Date: Thu, 8 Oct 2020 21:45:19 -0700 From: Eric Biggers To: Lokesh Gidra Cc: Alexander Viro , James Morris , Stephen Smalley , Casey Schaufler , "Serge E. Hallyn" , Paul Moore , Eric Paris , Daniel Colascione , Kees Cook , "Eric W. Biederman" , KP Singh , David Howells , Thomas Cedeno , Anders Roxell , Sami Tolvanen , Matthew Garrett , Aaron Goidel , Randy Dunlap , "Joel Fernandes (Google)" , YueHaibing , Christian Brauner , Alexei Starovoitov , Alexey Budankov , Adrian Reber , Aleksa Sarai , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, selinux@vger.kernel.org, kaleshsingh@google.com, calin@google.com, surenb@google.com, nnk@google.com, jeffv@google.com, kernel-team@android.com, Daniel Colascione Subject: Re: [PATCH v9 1/3] Add a new LSM-supporting anonymous inode interface Message-ID: <20201009044519.GC854@sol.localdomain> References: <20200923193324.3090160-1-lokeshgidra@google.com> <20200923193324.3090160-2-lokeshgidra@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200923193324.3090160-2-lokeshgidra@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 23, 2020 at 12:33:22PM -0700, Lokesh Gidra wrote: > +static struct file *_anon_inode_getfile(const char *name, > + const struct file_operations *fops, > + void *priv, int flags, > + const struct inode *context_inode, > + bool secure) > +{ Nit: in Linux kernel code, using double underscore function prefixes is much more common than single underscores. > +/** > + * Like anon_inode_getfd(), but adds the @context_inode argument to > + * allow security modules to control creation of the new file. Once the > + * security module makes the decision, this inode is no longer needed > + * and hence reference to it is not held. > + */ > +int anon_inode_getfd_secure(const char *name, const struct file_operations *fops, > + void *priv, int flags, > + const struct inode *context_inode) > +{ > + return _anon_inode_getfd(name, fops, priv, flags, context_inode, true); > +} > +EXPORT_SYMBOL_GPL(anon_inode_getfd_secure); This new function has two callers, one of which passes context_inode=NULL. But from the comment, it sounds like the purpose of this function is just to add the context_inode argument. So one would expect anon_inode_getfd() to be equivalent to anon_inode_getfd_secure(..., NULL). Apparently, that's not actually the case though. Can you fix the comment to describe what the function actually does? - Eric