Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756598Ab2KCQHx (ORCPT ); Sat, 3 Nov 2012 12:07:53 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]:64768 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756211Ab2KCQHv (ORCPT ); Sat, 3 Nov 2012 12:07:51 -0400 MIME-Version: 1.0 In-Reply-To: <20121103115129.GA4508@cachalot> References: <20121101183516.GA18332@www.outflux.net> <20121103115129.GA4508@cachalot> Date: Sat, 3 Nov 2012 09:07:49 -0700 X-Google-Sender-Auth: 0NifLt01aOAcxhpk9Z4d0H6FtqU Message-ID: Subject: Re: [PATCH v2] proc: add "Seccomp" to status From: Kees Cook To: Vasiliy Kulikov Cc: linux-kernel@vger.kernel.org, Andrew Morton , Will Drewry , Cyrill Gorcunov , Paul Gortmaker , Serge Hallyn , KAMEZAWA Hiroyuki , linux-doc@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1219 Lines: 34 On Sat, Nov 3, 2012 at 4:51 AM, Vasiliy Kulikov wrote: > On Thu, Nov 01, 2012 at 11:35 -0700, Kees Cook wrote: >> @@ -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 > > Hmm, probably it's better to always show this line, not only on > SECCOMP'ed kernel? If it is disabled just print "0". It will simplify > parsing of /proc/pid/status. I disagree -- if the line is missing it means the kernel doesn't support it, which is a different state from seccomp being inactive in the process. And since other things when not built into the kernel are similarly missing from status, this is the consistent behavior for such situations. -Kees -- 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/