All of lore.kernel.org
 help / color / mirror / Atom feed
* + procfs-do-not-list-tid-0-in-proc-pid-task.patch added to -mm tree
@ 2021-09-29 23:20 akpm
  2021-10-07 18:27 ` [PATCH] proc: test that /proc/*/task doesn't contain "0" Alexey Dobriyan
  2021-10-07 18:28 ` + procfs-do-not-list-tid-0-in-proc-pid-task.patch added to -mm tree Alexey Dobriyan
  0 siblings, 2 replies; 5+ messages in thread
From: akpm @ 2021-09-29 23:20 UTC (permalink / raw)
  To: adobriyan, christian.brauner, ebiederm, fweimer, keescook,
	mm-commits


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@redhat.com>
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@oldenburg.str.redhat.com
Signed-off-by: Florian Weimer <fweimer@redhat.com>
Cc: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 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@redhat.com are

procfs-do-not-list-tid-0-in-proc-pid-task.patch


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-07 19:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-29 23:20 + procfs-do-not-list-tid-0-in-proc-pid-task.patch added to -mm tree akpm
2021-10-07 18:27 ` [PATCH] proc: test that /proc/*/task doesn't contain "0" Alexey Dobriyan
2021-10-07 18:52   ` Andrew Morton
2021-10-07 19:11     ` Alexey Dobriyan
2021-10-07 18:28 ` + procfs-do-not-list-tid-0-in-proc-pid-task.patch added to -mm tree Alexey Dobriyan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.