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=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, 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 ABD2DC4320E for ; Tue, 3 Aug 2021 09:02:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 91D3F60C3F for ; Tue, 3 Aug 2021 09:02:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234977AbhHCJCZ (ORCPT ); Tue, 3 Aug 2021 05:02:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234699AbhHCJCU (ORCPT ); Tue, 3 Aug 2021 05:02:20 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E1AAC0613D5 for ; Tue, 3 Aug 2021 02:02:09 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id p21so28063408edi.9 for ; Tue, 03 Aug 2021 02:02:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=3wZFhZTC8zZY+D9UvhMcL30+qrKHqoBqQtpm1vOADzM=; b=JKe8MBo/Q/9jJiWfNFv7/6FozVELAtit9lfH9d5TxXXMYzq/K+Pmkq5MZfy0MK2cFu cx6FhhWxNDc+0E1xzGVvot63Tu4Ur8FkAtBApXV5HGWA7B6YAue4z52aDqp2cPeuObcM NbvLlt0iETqmIH/loBFX6RmK5lnhTeVCMIO5KKZH9Z5CWgGXEldHbQTMQQrf9uJEnfFB 86l/PEM0xk2vAai/1RJXq5azCxa1fJfFP2bTdkelMNkruzkW1VP4XZZrR/YihWu8I9cm wPq3kJhM7XQVmw7qPL2HCPQ0a2PjgZxJc4l7AroO/DlUf8xZiD0v/CMDlg12kwVoA4f6 XDfQ== 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:content-transfer-encoding; bh=3wZFhZTC8zZY+D9UvhMcL30+qrKHqoBqQtpm1vOADzM=; b=Rt0ABDrjzCumNalEis2mgSatF77jDnegPX3MlCyDFdpH5+5uj/nYVVTRGqc+n6Ao/q ib7gRTppH5HJITO1MvNAEgPmpycIyD3YFWdW1q2uLF9Z6a8av0JARzsPKLOSCl5m+qiO vL77nxgwHX3jl3FBl2KH3Sxz2hMiz3dqHXYS3u6XBB/GU7kMkMwMlRuV+YffEB/HTZIQ dqQpHJweDQmkKHH8VwuMUgrLNi/Ak+wHhCiJhrRXHpD6BLKAyMf4HR0VAqn1wbPjcBTD PNV1NY45upRpiG5esw7dEJSXReMiMGWoTr+wNIPR1sPFWq1zMtNXUgNVVvhR9bp3NNtX Q41g== X-Gm-Message-State: AOAM533hJs08kycwj0mDlgPWXk2zVsCwCcG6BLR5DMVj+zXXpFSGXBJQ P4tz6JjsSgB3aKHV6AFeYR0F43NVGuo48huv+pMc X-Google-Smtp-Source: ABdhPJyS6bOrWfuvjmdwVRGONpMTv6Y0zVE0kh7I9sjtSTBg5XbDmv85P6yS8Pkoi3kNsB54rx4AF9ZFKn4Qu8vMSM8= X-Received: by 2002:aa7:c50a:: with SMTP id o10mr23739559edq.118.1627981328237; Tue, 03 Aug 2021 02:02:08 -0700 (PDT) MIME-Version: 1.0 References: <20210729073503.187-1-xieyongji@bytedance.com> <20210729073503.187-3-xieyongji@bytedance.com> In-Reply-To: From: Yongji Xie Date: Tue, 3 Aug 2021 17:01:57 +0800 Message-ID: Subject: Re: [PATCH v10 02/17] file: Export receive_fd() to modules To: Jason Wang Cc: "Michael S. Tsirkin" , Stefan Hajnoczi , Stefano Garzarella , Parav Pandit , Christoph Hellwig , Christian Brauner , Randy Dunlap , Matthew Wilcox , Al Viro , Jens Axboe , bcrl@kvack.org, Jonathan Corbet , =?UTF-8?Q?Mika_Penttil=C3=A4?= , Dan Carpenter , joro@8bytes.org, Greg KH , He Zhe , Liu Xiaodong , Joe Perches , songmuchun@bytedance.com, virtualization , netdev@vger.kernel.org, kvm , linux-fsdevel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Aug 3, 2021 at 3:46 PM Jason Wang wrote: > > > =E5=9C=A8 2021/7/29 =E4=B8=8B=E5=8D=883:34, Xie Yongji =E5=86=99=E9=81=93= : > > 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 > > --- > > fs/file.c | 6 ++++++ > > include/linux/file.h | 7 +++---- > > 2 files changed, 9 insertions(+), 4 deletions(-) > > > > diff --git a/fs/file.c b/fs/file.c > > index 86dc9956af32..210e540672aa 100644 > > --- a/fs/file.c > > +++ b/fs/file.c > > @@ -1134,6 +1134,12 @@ int receive_fd_replace(int new_fd, struct file *= file, unsigned int o_flags) > > return new_fd; > > } > > > > +int receive_fd(struct file *file, unsigned int o_flags) > > +{ > > + return __receive_fd(file, NULL, o_flags); > > > Any reason that receive_fd_user() can live in the file.h? > Since no modules use it. Thanks, Yongji