Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1978711pxj; Wed, 19 May 2021 19:34:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlrAnwm248ZYA2LCszILTDSI2UDs2k2s5CKlgJtfgLhY0TA2FMnbbknsvDrNXfMAM1MjWZ X-Received: by 2002:a02:5d44:: with SMTP id w65mr3052265jaa.15.1621478071476; Wed, 19 May 2021 19:34:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621478071; cv=none; d=google.com; s=arc-20160816; b=Kx4qz4HmsBGMn5E/Y2NTXpmxJJFVb88fuE+alyXohbtZ3BmYYWBU6xttjFeQ5X3ZB+ Cc2X1MVSsp31iyJM4esZUQdkTvBNTn/AsN4sG3dTzohphZNvLTw580iSbv6F1K/xg9bt 82swqCR4gxllljh6CgkGMdf2Shzt6VqqNxFi4b4MOGx8CRq42G2LLTY475QPjQc/dqSr BlBo/HCJoqVbmi3RdSfADNKtGq9YzEDR20o0ZcHUjd7whKuMyRxpWtG4TzGl0LvZgCAe i7uNbuui3nGqCnAOx0t1A7eAZ02VNd5DAPVuBlpzs2ceGpqQ+qKs0WnD11aVwaF01g1x NYLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HMvb0n4LbT0TuR0D9FQ2CMeCBbUPAKGZCz3Dr44PaW0=; b=w2QE3u2Je47Zf9RdpD1qZvsQvgmsbouCelPSTEeQLhzq9x9P+MbNaOKSYUyT68R5+f BFADAwXaiDmg1+MbSDwi1ORJVPtoFeqoH52p68iq1RPIFSF/T08QJntf/nIx/YrEu4kJ b0dJCr9hmdcmuzHR3BTPT1xN/3MRY7DVBuxShYkei+i142C5/ZCA+WJgLhb0n1cQoKJV lmZxKjbPYpmRxRrukQ22Xu9x39K/ILisHvYPsdWB/xxornpOJZ5jH+P5mj8l8SJEPgwS dy3cyqPdY3pVvNkcsdLGRbkUxDJJy1v1rEXbh8EiynEKuNPhl8fBOhBAgNulDXJwS39c g0YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=Txx4en7H; 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 h10si1817411ili.90.2021.05.19.19.34.06; Wed, 19 May 2021 19:34:31 -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=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=Txx4en7H; 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 S230262AbhETCec (ORCPT + 99 others); Wed, 19 May 2021 22:34:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230049AbhETCeY (ORCPT ); Wed, 19 May 2021 22:34:24 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26461C06175F for ; Wed, 19 May 2021 19:29:58 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id w12so9830860edx.1 for ; Wed, 19 May 2021 19:29:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HMvb0n4LbT0TuR0D9FQ2CMeCBbUPAKGZCz3Dr44PaW0=; b=Txx4en7He1hssPu2O0K85osEJQZOh7gSdD0fTc0HK9bfCb4tHcSPL5Vzmbo+HxZeG7 URkI9280Aidu0068F+2W+uFM9mZJXhAmzADK/uBcrE4inPGAc6xCDE//RUM4fSma2JL2 TRZ3uDScXtitVVNjSxFcVatkWzABu9gj6SfwwD2f67V+Dm8GZUa+l5YckeU5nhyJ4LDW rYQftnJ6n7XnGyTKVTt1+fpEwwiijkrkn6b7tJMrxKLyhKQyO3zTkFDHL+S0P2J00drS 3mztBgaPdlwObdd5gZ9XoIDvAiDsAhG5whNcEk1SVLmzj+sbrBkIA3ERcR9ut7kG5eBC aNAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HMvb0n4LbT0TuR0D9FQ2CMeCBbUPAKGZCz3Dr44PaW0=; b=Qm/77nBe82LfSYkyXlrQ7X27+H/sQ+1GRJNqHSolULT9TgHt06j6VUciMDUe295El+ YXNRmMujkVEJSgUOa9C4cV250xZBHr0XfS0xr6+PMHPiA+7pGi1cbAkkNyOwLsR5r99Y /fg6DoH+Zc2gKhWEyvty93+YK2pauX+TiyGiSAWHAiuvW2zWCm1EPi3mt92W1MfurKmI VgxYONFuTyIB4fkKpNr6781SUr1eUxY+v9K/iD8jUcMt9vOjZ37Qyu3Nd+dlAHR4eykg iOssO3nxJ0SazT/EaoIfeXpvkUjh/oiy6nAaB/nMzlBpG8rQAX6nIT6jCOGQIzluEESb tTmw== X-Gm-Message-State: AOAM530s7GyroBG7iH07Nr8NSoz88qcVAhG4VC0Vu+dVfh7OTWHkDSf5 ynSqeG26dWYKi2bv9Uvypd5iqniRBfiqUvgNVCOb X-Received: by 2002:aa7:de9a:: with SMTP id j26mr2395605edv.269.1621477796545; Wed, 19 May 2021 19:29:56 -0700 (PDT) MIME-Version: 1.0 References: <20210519113058.1979817-1-memxor@gmail.com> <20210519113058.1979817-2-memxor@gmail.com> <20210519230710.k3hzomsr27onevhf@apollo> In-Reply-To: <20210519230710.k3hzomsr27onevhf@apollo> From: Paul Moore Date: Wed, 19 May 2021 22:29:45 -0400 Message-ID: Subject: Re: [PATCH 1/2] fs: anon_inodes: export anon_inode_getfile_secure helper To: Kumar Kartikeya Dwivedi Cc: io-uring@vger.kernel.org, Pavel Emelyanov , Alexander Viro , Jens Axboe , Pavel Begunkov , Lokesh Gidra , Eric Biggers , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 19, 2021 at 7:07 PM Kumar Kartikeya Dwivedi wrote: > On Wed, May 19, 2021 at 08:52:51PM IST, Paul Moore wrote: > > On Wed, May 19, 2021 at 7:37 AM 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. > > > > > > Signed-off-by: Kumar Kartikeya Dwivedi > > > --- > > > fs/anon_inodes.c | 9 +++++++++ > > > include/linux/anon_inodes.h | 4 ++++ > > > 2 files changed, 13 insertions(+) > > > > [NOTE: dropping dancol@google as that email is bouncy] > > > > > diff --git a/fs/anon_inodes.c b/fs/anon_inodes.c > > > index a280156138ed..37032786b211 100644 > > > --- a/fs/anon_inodes.c > > > +++ b/fs/anon_inodes.c > > > @@ -148,6 +148,15 @@ struct file *anon_inode_getfile(const char *name, > > > } > > > EXPORT_SYMBOL_GPL(anon_inode_getfile); > > > > This function should have a comment block at the top similar to > > anon_inode_getfile(); in fact you can likely copy-n-paste the bulk of > > it to use as a start. > > > > If you don't want to bother respinning, I've got this exact patch > > (+comments) in my patchset that I'll post later and I'm happy to > > give/share credit if that is important to you. > > > > That'd be great; no credit is fine :). Please CC me when you post it. Will do. I dug out my system which had the patches and I'm working on forward porting them to v5.13-rc2; if I don't have them cleaned up enough for posting by Thursday, I'll make sure they are at least RFC ready by Friday. -- paul moore www.paul-moore.com