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 D039CC433C1 for ; Wed, 31 Mar 2021 12:24:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 97A3D61957 for ; Wed, 31 Mar 2021 12:24:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235286AbhCaMXz (ORCPT ); Wed, 31 Mar 2021 08:23:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:36924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235347AbhCaMXY (ORCPT ); Wed, 31 Mar 2021 08:23:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 20F7F61957; Wed, 31 Mar 2021 12:23:17 +0000 (UTC) Date: Wed, 31 Mar 2021 14:23:15 +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: <20210331122315.uas3n44vgxz5z5io@wittgenstein> References: <20210331080519.172-1-xieyongji@bytedance.com> <20210331080519.172-2-xieyongji@bytedance.com> <20210331091545.lr572rwpyvrnji3w@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 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. I don't think that needs to hinder reviewing your series though. Christian