aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorKees Cook <kees.cook@canonical.com>2008-10-05 19:11:58 -0400
committerAlexey Dobriyan <adobriyan@gmail.com>2008-10-09 20:18:57 -0400
commit478307230810d7e2a753ed220db9066dfdf88718 (patch)
tree7cb8bfebc5a0a7c043bdfda5675ddb526da1af34 /fs/proc
parenta6bebbc87a8c16eabb6bd5c6fd2d994be0236fba (diff)
[PATCH] proc: show personality via /proc/pid/personality
Make process personality flags visible in /proc. Since a process's personality is potentially sensitive (e.g. READ_IMPLIES_EXEC), make this file only readable by the process owner. Signed-off-by: Kees Cook <kees.cook@canonical.com> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/base.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index bb63fa1d34a2..c1332dd2575d 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2438,6 +2438,13 @@ static int proc_tgid_io_accounting(struct task_struct *task, char *buffer)
2438} 2438}
2439#endif /* CONFIG_TASK_IO_ACCOUNTING */ 2439#endif /* CONFIG_TASK_IO_ACCOUNTING */
2440 2440
2441static int proc_pid_personality(struct seq_file *m, struct pid_namespace *ns,
2442 struct pid *pid, struct task_struct *task)
2443{
2444 seq_printf(m, "%08x\n", task->personality);
2445 return 0;
2446}
2447
2441/* 2448/*
2442 * Thread groups 2449 * Thread groups
2443 */ 2450 */
@@ -2454,6 +2461,7 @@ static const struct pid_entry tgid_base_stuff[] = {
2454 REG("environ", S_IRUSR, environ), 2461 REG("environ", S_IRUSR, environ),
2455 INF("auxv", S_IRUSR, pid_auxv), 2462 INF("auxv", S_IRUSR, pid_auxv),
2456 ONE("status", S_IRUGO, pid_status), 2463 ONE("status", S_IRUGO, pid_status),
2464 ONE("personality", S_IRUSR, pid_personality),
2457 INF("limits", S_IRUSR, pid_limits), 2465 INF("limits", S_IRUSR, pid_limits),
2458#ifdef CONFIG_SCHED_DEBUG 2466#ifdef CONFIG_SCHED_DEBUG
2459 REG("sched", S_IRUGO|S_IWUSR, pid_sched), 2467 REG("sched", S_IRUGO|S_IWUSR, pid_sched),
@@ -2789,6 +2797,7 @@ static const struct pid_entry tid_base_stuff[] = {
2789 REG("environ", S_IRUSR, environ), 2797 REG("environ", S_IRUSR, environ),
2790 INF("auxv", S_IRUSR, pid_auxv), 2798 INF("auxv", S_IRUSR, pid_auxv),
2791 ONE("status", S_IRUGO, pid_status), 2799 ONE("status", S_IRUGO, pid_status),
2800 ONE("personality", S_IRUSR, pid_personality),
2792 INF("limits", S_IRUSR, pid_limits), 2801 INF("limits", S_IRUSR, pid_limits),
2793#ifdef CONFIG_SCHED_DEBUG 2802#ifdef CONFIG_SCHED_DEBUG
2794 REG("sched", S_IRUGO|S_IWUSR, pid_sched), 2803 REG("sched", S_IRUGO|S_IWUSR, pid_sched),