Skip to contentSkip to conversation

procfs-do-not-list-tid-0-in-proc-pid-task.patch removed from -mm tree

merged [email protected] 1 participant 1 message Nov 11, 2021

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: procfs: do not list TID 0 in /proc/<pid>/task
has been removed from the -mm tree. Its filename was
procfs-do-not-list-tid-0-in-proc-pid-task.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Florian Weimer <[email protected]>
Subject: procfs: do not list TID 0 in /proc/<pid>/task

If a task exits concurrently, task_pid_nr_ns may return 0.

---

 fs/proc/base.c                           |    3 
 tools/testing/selftests/proc/.gitignore  |    1 
 tools/testing/selftests/proc/Makefile    |    2 
 tools/testing/selftests/proc/proc-tid0.c |   81 +++++++++++++++++++++
 4 files changed, 87 insertions(+)
fs/proc/base.c renamed from fs/proc/base.c~procfs-do-not-list-tid-0-in-proc-pid-task +3 -0
@@ -3799,7 +3799,10 @@ static int proc_task_readdir(struct file
 	     task = next_tid(task), ctx->pos++) {
 		char name[10 + 1];
 		unsigned int len;
+
 		tid = task_pid_nr_ns(task, ns);
+		if (!tid)
+			continue;	/* The task has just exited. */
 		len = snprintf(name, sizeof(name), "%u", tid);
 		if (!proc_fill_cache(file, ctx, name, len,
 				proc_task_instantiate, task, NULL)) {
tools/testing/selftests/proc/.gitignore renamed from tools/testing/selftests/proc/.gitignore~procfs-do-not-list-tid-0-in-proc-pid-task +1 -0
@@ -11,6 +11,7 @@
 /proc-self-syscall
 /proc-self-wchan
 /proc-subset-pid
+/proc-tid0
 /proc-uptime-001
 /proc-uptime-002
 /read
tools/testing/selftests/proc/Makefile renamed from tools/testing/selftests/proc/Makefile~procfs-do-not-list-tid-0-in-proc-pid-task +2 -0
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 CFLAGS += -Wall -O2 -Wno-unused-function
 CFLAGS += -D_GNU_SOURCE
+LDFLAGS += -pthread
 
 TEST_GEN_PROGS :=
 TEST_GEN_PROGS += fd-001-lookup
@@ -13,6 +14,7 @@ TEST_GEN_PROGS += proc-self-map-files-00
 TEST_GEN_PROGS += proc-self-syscall
 TEST_GEN_PROGS += proc-self-wchan
 TEST_GEN_PROGS += proc-subset-pid
+TEST_GEN_PROGS += proc-tid0
 TEST_GEN_PROGS += proc-uptime-001
 TEST_GEN_PROGS += proc-uptime-002
 TEST_GEN_PROGS += read
tools/testing/selftests/proc/proc-tid0.c new file +81 -0

81 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are