mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tachino Nobuhiro <tachino@jp.fujitsu.com>
To: linux-kernel@vger.kernel.org
Subject: ptrace fix changes output of ps ax
Date: Mon, 07 Apr 2003 11:50:19 +0900	[thread overview]
Message-ID: <4r5b81hw.wl@nisaaru.dvs.cs.fujitsu.co.jp> (raw)


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);

                 reply	other threads:[~2003-04-07  2:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4r5b81hw.wl@nisaaru.dvs.cs.fujitsu.co.jp \
    --to=tachino@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®