linux-stable/fs/proc
Kees Cook 2f4b3bf6b2 /proc/pid/status: add "Seccomp" field
It is currently impossible to examine the state of seccomp for a given
process.  While attaching with gdb and attempting "call
prctl(PR_GET_SECCOMP,...)" will work with some situations, it is not
reliable.  If the process is in seccomp mode 1, this query will kill the
process (prctl not allowed), if the process is in mode 2 with prctl not
allowed, it will similarly be killed, and in weird cases, if prctl is
filtered to return errno 0, it can look like seccomp is disabled.

When reviewing the state of running processes, there should be a way to
externally examine the seccomp mode.  ("Did this build of Chrome end up
using seccomp?" "Did my distro ship ssh with seccomp enabled?")

This adds the "Seccomp" line to /proc/$pid/status.

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: James Morris <jmorris@namei.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-12-17 17:15:22 -08:00
..
array.c /proc/pid/status: add "Seccomp" field 2012-12-17 17:15:22 -08:00
base.c mm, oom: change type of oom_score_adj to short 2012-12-11 17:22:27 -08:00
cmdline.c
consoles.c console: rename acquire/release_console_sem() to console_lock/unlock() 2011-01-26 10:50:06 +10:00
cpuinfo.c
devices.c proc: use seq_puts()/seq_putc() where possible 2011-01-13 08:03:16 -08:00
fd.c don't leak O_CLOEXEC into ->f_flags 2012-09-26 21:10:01 -04:00
fd.h procfs: Move /proc/pid/fd[info] handling code to fd.[ch] 2012-09-26 21:10:01 -04:00
generic.c proc: use kzalloc instead of kmalloc and memset 2012-10-06 03:05:18 +09:00
inode.c proc: no need to initialize proc_inode->fd in proc_get_inode() 2012-10-06 03:05:18 +09:00
internal.h hold task->mempolicy while numa_maps scans. 2012-10-19 14:32:10 -07:00
interrupts.c
Kconfig kconfig: rename CONFIG_EMBEDDED to CONFIG_EXPERT 2011-01-20 17:02:05 -08:00
kcore.c procfs: use N_MEMORY instead N_HIGH_MEMORY 2012-12-12 17:38:32 -08:00
kmsg.c procfs: Use generic_file_llseek in /proc/kmsg 2010-04-09 16:35:41 +02:00
loadavg.c
Makefile procfs: Move /proc/pid/fd[info] handling code to fd.[ch] 2012-09-26 21:10:01 -04:00
meminfo.c fs/proc/meminfo.c: fix compilation error 2011-12-09 07:50:28 -08:00
mmu.c
namespaces.c stop passing nameidata to ->lookup() 2012-07-14 16:34:32 +04:00
nommu.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
page.c kpageflags: fix wrong KPF_THP on non-huge compound pages 2012-10-09 16:23:00 +09:00
proc_devtree.c procfs: use kbasename() 2012-12-17 17:15:17 -08:00
proc_net.c stop passing nameidata to ->lookup() 2012-07-14 16:34:32 +04:00
proc_sysctl.c sysctl: Pass useful parameters to sysctl permissions 2012-11-18 20:30:55 -05:00
proc_tty.c proc: use seq_puts()/seq_putc() where possible 2011-01-13 08:03:16 -08:00
root.c fs/proc/root.c: use NULL instead of 0 for pointer 2012-10-06 03:05:19 +09:00
softirqs.c proc: use seq_puts()/seq_putc() where possible 2011-01-13 08:03:16 -08:00
stat.c nohz: Fix idle ticks in cpu summary line of /proc/stat 2012-10-10 14:05:21 +02:00
task_mmu.c procfs: add VmFlags field in smaps output 2012-12-17 17:15:22 -08:00
task_nommu.c proc: remove mm_for_maps() 2012-05-31 17:49:28 -07:00
uptime.c Merge branch 'sched/core' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into cputime-tip 2011-12-19 19:23:15 +01:00
version.c
vmcore.c fadump: Introduce cleanup routine to invalidate /proc/vmcore. 2012-02-23 10:50:02 +11:00