summaryrefslogtreecommitdiff
path: root/init/init_task.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2020-05-14 00:11:26 +0300
committerKees Cook <keescook@chromium.org>2020-07-11 02:01:51 +0300
commitc818c03b661cd769e035e41673d5543ba2ebda64 (patch)
treeceb9cf9666ce0e0e3964c1ff1a0a5949de471cf6 /init/init_task.c
parente4d05028a07f505a08802a6d1b11674c149df2b3 (diff)
downloadlinux-c818c03b661cd769e035e41673d5543ba2ebda64.tar.xz
seccomp: Report number of loaded filters in /proc/$pid/status
A common question asked when debugging seccomp filters is "how many filters are attached to your process?" Provide a way to easily answer this question through /proc/$pid/status with a "Seccomp_filters" line. Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'init/init_task.c')
-rw-r--r--init/init_task.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/init/init_task.c b/init/init_task.c
index 15089d15010a..a3eb3847e1f4 100644
--- a/init/init_task.c
+++ b/init/init_task.c
@@ -204,6 +204,9 @@ struct task_struct init_task
#ifdef CONFIG_SECURITY
.security = NULL,
#endif
+#ifdef CONFIG_SECCOMP
+ .seccomp = { .filter_count = ATOMIC_INIT(0) },
+#endif
};
EXPORT_SYMBOL(init_task);