proc: hide kernel addresses via %pK in /proc/<pid>/stack
authorKonstantin Khlebnikov <[email protected]>
Wed, 23 Mar 2011 23:42:48 +0000 (16:42 -0700)
committerLinus Torvalds <[email protected]>
Thu, 24 Mar 2011 02:46:36 +0000 (19:46 -0700)
This file is readable for the task owner.  Hide kernel addresses from
unprivileged users, leave them function names and offsets.

Signed-off-by: Konstantin Khlebnikov <[email protected]>
Acked-by: Kees Cook <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/proc/base.c

index d49c4b5d2c3e92c1ed8a4be1ef979df91762c323..c3af15e9c070d5a2d4501e2fab89dd0321754953 100644 (file)
@@ -340,7 +340,7 @@ static int proc_pid_stack(struct seq_file *m, struct pid_namespace *ns,
        save_stack_trace_tsk(task, &trace);
 
        for (i = 0; i < trace.nr_entries; i++) {
-               seq_printf(m, "[<%p>] %pS\n",
+               seq_printf(m, "[<%pK>] %pS\n",
                           (void *)entries[i], (void *)entries[i]);
        }
        kfree(entries);