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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 57E3BC43603 for ; Tue, 17 Dec 2019 03:02:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 34298207FF for ; Tue, 17 Dec 2019 03:02:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726869AbfLQDCc (ORCPT ); Mon, 16 Dec 2019 22:02:32 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:40774 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726446AbfLQDCb (ORCPT ); Mon, 16 Dec 2019 22:02:31 -0500 Received: from [213.220.153.21] (helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ih382-0006OH-Gc; Tue, 17 Dec 2019 03:02:30 +0000 Date: Tue, 17 Dec 2019 04:02:29 +0100 From: Christian Brauner To: Sargun Dhillon Cc: linux-kernel@vger.kernel.org, containers@lists.linux-foundation.org, linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, tycho@tycho.ws, jannh@google.com, cyphar@cyphar.com, oleg@redhat.com, luto@amacapital.net, viro@zeniv.linux.org.uk, gpascutto@mozilla.com, ealvarez@mozilla.com, fweimer@redhat.com, jld@mozilla.com Subject: Re: [PATCH v3 0/4] Add pidfd getfd ioctl (Was Add ptrace get_fd request) Message-ID: <20191217030229.2lcfrdbcc6ynumht@wittgenstein> References: <20191217005842.GA14379@ircssh-2.c.rugged-nimbus-611.internal> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191217005842.GA14379@ircssh-2.c.rugged-nimbus-611.internal> User-Agent: NeoMutt/20180716 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Tue, Dec 17, 2019 at 12:58:45AM +0000, Sargun Dhillon wrote: > This patchset introduces a mechanism to capture file descriptors from other > processes by pidfd and ioctl. Although this can be achieved using I like the idea in general as it's quite useful in general. And also for the seccomp notifier and probably for CRIU too. A few things that crossed my mind. A thing I'm worried about is that this will be a stepping stone for people argue for an fd-replacement feature though I think that fd-injection not replacement might be sufficient. I wonder whether we need to worry about special file descriptors, i.e. anything anon-inode based, or devpts devices but I guess those concerns already apply to ptrace anyway. One more thing, with GETFD it seems useful to me that later we can add a new flag - like I suggested in the previous version - to the seccomp notifier that would allow a caller to request that with each seccomp message received via the notifier ioctl() from the kernel a pidfd is sent along. This would make it quite elegant to get fds for the supervised task. Christian