diff mbox

[natty] proc: hide kernel addresses via %pK in /proc/<pid>/stack

Message ID 20110224004227.GE4212@outflux.net
State Accepted
Delegated to: Andy Whitcroft
Headers show

Commit Message

Kees Cook Feb. 24, 2011, 12:42 a.m. UTC
[in -mm as proc-hide-kernel-addresses-via-%pk-in-proc-pid-stack.patch]

OriginalAuthor: Konstantin Khlebnikov <khlebnikov@openvz.org>

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 <khlebnikov@openvz.org>
Acked-by: Kees Cook <kees.cook@canonical.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

 fs/proc/base.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Andy Whitcroft Feb. 28, 2011, 11:51 a.m. UTC | #1
Applied to Natty.

diff mbox


diff -puN fs/proc/base.c~proc-hide-kernel-addresses-via-%pk-in-proc-pid-stack fs/proc/base.c
--- a/fs/proc/base.c~proc-hide-kernel-addresses-via-%pk-in-proc-pid-stack
+++ a/fs/proc/base.c
@@ -340,7 +340,7 @@  static int proc_pid_stack(struct seq_fil
 	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]);