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 X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFE90C43460 for ; Wed, 31 Mar 2021 14:09:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8868560FE6 for ; Wed, 31 Mar 2021 14:09:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235958AbhCaOIj (ORCPT ); Wed, 31 Mar 2021 10:08:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:54760 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235114AbhCaOII (ORCPT ); Wed, 31 Mar 2021 10:08:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C45B860FE4; Wed, 31 Mar 2021 14:08:02 +0000 (UTC) Date: Wed, 31 Mar 2021 16:07:59 +0200 From: Christian Brauner To: Yongji Xie Cc: Christoph Hellwig , "Michael S. Tsirkin" , Jason Wang , Stefan Hajnoczi , Stefano Garzarella , Parav Pandit , Christian Brauner , Randy Dunlap , Matthew Wilcox , viro@zeniv.linux.org.uk, Jens Axboe , bcrl@kvack.org, Jonathan Corbet , Mika =?utf-8?B?UGVudHRpbMOk?= , Dan Carpenter , virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, kvm@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v6 01/10] file: Export receive_fd() to modules Message-ID: <20210331140759.rxfpfcavzus3lomp@wittgenstein> References: <20210331080519.172-1-xieyongji@bytedance.com> <20210331080519.172-2-xieyongji@bytedance.com> <20210331091545.lr572rwpyvrnji3w@wittgenstein> <20210331122315.uas3n44vgxz5z5io@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Mar 31, 2021 at 09:59:07PM +0800, Yongji Xie wrote: > On Wed, Mar 31, 2021 at 8:23 PM Christian Brauner > wrote: > > > > On Wed, Mar 31, 2021 at 07:32:33PM +0800, Yongji Xie wrote: > > > On Wed, Mar 31, 2021 at 5:15 PM Christian Brauner > > > wrote: > > > > > > > > On Wed, Mar 31, 2021 at 04:05:10PM +0800, Xie Yongji wrote: > > > > > Export receive_fd() so that some modules can use > > > > > it to pass file descriptor between processes without > > > > > missing any security stuffs. > > > > > > > > > > Signed-off-by: Xie Yongji > > > > > --- > > > > > > > > Yeah, as I said in the other mail I'd be comfortable with exposing just > > > > this variant of the helper. > > > > > > Thanks, I got it now. > > > > > > > Maybe this should be a separate patch bundled together with Christoph's > > > > patch to split parts of receive_fd() into a separate helper. > > > > > > Do we need to add the seccomp notifier into the separate helper? In > > > our case, the file passed to the separate helper is from another > > > process. > > > > Not sure what you mean. Christoph has proposed > > https://lore.kernel.org/linux-fsdevel/20210325082209.1067987-2-hch@lst.de > > I was just saying that if we think this patch is useful we might bundle > > it together with the > > EXPORT_SYMBOL(receive_fd) > > part here, convert all drivers that currently open-code get_unused_fd() > > + fd_install() to use receive_fd(), and make this a separate patchset. > > > > Yes, I see. We can split the parts (get_unused_fd() + fd_install()) of > receive_fd() into a separate helper and convert all drivers to use > that. What I mean is that I also would like to use > security_file_receive() in my modules. So I'm not sure if it's ok to > add security_file_receive() into the separate helper. Or do I need to > export security_file_receive() separately? I think I confused you which is my bad. What you do here is - in my opinion - correct. I'm just saying that exporting receive_fd() allows further cleanups and your export here could go on top of Christoph's change in a separate series. Christian