Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp518784rdb; Thu, 30 Nov 2023 10:37:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJSZFXq5s0PJeQmr1KzRsotrB2a494wMBapiGv7IjaaBcOLzRKyyjOFcHjFc5T3OkfMU5i X-Received: by 2002:a05:6a00:c90:b0:6cd:f75b:a0dd with SMTP id a16-20020a056a000c9000b006cdf75ba0ddmr1154199pfv.21.1701369443234; Thu, 30 Nov 2023 10:37:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701369443; cv=none; d=google.com; s=arc-20160816; b=n8fUkH7o8FBR/cHFG+NdP3dKEFXpCLqlO1A6b242s5qgy6hsGOVfYilt6lI8sC9DcA 0rEA2J7lcyCSnU3U/3Y5zAQR4q5/Fzi1SMllaG0IrVRFidRzK3xuK+hXn9OTtrGFvw3r lAQS3LucMolwNmt5Krr2SPb/Hb8SZEIoBDo0B+qoo8G5ODPxF3dAF8kgRkYJsYdhhRbT eYmvK/R+ZO9ZFE5liJTXwMYTUxdQyWd20DgNpbHbGCUM86gkIbeLB63ukHIo6NGv/5dB SKApexm+dKLVGHHMLY61a0p+jsrha4Ieq+gLMVZKW7MqdKwvFn8CUuVcITRbf1PeXpSg L9bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=kPXCfmMAxbqQxyMucaabmjeI2zK+WyVJ0GgG5IsxqJU=; fh=cxAKa4dOF0wunw10hRWf+FddoF9r6IzmmpRBE6aitjY=; b=w525qE9p2Wpp9++I9pxyu2qxONs1cbXOCAc6TUDRlAeck86xc13OhJjik4mq3sGGuJ 7ociLbtyP60H5uIdbCzIEfWzfjqkkywvH0upqkuIL4zCB77WrNkKEMcPLK4eCZJWVvQy MFYAAKkaqKF7DzzdbvjleiLd6QHJn4rSmNcu/ltUnPe0IWI/6OOII4Z5sFMMWySzF+9B 1MaYT9lieXuOX03eab0i/L4chSkH5Yi33RGlnxEXuJaG5GPzIDF2knwLEB3H6Fim+pw0 8rdC+Omjs/Jy777w7GBy+o5u2WEm6P9mXLtUzzXb9G8x8KDA3EJWhrHz+UqdtkzEROpN WEQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DycJh0SI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id u13-20020a056a00158d00b006b4231ba465si1775178pfk.85.2023.11.30.10.37.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 10:37:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DycJh0SI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 0168A80967AD; Thu, 30 Nov 2023 10:37:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232241AbjK3ShI (ORCPT + 99 others); Thu, 30 Nov 2023 13:37:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230045AbjK3ShH (ORCPT ); Thu, 30 Nov 2023 13:37:07 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8B29C4 for ; Thu, 30 Nov 2023 10:37:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701369432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=kPXCfmMAxbqQxyMucaabmjeI2zK+WyVJ0GgG5IsxqJU=; b=DycJh0SI/0R6D76PrsGvJLM/fUcUoq7HVmpYnKPjS0n3a8EHEo2AcXKRrYGoppnq471nch +aDhzJOnVdetdnpXbAloXyWwzukpn9dZmWzW+9biSxvA/N4a0PK/QKgZjFA7ymOb1lIgHY fpHsP76APCOOsL/PK6gi3xWXSI16djo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-311-8Q7ESA0UNTaYG9qmgH8r8Q-1; Thu, 30 Nov 2023 13:37:07 -0500 X-MC-Unique: 8Q7ESA0UNTaYG9qmgH8r8Q-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 33AD7101A52D; Thu, 30 Nov 2023 18:37:06 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 769A11C060B1; Thu, 30 Nov 2023 18:37:04 +0000 (UTC) From: Florian Weimer To: Tycho Andersen Cc: Christian Brauner , Oleg Nesterov , "Eric W . Biederman" , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Tycho Andersen , mathieu.desnoyers@efficios.com Subject: Re: [RFC 1/3] pidfd: allow pidfd_open() on non-thread-group leaders References: <20231130163946.277502-1-tycho@tycho.pizza> Date: Thu, 30 Nov 2023 19:37:02 +0100 In-Reply-To: <20231130163946.277502-1-tycho@tycho.pizza> (Tycho Andersen's message of "Thu, 30 Nov 2023 09:39:44 -0700") Message-ID: <874jh3t7e9.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 30 Nov 2023 10:37:21 -0800 (PST) * Tycho Andersen: > From: Tycho Andersen > > We are using the pidfd family of syscalls with the seccomp userspace > notifier. When some thread triggers a seccomp notification, we want to do > some things to its context (munge fd tables via pidfd_getfd(), maybe write > to its memory, etc.). However, threads created with ~CLONE_FILES or > ~CLONE_VM mean that we can't use the pidfd family of syscalls for this > purpose, since their fd table or mm are distinct from the thread group > leader's. In this patch, we relax this restriction for pidfd_open(). Does this mean that pidfd_getfd cannot currently be used to get descriptors for a TID if that TID doesn't happen to share its descriptor set with the thread group leader? I'd like to offer a userspace API which allows safe stashing of unreachable file descriptors on a service thread. Cc:ing Mathieu because of our previous discussions? Thanks, Florian