Skip to content

Commit 64bdc02

Browse files
Kenta.Tada@sony.comkees
authored andcommitted
seccomp: Fix CONFIG tests for Seccomp_filters
Strictly speaking, seccomp filters are only used when CONFIG_SECCOMP_FILTER. This patch fixes the condition to enable "Seccomp_filters" in /proc/$pid/status. Signed-off-by: Kenta Tada <Kenta.Tada@sony.com> Fixes: c818c03 ("seccomp: Report number of loaded filters in /proc/$pid/status") Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/OSBPR01MB26772D245E2CF4F26B76A989F5669@OSBPR01MB2677.jpnprd01.prod.outlook.com
1 parent a38fd87 commit 64bdc02

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

fs/proc/array.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,10 @@ static inline void task_seccomp(struct seq_file *m, struct task_struct *p)
342342
seq_put_decimal_ull(m, "NoNewPrivs:\t", task_no_new_privs(p));
343343
#ifdef CONFIG_SECCOMP
344344
seq_put_decimal_ull(m, "\nSeccomp:\t", p->seccomp.mode);
345+
#ifdef CONFIG_SECCOMP_FILTER
345346
seq_put_decimal_ull(m, "\nSeccomp_filters:\t",
346347
atomic_read(&p->seccomp.filter_count));
348+
#endif
347349
#endif
348350
seq_puts(m, "\nSpeculation_Store_Bypass:\t");
349351
switch (arch_prctl_spec_ctrl_get(p, PR_SPEC_STORE_BYPASS)) {

init/init_task.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ struct task_struct init_task
210210
#ifdef CONFIG_SECURITY
211211
.security = NULL,
212212
#endif
213-
#ifdef CONFIG_SECCOMP
213+
#ifdef CONFIG_SECCOMP_FILTER
214214
.seccomp = { .filter_count = ATOMIC_INIT(0) },
215215
#endif
216216
};

0 commit comments

Comments
 (0)