Thread (23 messages) 23 messages, 2 authors, 2021-03-20
STALE1924d

[RFC PATCH 07/10] fs/proc: hide PF_IO_WORKER in get_task_cmdline()

From: Stefan Metzmacher <metze@samba.org>
Date: 2021-03-15 17:04:07
Subsystem: filesystems (vfs and infrastructure), proc filesystem, the rest · Maintainers: Alexander Viro, Christian Brauner, Linus Torvalds

We should not return the userspace cmdline for io_worker threads.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
---
 fs/proc/base.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 3851bfcdba56..6e04278de582 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -344,6 +344,9 @@ static ssize_t get_task_cmdline(struct task_struct *tsk, char __user *buf,
 	struct mm_struct *mm;
 	ssize_t ret;
 
+	if (tsk->flags & PF_IO_WORKER)
+		return 0;
+
 	mm = get_task_mm(tsk);
 	if (!mm)
 		return 0;
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help