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

From: Konstantin Khlebnikov
Date: Mon Feb 21 2011 - 14:11:50 EST


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@xxxxxxxxxx>
---
fs/proc/base.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 9d096e8..4fa8dc6 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -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);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/