Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1758785pxj; Wed, 19 May 2021 13:14:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwklsHNk6eerQr8CWhAToYid9ZL53F3I6NdKarS5kOrx4ui0F5aC79/t4qsR55yhWjTlCiX X-Received: by 2002:a05:6e02:12c5:: with SMTP id i5mr958334ilm.101.1621455276922; Wed, 19 May 2021 13:14:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621455276; cv=none; d=google.com; s=arc-20160816; b=QczGB77CuTUSrVAZnA1WOanWqjlfpq3BPfiiZqPBU4fmLfv7AgrfRw1mOHJFAbubgg oKZ9wiQWq+wNMg5TLf6fLh3NiaWdZAe0Ak2VasTktkPpfQnpBt2OKWj1ECUSA6+6CfxW KSKoyjAX7f8Kggf+KLt4tGxwH5yukmZLLCooQUlCU6C9icNXw7Nmaa5zmQrSfeuVKZco pU3nKkHQLK9fbR19NtKlL3bUlX/2QOKEGjfS1hzWkddl0v/i2kAjCWLnAJilzMQzE5Sb 2f7tNUN7b8lmgHUI/5cKRzQ0I4rTV+/wmIeSKGM5ua5eVARaI84SItaJBLpEN34feX5q 0qzQ== 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=xrYJbsm8XBvxi2yJ2qA9P43iIK0MPL7ZBIPpUfmicR0=; b=wksrEn40MLv3ivVpLWuPIvMbqBhhiTb1/pTKtHabNeofNsFIJwZr3BOoTibLy6icRK Ly0Uz6Nt2asVFFf4SWjnJUd/wY7worRDL15WYBN5XMlk5Bde7NoL8gm91dffXTHmdDm+ Uqdl2BBtinluEADNk/h3CXk4f8/f2PHliVKly1i9IhoH1OH0ougMAOXWXWPs9rVnUiAG n5bNlCrrOP1bDr9yyRUO7uPy0if3kWjAz89pqr5/YjJ/pJBHwfDNCJluuFA35Sr3xvp5 UK4ar1A3y4KN2X/2OTstI11187zaOkxiX2dgD9jzacgRSVyexr7zkXINRp/nhDE8nxfx FqQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=UFiocZpE; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 15si740994ilz.158.2021.05.19.13.14.24; Wed, 19 May 2021 13:14:36 -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=@infradead.org header.s=casper.20170209 header.b=UFiocZpE; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347083AbhESQGi (ORCPT + 99 others); Wed, 19 May 2021 12:06:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241402AbhESQGh (ORCPT ); Wed, 19 May 2021 12:06:37 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 328A8C06175F; Wed, 19 May 2021 09:05:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=xrYJbsm8XBvxi2yJ2qA9P43iIK0MPL7ZBIPpUfmicR0=; b=UFiocZpEd3n0qwbyeyoV48fzYM ZFY9/8N316MM8Ud/2P+STmeC0wK7OTD6v6uAhET6jaNjDWMfkYUdgXHsJiiXNE11Pkz5AdmMI+Nnw ZE25efNjaV+QXKBiyY2q40cvtNPTtOub9gCPwbn2OkVCdy64hM4Sce6UNpRGS2e9DCTE7/n6siwLM ASudhgIGnA9gSqB75xsnb4Lpxy0FVcEgnDL3WuVawFbb8MMXWm1NSr5y80xCKM/cY06qmiGvnfDFd qa24+rJkiM6OdbVbxZFz+8X90INBFbsTS7BQHmsAqClSrfLD9sZrv80eq0a1wwTarWWS9dE7rBIWp HEUAwZLg==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1ljOgr-00F6Rg-0g; Wed, 19 May 2021 16:05:02 +0000 Date: Wed, 19 May 2021 17:04:57 +0100 From: Christoph Hellwig To: Kumar Kartikeya Dwivedi Cc: io-uring@vger.kernel.org, Pavel Emelyanov , Alexander Viro , Jens Axboe , Pavel Begunkov , Lokesh Gidra , Eric Biggers , Paul Moore , Daniel Colascione , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] fs: anon_inodes: export anon_inode_getfile_secure helper Message-ID: References: <20210519113058.1979817-1-memxor@gmail.com> <20210519113058.1979817-2-memxor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210519113058.1979817-2-memxor@gmail.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 19, 2021 at 05:00:56PM +0530, Kumar Kartikeya Dwivedi wrote: > This is the non-fd installing analogue of anon_inode_getfd_secure. In > addition to allowing LSMs to attach policy to the distinct inode, this > is also needed for checkpoint restore of an io_uring instance where a > mapped region needs to mapped back to the io_uring fd by CRIU. This is > currently not possible as all anon_inodes share a single inode. No need to export it, as io_uring can't be built modular. > +struct file *anon_inode_getfile_secure(const char *name, > + const struct file_operations *fops, > + void *priv, int flags, > + const struct inode *context_inode) > +{ > + return __anon_inode_getfile(name, fops, priv, flags, context_inode, true); > +} > +EXPORT_SYMBOL_GPL(anon_inode_getfile_secure); Please avoid the overly long line here.