linux-mips
[Top] [All Lists]

Re: [RFC 5/5] x86,seccomp: Add a seccomp fastpath

To: Andy Lutomirski <luto@amacapital.net>
Subject: Re: [RFC 5/5] x86,seccomp: Add a seccomp fastpath
From: Kees Cook <keescook@chromium.org>
Date: Wed, 11 Jun 2014 15:32:49 -0700
Cc: "H. Peter Anvin" <hpa@zytor.com>, Alexei Starovoitov <alexei.starovoitov@gmail.com>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Will Drewry <wad@chromium.org>, Oleg Nesterov <oleg@redhat.com>, X86 ML <x86@kernel.org>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org>, linux-mips@linux-mips.org, linux-arch <linux-arch@vger.kernel.org>, LSM List <linux-security-module@vger.kernel.org>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=quwYIzjGKU2lNSsuxG/1WesY2jD5wQu5wzA5LSHV5rE=; b=csJ6xqQrOoXlfmeWpJFq8wSwHe1jFitwmP8Gaug60OAafT8GFjdS/hYiHXQ6ixPsa2 SX9N5bo4J38AhPdAUo9Bb5kCGnEpCWTRMRg4KnxkzsAYydSuYkZ+TPiK408WSK1AE6iq HEwGUuSgetenIBZkiMChDjdWk13aOPhQGg71WPmP9zCvAj+Pt+odUiyBxrWot4bbQzQb Lzp3k26eBdGMqAvvDNr1bwBPm2So3iTpmNocLc5R8WQjB2Xfo1zTFW/ao0VmBEsIDxBh 0jZmkLEQGCSMSydjwecLfpepcGUe4HBavW7JQfw1HDqcuzzQ84oult3dzjbAU76VKZqd 6rFg==
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=quwYIzjGKU2lNSsuxG/1WesY2jD5wQu5wzA5LSHV5rE=; b=M96L/mg6cKTw+Qki4YVdErScE834yu5OxKOxnTlzvVFjjKduXYFF5hp96tYsTFv7av JLd81dOH51GaOD5ug8iKGjRZ6kkvzeP1DEvnJ3g9PKkksURWCrAgWxEmXQ9LI8GHqeJh Cz5ay8OE04InuBbyFySn4O3cB5TsEIjZ40SVE=
In-reply-to: <CALCETrWaQZc124=6r4h+fTAY4H4LzWGFw=MB7KY5TBtB0jx9hA@mail.gmail.com>
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: <cover.1402517933.git.luto@amacapital.net> <9e11cd988a0f120606e37b5e275019754e2774da.1402517933.git.luto@amacapital.net> <CAADnVQKt5FnShkZeQewbfnU1kHM-gLs3hCZMf5xcgFzyRDLX7A@mail.gmail.com> <CALCETrXoqqKC=T5Wvj+CDYQFte1s_=npDvQ2UYW0j=AanEgR1g@mail.gmail.com> <5398D59A.3030900@zytor.com> <CALCETrVMxkHcPXsEGtEc0Pr=Z80CzC0zWaQ9OdVdxi1CGuB4kQ@mail.gmail.com> <5398D7B4.5000303@zytor.com> <CALCETrWaQZc124=6r4h+fTAY4H4LzWGFw=MB7KY5TBtB0jx9hA@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
On Wed, Jun 11, 2014 at 3:28 PM, Andy Lutomirski <luto@amacapital.net> wrote:
> On Wed, Jun 11, 2014 at 3:27 PM, H. Peter Anvin <hpa@zytor.com> wrote:
>> On 06/11/2014 03:22 PM, Andy Lutomirski wrote:
>>> On Wed, Jun 11, 2014 at 3:18 PM, H. Peter Anvin <hpa@zytor.com> wrote:
>>>> On 06/11/2014 02:56 PM, Andy Lutomirski wrote:
>>>>>
>>>>> 13ns is with the simplest nonempty filter.  I hope that empty filters
>>>>> don't work.
>>>>>
>>>>
>>>> Why wouldn't they?
>>>
>>> Is it permissible to fall off the end of a BPF program?  I'm getting
>>> EINVAL trying to install an actual empty filter.  The filter I tested
>>> with was:
>>>
>>
>> What I meant was that there has to be a well-defined behavior for the
>> program falling off the end anyway, and that that should be preserved.
>>
>> I guess it is possible to require that all code paths must provably
>> reach a termination point.
>>
>
> Dunno.  I haven't ever touched any of the actual BPF code.  This whole
> patchset only changes the code that invokes the BPF evaluator.

Yes, this is how BPF works: runs to the end or exit early. With
seccomp BPF specifically, the return value defaults to kill the
process. If a filter was missing (NULL), or empty, or didn't
explicitly return with a new value, the default (kill) should be
taken.

-Kees

-- 
Kees Cook
Chrome OS Security

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