Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp597798ybn; Wed, 25 Sep 2019 04:59:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMdmwZUqv9ES+6eVMWNgil3pRnhbWe63Z9tR1KMYkTnTCEh1PY51gU4jZ1YvrEno0F0FRZ X-Received: by 2002:a05:6000:82:: with SMTP id m2mr383499wrx.241.1569412751267; Wed, 25 Sep 2019 04:59:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569412751; cv=none; d=google.com; s=arc-20160816; b=Y2IZtUwkyZ2E4ZLPkVyIFgIsjvaosPlJ/Nb7MlmyUBVN1qNzksdbQ3jgSQOGJ+QuMY YWOMDSAhN3uDFPV47LhAUBpkLpFui4fj7nhmsJaxjfh7HOTLeNNy6dr3z1WaTvbotdjy 4Pr31KsgQkpHaQncZVH/CBzWBIfLNsgHmhKSgZ5lVtJhj2LXxSAncBgPqRtaBiTHrde8 n3ckYk1LJeCH3pVakwSJfXFVewx4akTmxEZAYmb1ALVcQvVr0swVbUymka2+SjA0xmta SwNYTGqrL+w9IBYN+yT6tsCKlYJd678QFs2gGPug6mE6yipMBIZlM1JrI90DFca0J/Lk DYJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=BdkRnPxxkrHCArqVLcv4NrTAprv0oT6sz0IuGcvvVWE=; b=V9H4zw0jehjgxmuOVkGOMuWQ3zVro7Ipv3mVbXLdXupC0aKaDo+FkcoXQ0mGGymdHU 2uZTFIlp2nhqu8sIXeii0APlG9nl572MebjDhn8CqI9Sj992vq0wZGrp90azzIJXiiaR ZnVNqdj9VFZsMFwGMpXVKhiddo0B66GbzhAm0mPrsCDT/2uB2csAEA98+vNZaVGh0z57 b7hDXB3y0rktJNMysOxYTSLRiyMy7TXsG3P53JZJN/Pr9nzjyFjeVXJ/Y7e4QXbhEItG mI0AzqGDVFAyUc7y2PW7EF4rPjoU+2cLeDI6E4m6y3jjMjGbQJdBsm2K7IyOgSfZQqX4 If9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=jHShKYYf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e49si3760129edb.87.2019.09.25.04.58.47; Wed, 25 Sep 2019 04:59:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=jHShKYYf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393853AbfIWLbr (ORCPT + 99 others); Mon, 23 Sep 2019 07:31:47 -0400 Received: from mail-vs1-f52.google.com ([209.85.217.52]:38838 "EHLO mail-vs1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389652AbfIWLbr (ORCPT ); Mon, 23 Sep 2019 07:31:47 -0400 Received: by mail-vs1-f52.google.com with SMTP id b123so9167059vsb.5 for ; Mon, 23 Sep 2019 04:31:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=BdkRnPxxkrHCArqVLcv4NrTAprv0oT6sz0IuGcvvVWE=; b=jHShKYYf94iD2ATPmGI2XwDkf0OHLQT3BApISGPlbJKzIY/Q2WZFIfr/SrU/pSqLy4 paP0exW8nos30hYID3RxxM07msiA2p4tGi1oGCgGaTRJD+1GsAlPbtQs1/I3wrRE/ggm 6DW2dpV9BTs8xzduRSMoGvUdmXE6fMYXj/Rj27mSMZCDoJNGxhvUa1N4s9dFPImX0oCM c9LgFKMOlUa+06PbMPbaaZrmsmxpN+QK76856pLUs+30YH/dDa71oDehFcJntogH3mwm caBSsrQ+DLoxSAm0j05GPi+6pLZknm+mIXXZRQPgx8N9HVfIyEbPZ9UeQfSzCFs4l606 i/Lw== 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=BdkRnPxxkrHCArqVLcv4NrTAprv0oT6sz0IuGcvvVWE=; b=gcWbe5FsNCicjt0fYeG+LxgnHqQU3gvG3THQ2PaumtnDhmuFGUSBdZS5zmGT+SH38B UkgBU5sH/0PyVBOaAxp2yyHf6FqSp5epKIDDtnVFMcfVAXrBktpa4dDfA/g08vJAU+n3 y79w2lW5ASjhR0oVkVLGfrBSEe2ocX5owoSva4k/EMVLiHkcbzxY3rEOqZQn19yzOoVg NPRNZPtWG49d1acs9hdRMhvvuJNtpmlvyswpSII7ImWHRcCIgMbwqnX3r1FejGCd/VST 0YOjiwgN3JvMN2ryYIFMkEbiN0i9zL3xv8QjYCT9qZHeq3Fs48lfGarDUvtfcrMiIqMT fKhw== X-Gm-Message-State: APjAAAUtnf+nkcX3wHYCuVEtyCmUAde1zPS9rZyOj65Ei+P4D3ybMRJ3 cgghxFjccIHHICUiQGrheI/CGWz0gPqCUed6wUMigw== X-Received: by 2002:a67:f0cd:: with SMTP id j13mr9479486vsl.183.1569238306236; Mon, 23 Sep 2019 04:31:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Daniel Colascione Date: Mon, 23 Sep 2019 04:31:09 -0700 Message-ID: Subject: Re: For review: pidfd_send_signal(2) manual page To: "Michael Kerrisk (man-pages)" Cc: Oleg Nesterov , Christian Brauner , Jann Horn , "Eric W. Biederman" , Joel Fernandes , linux-man , Linux API , lkml Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 23, 2019 at 2:12 AM Michael Kerrisk (man-pages) wrote: > The pidfd_send_signal() system call allows the avoidance of race > conditions that occur when using traditional interfaces (such as > kill(2)) to signal a process. The problem is that the traditional > interfaces specify the target process via a process ID (PID), with > the result that the sender may accidentally send a signal to the > wrong process if the originally intended target process has termi= =E2=80=90 > nated and its PID has been recycled for another process. By con= =E2=80=90 > trast, a PID file descriptor is a stable reference to a specific > process; if that process terminates, then the file descriptor > ceases to be valid The file *descriptor* remains valid even after the process to which it refers exits. You can close(2) the file descriptor without getting EBADF. I'd say, instead, that "a PID file descriptor is a stable reference to a specific process; process-related operations on a PID file descriptor fail after that process exits".