linux-mips
[Top] [All Lists]

Re: [PATCH v7 2/9] seccomp: split filter prep from check and apply

To: Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH v7 2/9] seccomp: split filter prep from check and apply
From: David Drysdale <drysdale@google.com>
Date: Thu, 26 Jun 2014 13:37:10 +0100
Cc: linux-kernel@vger.kernel.org, Andy Lutomirski <luto@amacapital.net>, Alexei Starovoitov <ast@plumgrid.com>, "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>, Andrew Morton <akpm@linux-foundation.org>, Daniel Borkmann <dborkman@redhat.com>, Oleg Nesterov <oleg@redhat.com>, Will Drewry <wad@chromium.org>, Julien Tinnes <jln@chromium.org>, linux-api@vger.kernel.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@linux-mips.org, linux-arch@vger.kernel.org, linux-security-module@vger.kernel.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=WJJLzoKtHRsLX63zBjvhkPte8WIkTtg1XKamPF1nlEQ=; b=n1czxBWwwQEgcG7cbwcBnE8mF57JKCxX6zmx3+TQuhJja2bBrSXX1phTNBM7HJwNeX IARU8pfJXM6s+w6iR/u+aIawSdv1cGQO1ClMf45kW9CqGAI3uLdQXVwJeUQsmWGx9Qps r1kVndOdiQISHyGLp5iuKTQcYb6NpOfBfawlPF4QZlXcjT1z8Rvr2N90SnrufLofCTki 5bEEOFRiQt8nZy7uvj2nOKKjrnn5au4J0Ol7yKexqIqAjoWHAWdFz+tz+oDSpC0x51Df Nh4QvuSbbRP/9+WjwQAud1BSbkjzc/B+4Leg0tO05QgxwaIUl5iyeMM/Poc/sQv6rRfk JqDg==
In-reply-to: <1403560693-21809-3-git-send-email-keescook@chromium.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1403560693-21809-1-git-send-email-keescook@chromium.org> <1403560693-21809-3-git-send-email-keescook@chromium.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Jun 23, 2014 at 02:58:06PM -0700, Kees Cook wrote:
> In preparation for adding seccomp locking, move filter creation away
> from where it is checked and applied. This will allow for locking where
> no memory allocation is happening. The validation, filter attachment,
> and seccomp mode setting can all happen under the future locks.
> 
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
>  kernel/seccomp.c |   97 
> +++++++++++++++++++++++++++++++++++++-----------------
>  1 file changed, 67 insertions(+), 30 deletions(-)
> 
> diff --git a/kernel/seccomp.c b/kernel/seccomp.c
> index afb916c7e890..edc8c79ed16d 100644
> --- a/kernel/seccomp.c
> +++ b/kernel/seccomp.c
> @@ -515,6 +551,7 @@ static long seccomp_set_mode(unsigned long seccomp_mode, 
> char __user *filter)
>       current->seccomp.mode = seccomp_mode;
>       set_thread_flag(TIF_SECCOMP);
>  out:
> +     seccomp_filter_free(prepared);
>       return ret;
>  }

I think this needs to be inside #ifdef CONFIG_SECCOMP_FILTER to match
the definition of seccomp_filter_free:

../kernel/seccomp.c:554:2: error: implicit declaration of function 
‘seccomp_filter_free’ [-Werror=implicit-function-declaration]



<Prev in Thread] Current Thread [Next in Thread>