[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181106130524.GC2453@dhcp22.suse.cz>
Date: Tue, 6 Nov 2018 14:05:24 +0100
From: Michal Hocko <mhocko@...nel.org>
To: Daniel Colascione <dancol@...gle.com>
Cc: linux-kernel@...r.kernel.org, rppt@...ux.ibm.com,
timmurray@...gle.com, joelaf@...gle.com, surenb@...gle.com,
Jonathan Corbet <corbet@....net>,
Andrew Morton <akpm@...ux-foundation.org>,
Roman Gushchin <guro@...com>,
Mike Rapoport <rppt@...ux.vnet.ibm.com>,
Vlastimil Babka <vbabka@...e.cz>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
"Dennis Zhou (Facebook)" <dennisszhou@...il.com>,
Prashant Dhamdhere <pdhamdhe@...hat.com>,
"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>
Subject: Re: [PATCH v2] Document /proc/pid PID reuse behavior
On Mon 05-11-18 13:22:05, Daniel Colascione wrote:
> State explicitly that holding a /proc/pid file descriptor open does
> not reserve the PID. Also note that in the event of PID reuse, these
> open file descriptors refer to the old, now-dead process, and not the
> new one that happens to be named the same numeric PID.
This sounds quite obvious otherwise anybody could simply DoS the system
by consuming all available pids. But I do not see any strong reason
against having that stated explicitly.
> Signed-off-by: Daniel Colascione <dancol@...gle.com>
Acked-by: Michal Hocko <mhocko@...e.com>
> ---
> Documentation/filesystems/proc.txt | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> Moved paragraphed to start of /proc/pid section; added signed-off-by.
>
> diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
> index 12a5e6e693b6..0b14460f721d 100644
> --- a/Documentation/filesystems/proc.txt
> +++ b/Documentation/filesystems/proc.txt
> @@ -125,6 +125,13 @@ process running on the system, which is named after the process ID (PID).
> The link self points to the process reading the file system. Each process
> subdirectory has the entries listed in Table 1-1.
>
> +Note that an open a file descriptor to /proc/<pid> or to any of its
> +contained files or subdirectories does not prevent <pid> being reused
> +for some other process in the event that <pid> exits. Operations on
> +open /proc/<pid> file descriptors corresponding to dead processes
> +never act on any new process that the kernel may, through chance, have
> +also assigned the process ID <pid>. Instead, operations on these FDs
> +usually fail with ESRCH.
>
> Table 1-1: Process specific entries in /proc
> ..............................................................................
> --
> 2.19.1.930.g4563a0d9d0-goog
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists