mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* ptrace fix changes output of ps ax
@ 2003-04-07  2:50 Tachino Nobuhiro
  0 siblings, 0 replies; only message in thread
From: Tachino Nobuhiro @ 2003-04-07  2:50 UTC (permalink / raw)
  To: linux-kernel


Hello, 

After 2.4.21-pre6, I found "ps ax" displays some processes
as the process names which are embraced with square brackets
like these.

1115 ?        S      0:00 [httpd]
1478 ?        S      0:00 [atd]


It is because proc_pid_cmdline() calls access_process_vm() and it fails.
The patch below fixes the problem. With this patch, access_process_vm()
do not reject requests if the access is read only.

I'm not certain this is right fix, but at least I confirmed
isec-ptrace-kmot-exploit cannot get root privilege with this patch.

Please comment.



diff -Nur linux-2.4.org/kernel/ptrace.c linux-2.4/kernel/ptrace.c
--- linux-2.4.org/kernel/ptrace.c	2003-03-28 15:59:15.000000000 +0900
+++ linux-2.4/kernel/ptrace.c	2003-04-03 16:04:32.000000000 +0900
@@ -140,7 +140,7 @@
 	/* Worry about races with exit() */
 	task_lock(tsk);
 	mm = tsk->mm;
-	if (!is_dumpable(tsk) || (&init_mm == mm))
+	if ((!is_dumpable(tsk) || (&init_mm == mm)) && write)
 		mm = NULL;
 	if (mm)
 		atomic_inc(&mm->mm_users);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-07  2:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-07  2:50 ptrace fix changes output of ps ax Tachino Nobuhiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®