Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp820787ybn; Tue, 24 Sep 2019 10:01:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwKjQrZTNel6OjBIbJlUw33cOs55Dt/A2aUnaVFpKk3Z0UuTbFgq3QPlbM3uUd90g5Qb+YL X-Received: by 2002:a05:651c:1031:: with SMTP id w17mr2691060ljm.16.1569344479413; Tue, 24 Sep 2019 10:01:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569344479; cv=none; d=google.com; s=arc-20160816; b=OzDbVjNHw2sH5Wv3a5Hc0jtD6+flV+nj9z5RlGFBCvxr7lkXWSBkl9Sws5OaeK8ta4 SjwncEu9z1Qzuxyz/8G2DZwnTnaUuqRsemudfGhlHjOxXNoQd0yYt+NWtylVplg8N5rY WxdxtfEFUBzHuKhCDw8EC6F/bRpSvdOvkj93YRebGcOV3DVg0WqLADEx6CGBL6KfgoN2 Z+3PTYTeo2FCiRA7A9QdkEnWHloQeCsFkHX8hNYW4BQ710Dcsdp5sNG3z+xpyhSVlF0E uzF9kyY46Nfcx7HraNZsmYjrbQKLyA5f60HPJ5ay3+AJIetcva6aBF/TOgQTYb891eK8 nADA== 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:mime-version :message-id:in-reply-to:date:references:subject:cc:to:from; bh=DqvageBQpidGbZTSzsX90rcbJZyXLHB3OSFXRUwe7PE=; b=mGH6MEs2Vz7/DdOfy46680os46N8pFPrW0jGXbfNFK29q5Y0dhVFhK8jJ5onYC//ug 80W/2qZurD9yEypkINs5ZaoOMP3zg36cPZSTQFS7nScEW8smyeuNmmrZGYbOf4Wd+DF5 MoIJlv/wEFdjtBs19rTYrt8VEB+kjPZE7EvF9F/0aFUcybnWWI/yT8R4oRJMOHuWjLtV 3lv8oWauMhBiEJZ6TjnXafVdqK8ReffOFIspJBK8VUZt8zivaz4nALP35iWapqKhNpk5 AIcathCXvA4IRjFvrVF5Y90x+WjXshCQILcCrHRfICUQPETfClJfwzDGe2jn6W46EKyy XVsA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i34si1449848ede.37.2019.09.24.10.00.55; Tue, 24 Sep 2019 10:01:19 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393839AbfIWL0s convert rfc822-to-8bit (ORCPT + 99 others); Mon, 23 Sep 2019 07:26:48 -0400 Received: from mailout.enyo.de ([116.203.30.208]:38369 "EHLO mailout.enyo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393655AbfIWL0r (ORCPT ); Mon, 23 Sep 2019 07:26:47 -0400 Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1iCMUF-0008D5-19; Mon, 23 Sep 2019 11:26:35 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1iCMUE-0001j8-TI; Mon, 23 Sep 2019 13:26:34 +0200 From: Florian Weimer To: "Michael Kerrisk \(man-pages\)" Cc: Oleg Nesterov , Christian Brauner , Jann Horn , "Eric W. Biederman" , Daniel Colascione , Joel Fernandes , linux-man , Linux API , lkml Subject: Re: For review: pidfd_send_signal(2) manual page References: Date: Mon, 23 Sep 2019 13:26:34 +0200 In-Reply-To: (Michael Kerrisk's message of "Mon, 23 Sep 2019 11:12:00 +0200") Message-ID: <87pnjr9rth.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Michael Kerrisk: > SYNOPSIS > int pidfd_send_signal(int pidfd, int sig, siginfo_t info, > unsigned int flags); This probably should reference a header for siginfo_t. > ESRCH The target process does not exist. If the descriptor is valid, does this mean the process has been waited for? Maybe this can be made more explicit. > 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‐ > nated and its PID has been recycled for another process. By con‐ > 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 and the caller of pidfd_send_signal() is > informed of this fact via an ESRCH error. It would be nice to explain somewhere how you can avoid the race using a PID descriptor. Is there anything else besides CLONE_PIDFD? > static > int pidfd_send_signal(int pidfd, int sig, siginfo_t *info, > unsigned int flags) > { > return syscall(__NR_pidfd_send_signal, pidfd, sig, info, flags); > } Please use a different function name. Thanks.