Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp431240rdb; Sat, 27 Jan 2024 12:45:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGxQ7gr4XZO2ym3B0v9I0w36Oa9l0Jy5cWxyYfB39Tdg63f+VLJ2AyhUO+ipA8hgyBpcLnb X-Received: by 2002:a17:906:1115:b0:a2e:3a19:f20e with SMTP id h21-20020a170906111500b00a2e3a19f20emr1702609eja.64.1706388309299; Sat, 27 Jan 2024 12:45:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706388309; cv=pass; d=google.com; s=arc-20160816; b=zM/FrAJDEMlln0FJ0vZ23vN4/sDcdMMga+QHNrZVivMzoy3sISoRkmIqHIinixiWqW b/6J1NETzv27qidEzMP7ruao9saR2bQhMs7QQgxktFkB8lcR0JnLigBUVm1B+Etdpk+L L2Ap/TElRRN2XlRuuzfxRik8LxB/nCw+URofYl2WnI35/cjFbbcc0xVRSTtnSOzNgi8O ZoSezst6zAI+v8iR0ZsSdNeWvUplJC9JKv3JBA2Vf13LDLAMSZIMuY4sl3V3yS105voK TBlzalUs3bZ6tt6ZqQv6UvYWNO8XRIUweQAamuaMEElUOMSw9pQ1VtDaJNgiUaAh9Pqx /TDA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:feedback-id:dkim-signature:dkim-signature; bh=zv9FvXgF0sl4GXfUior97oaoRJoStoToMU42/qGdfcY=; fh=+pQQVWC6LKwXuTBmhlwvzqB5oDujtV1dR/Djy78dDYY=; b=Y6+vTfQI//zX3gIOtIDIyurWqfTmPciHJuAyhm8Tbr3EmRJpQ/e7GkJAoO2eio2jeB dEmQQZpTULKHRbMEP6D+WqsCt7FVo5YA6uHdjL2PKOqbMlc4NSq1e71TWOcu+sCrdCfF 0vK5DtwtM1yRuQSOxBGovolYrkCaKjglIfK7i/5uwkIePHTnAhXj61DxUlrEhQzwViXs XPigMFDXRFLHxhTDBXKsY3PId9PLlqHaQ+rLdKd6XkodvI/ncRYO5o+A2iUINMbUh5sv tsynhM+3KktW364lxHlQUt0qSUObGWMdahOGrKEBDiHJdtt9qfW9eTA1hkZ1k2g90yDb 1dQA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tycho.pizza header.s=fm2 header.b=T8q5Kipo; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=cufab6Lv; arc=pass (i=1 spf=pass spfdomain=tycho.pizza dkim=pass dkdomain=tycho.pizza dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-41393-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41393-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i22-20020a170906115600b00a351b9601b9si1392910eja.981.2024.01.27.12.45.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jan 2024 12:45:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41393-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@tycho.pizza header.s=fm2 header.b=T8q5Kipo; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=cufab6Lv; arc=pass (i=1 spf=pass spfdomain=tycho.pizza dkim=pass dkdomain=tycho.pizza dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-41393-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41393-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E74451F22905 for ; Sat, 27 Jan 2024 20:45:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 226191774B; Sat, 27 Jan 2024 20:45:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tycho.pizza header.i=@tycho.pizza header.b="T8q5Kipo"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="cufab6Lv" Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C7F4E14A9D; Sat, 27 Jan 2024 20:44:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.111.4.29 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706388300; cv=none; b=FqsodCCzV/BnmZ5f6z0r/Vp+mqn2TU5mRcZwqopl48SKfS7WJzZVZ5f3VrmD7c21syNQQ+AgK0BSl5sHqXNhIX0ifVmHl2q4mUZy7ohqL9hKDorjpKEBWt+KlvMYSX5R9xCBvfYNcnCKy4OEXQIq8kdymPbnPmAGP7eIjQIIovs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706388300; c=relaxed/simple; bh=7fJpC/F/2yX3YmpRJYR6iszdXsodW2fvEPdYddjhJBA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aofmZQjMrafK63J42jkSpquapmWE0HdC3yVolxQj6oMDBJ9NPFZfyEmSgvdqXR21iST3p6dV81ZYQBsesNPH+yHhAKglqCq9licbkx4SIG03us9R+Yi69ceFqUEwfU/643jcajH22D4QzoENPmxcaJ/UR7aN5V0MKESmQkiUzm0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tycho.pizza; spf=pass smtp.mailfrom=tycho.pizza; dkim=pass (2048-bit key) header.d=tycho.pizza header.i=@tycho.pizza header.b=T8q5Kipo; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=cufab6Lv; arc=none smtp.client-ip=66.111.4.29 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tycho.pizza Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tycho.pizza Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id AB53E5C00EB; Sat, 27 Jan 2024 15:44:56 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Sat, 27 Jan 2024 15:44:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tycho.pizza; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1706388296; x=1706474696; bh=zv9FvXgF0s l4GXfUior97oaoRJoStoToMU42/qGdfcY=; b=T8q5Kipozu4vD+SyMGC1ggnno5 Zaap1Xql+FpwOSjeUsL8+LW2DVL3+gvdZd/aYp7ag5N92vW4GQghnkGBPC7OfZyn 4WRoTi1pJTK1omu/cUL1K0N2kZbW4/MqhhwqaG5UKZuIm5kSUZkltPvIJX1g3xOI ZEDRwdFTDFbwszQ6eKyp8BEpdlTxPvv4mDLRHPxHahpHRdpegC9XJS4GW9LOXiiy SNLbws5K1equFNaE3A3poB71+s8xKveNF0Hdyb5q8QN0GqSc9fNshf5u+XbuDZyY NpK2QV5/OOgHBnrvgC8J7DgteAeIwz3/V+DHO4DBDOiambUPTxlCtlO9rsmQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1706388296; x=1706474696; bh=zv9FvXgF0sl4GXfUior97oaoRJoS toToMU42/qGdfcY=; b=cufab6LvNxm+Ie3yjKh/amW520gARxbxdpCy9jkXxPa3 B/Df0WfAqWCBfbxO+NN6ZjXitW5JRcihpNzz3trYQaYAe2kafM/9xxjx9pktVNjH FxZqbVdhGMzmdX2VBq2Zt5G75i4V7CDW4N4shoaWZBUoHP2Hlzk7gwfl8ajrckTU AW5aRNA8DbhYy/1hTyyiSwcOOzGaCIfyLdmuRm89IHSGnvyJMVnVZ4UnUqk5D1pw LWMzQf01Mw2qeA6F+GbnrUHdzbROuywooCxAoG/7AUIbA+jFIvpgQJh4K6seUI4f TbKbwF5g3fyHRs7qagSgMJIhCUoXZPJ+p2FpqGTXqg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdelledgudeflecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpefvhigt hhhoucetnhguvghrshgvnhcuoehthigthhhosehthigthhhordhpihiiiigrqeenucggtf frrghtthgvrhhnpeeutedttefgjeefffehffffkeejueevieefudelgeejuddtfeffteek lefhleelteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehthigthhhosehthigthhhordhpihiiiigr X-ME-Proxy: Feedback-ID: i21f147d5:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 27 Jan 2024 15:44:55 -0500 (EST) Date: Sat, 27 Jan 2024 13:44:54 -0700 From: Tycho Andersen To: Oleg Nesterov Cc: Christian Brauner , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Tycho Andersen , "Eric W. Biederman" Subject: Re: [PATCH v3 1/3] pidfd: allow pidfd_open() on non-thread-group leaders Message-ID: References: <20240123153452.170866-2-tycho@tycho.pizza> <20240123195608.GB9978@redhat.com> <20240125140830.GA5513@redhat.com> <20240127105410.GA13787@redhat.com> <20240127163117.GB13787@redhat.com> <20240127193127.GC13787@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240127193127.GC13787@redhat.com> On Sat, Jan 27, 2024 at 08:31:27PM +0100, Oleg Nesterov wrote: > On 01/27, Tycho Andersen wrote: > > > > > > > exit_notify() is called after exit_files(). pidfd_getfd() returns > > > > > ESRCH if the exiting thread completes release_task(), otherwise it > > > > > returns EBADF because ->files == NULL. This too doesn't really > > > > > depend on PIDFD_THREAD. > > > > > > > > Yup, understood. It just seems like an inconsistency we might want to > > > > fix. > > > > > > Not sure this worth "fixing"... > > > > Yep, maybe not. Just wanted to point it out. > > On the second thought I am starting to understand your concern... > > Indeed, in this case -EBADF is technically correct but it can confuse > the user which doesn't or can't know that this task/thread is exiting, > because EBADF looks as if the "int fd" argument was wrong. > > Sorry I missed your point before. No worries. I realized it's not so hard to fix with your new xxx_exited() helper from the PIDFD_THREAD patch, so maybe worth cleaning up after all? Tycho