Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp179732rdh; Wed, 7 Feb 2024 01:12:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IHUHhN6P4MHAb9Li1kVGX4Dum5FDEFI079UdnyXrk2MmXILLCp7xaAc3z+4lCc+k6pA6sI9 X-Received: by 2002:a05:6808:1688:b0:3bf:dc73:5628 with SMTP id bb8-20020a056808168800b003bfdc735628mr6317878oib.46.1707297126502; Wed, 07 Feb 2024 01:12:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707297126; cv=pass; d=google.com; s=arc-20160816; b=zVKpX9EADLAkVBqrrLiBXb4GUoj4tZfuQDyL/2MiDFBpNMtPZk4To5bHycuP/gr5NU 5u6o/zpEIAKdXMmAS1s3H74qmeOKa/SIQNvhiHRZ0L62ZgwPL4ulxMpnxOV8k+X39bsa 2m/zP5cg9jEfF/ULNu+n894ZCad1wOfhaZE30Gin+dclqp+Z0Shl/ogt/VX53OUweuZm RxhrICyRFQPLRT3yXf3NRx99fmr2aD2RLzIFLxf4F90bLeYa/ZVX7yRwvVqFXstI/YG0 B9WHqd231g35xToN1j0lE/fW4ykF8sWvVpFz/PtFeMEs0YA6AHXC7R7mjC0Ub1Hfl15C tX9Q== 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:dkim-signature; bh=P2Tlgs2lhGZEJu716gOgcix76cVhiOvztEOIvMBR6oY=; fh=CgYN7zqfqN491H/2jhlmUTJvircc2EoLpHJncfY5b3w=; b=FK8gNRtZdJ5aySs1h+oGGKsKG9sd5eUpcOa7a2au6fMORqkt38p8pThjj8VV2ftIKF 66mC7FBJwzp6+HW7jJPhfft19SYlJ73MvZ+ajFEEtfnFEO/5jc8EDSRHG7pyVuTTfFC0 SZm/tuDlKckC1uignm0FvaZwjWZp5VMnWsnfDS6ww7jiWgh2ezVzrGryc69ZTg9zQZi3 SBLsAxKGgaf/7KW7NoDBNFdxyBNBdbAKFhsDy2vQo8VfbRNcd8FqRoeZUDZVgL808Sci p8oY8bWkYLfGB0b4QFRd0LBJjdu6TlZyOCCOqDaqENmzOZesTczIzOglKNgrzqDBZvhR UgUA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KUB+w8e3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-56173-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56173-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCXO/yEmlcdCMm+LFc/OP7tcWxyx7vzyovcAE/DFbxTLlvPdMPds2urkvov4dvLN5GJjjtfqDGelDP+wDOJarcR7Bynj8xxfNDh5J4GO2Q== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id im7-20020a056a008d8700b006db05fad13fsi1180177pfb.380.2024.02.07.01.12.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 01:12:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56173-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KUB+w8e3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-56173-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56173-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id EB98E2876A2 for ; Wed, 7 Feb 2024 09:12:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4008920B12; Wed, 7 Feb 2024 09:12:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KUB+w8e3" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 695B222309; Wed, 7 Feb 2024 09:11:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707297119; cv=none; b=XEvlYKem7ce+OaTNvUrJ+gCC5xID79XnSCsD3IJDlQu6YKQLBDUpQjWXDe1h99dS6RoGLvfsqO37vEoFDlvc+7aeIdgt/5B2ToFMkV/urDWi+nGDGQvTUnKJYg0Fl1Ms8CZWTC/dADr7QmSJZVeamXtz3nxnFuOE9SAVdq9efKg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707297119; c=relaxed/simple; bh=AtP/ME1PRkShWXVScAvx8Ke49p5JUPPwqDslrQGzmWY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jNkSLhIq7NkOLwO/7OZMkAwwz9ickBt5lR41OHF2lihV0wgWLxaewKcBDMZN+tb9YIXpfjbSBuk8bOkqiYsZHfQi391smBzk6f7ECQokU0cgtJ0fErE3+5Brr8zIirIjL0fZya1xS3o2TdeG2vkV23F5Fiz/sDBkUpGFv800AC4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KUB+w8e3; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BC8EC433F1; Wed, 7 Feb 2024 09:11:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707297118; bh=AtP/ME1PRkShWXVScAvx8Ke49p5JUPPwqDslrQGzmWY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KUB+w8e3puRxYM/RkwNkBixv705NA9RWHe7NYPpnteoFJfGgFMP75wCiVEDq/IfL6 RAw0ZzNbgTJLFSdmlvAiQuO0WuNGbihyrJu5YsPN8DitSVZqW/Bf54p4ZKKiAmBz/W nqvSHBH4jn/v9TU3FOO1A/HUaI6O6TSu9+UwIxJWTinIQ6ZaFtsYiEtizYB12O9PRI +BHHfGpBOd76esgclmFBN6nYENqzDdym8Bn4JZEVi/VIianPjdWAFajlzeOyNuM4ca aq/ka5XTIAJ/LeiD3rDigO3n7K7lO63dvkM3p2ZoWC4rWEm/dYn9xWKRtpXu6emCdK 3ofaA11qUzOzw== Date: Wed, 7 Feb 2024 10:11:54 +0100 From: Christian Brauner To: Oleg Nesterov Cc: Tycho Andersen , "Eric W . Biederman" , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Tycho Andersen Subject: Re: [PATCH] pidfd: getfd should always report ESRCH if a task is exiting Message-ID: <20240207-beseitigen-ausfliegen-b2b95de67c4f@brauner> References: <20240206164308.62620-1-tycho@tycho.pizza> <20240206173722.GA3593@redhat.com> <20240206180607.GB3593@redhat.com> <20240206192553.GC3593@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=utf-8 Content-Disposition: inline In-Reply-To: <20240206192553.GC3593@redhat.com> On Tue, Feb 06, 2024 at 08:25:54PM +0100, Oleg Nesterov wrote: > On 02/06, Tycho Andersen wrote: > > > On Tue, Feb 06, 2024 at 07:06:07PM +0100, Oleg Nesterov wrote: > > > Or we can check task->files != NULL rather than PF_EXITING. > > > > > > To me this looks even better, but looks more confusing without a comment. > > > OTOH, imo this needs a comment anyway ;) > > > > I thought about this, but I didn't really understand the null check in > > exit_files(); > > I guess task->files can be NULL at least if it was cloned with > kernel_clone_args->no_files == T Won't this give false positives for vhost workers which do set ->no_files but are user workers? IOW, return -ESRCH even though -EBADF would be correct in this scenario?