Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760669Ab2JaUJl (ORCPT ); Wed, 31 Oct 2012 16:09:41 -0400 Received: from smtp.outflux.net ([198.145.64.163]:37294 "EHLO smtp.outflux.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759725Ab2JaUJj (ORCPT ); Wed, 31 Oct 2012 16:09:39 -0400 Date: Wed, 31 Oct 2012 13:09:27 -0700 From: Kees Cook To: linux-kernel@vger.kernel.org Cc: Andrew Morton , Will Drewry , Kees Cook , Serge Hallyn , Cyrill Gorcunov , KAMEZAWA Hiroyuki Subject: [PATCH] proc: add "Seccomp" to status Message-ID: <20121031200926.GA22988@www.outflux.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-HELO: www.outflux.net Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1310 Lines: 46 Adds the seccomp mode to the /proc/$pid/status file so the state of seccomp can be externally examined. Signed-off-by: Kees Cook --- fs/proc/array.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs/proc/array.c b/fs/proc/array.c index c1c207c..135d6ac 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -327,6 +327,13 @@ static inline void task_cap(struct seq_file *m, struct task_struct *p) render_cap_t(m, "CapBnd:\t", &cap_bset); } +static inline void task_seccomp(struct seq_file *m, struct task_struct *p) +{ +#ifdef CONFIG_SECCOMP + seq_printf(m, "Seccomp:\t%d\n", p->seccomp.mode); +#endif +} + static inline void task_context_switch_counts(struct seq_file *m, struct task_struct *p) { @@ -360,6 +367,7 @@ int proc_pid_status(struct seq_file *m, struct pid_namespace *ns, } task_sig(m, task); task_cap(m, task); + task_seccomp(m, task); task_cpus_allowed(m, task); cpuset_task_status_allowed(m, task); task_context_switch_counts(m, task); -- 1.7.9.5 -- Kees Cook Chrome OS Security -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/