The patch titled Subject: procfs: do not list TID 0 in /proc/<pid>/task has been added to the -mm tree. Its filename is procfs-do-not-list-tid-0-in-proc-pid-task.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/procfs-do-not-list-tid-0-in-proc-pid-task.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/procfs-do-not-list-tid-0-in-proc-pid-task.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Florian Weimer <fweimer@xxxxxxxxxx> Subject: procfs: do not list TID 0 in /proc/<pid>/task If a task exits concurrently, task_pid_nr_ns may return 0. Link: https://lkml.kernel.org/r/8735pn5dx7.fsf@xxxxxxxxxxxxxxxxxxxxxxxx Signed-off-by: Florian Weimer <fweimer@xxxxxxxxxx> Cc: Christian Brauner <christian.brauner@xxxxxxxxxx> Cc: Kees Cook <keescook@xxxxxxxxxxxx> Cc: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx> Cc: Alexey Dobriyan <adobriyan@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/proc/base.c | 3 +++ 1 file changed, 3 insertions(+) --- a/fs/proc/base.c~procfs-do-not-list-tid-0-in-proc-pid-task +++ a/fs/proc/base.c @@ -3800,6 +3800,9 @@ static int proc_task_readdir(struct file char name[10 + 1]; unsigned int len; tid = task_pid_nr_ns(task, ns); + if (!tid) + /* The task has just exited. */ + continue; len = snprintf(name, sizeof(name), "%u", tid); if (!proc_fill_cache(file, ctx, name, len, proc_task_instantiate, task, NULL)) { _ Patches currently in -mm which might be from fweimer@xxxxxxxxxx are procfs-do-not-list-tid-0-in-proc-pid-task.patch