[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170406125513.GA56553@ast-mbp.thefacebook.com>
Date: Thu, 6 Apr 2017 08:55:14 -0400
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Tycho Andersen <tycho@...ker.com>
Cc: Kees Cook <keescook@...omium.org>,
Daniel Borkmann <daniel@...earbox.net>,
Alexei Starovoitov <ast@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Network Development <netdev@...r.kernel.org>,
"kernel-hardening@...ts.openwall.com"
<kernel-hardening@...ts.openwall.com>,
Mickaël Salaün <mic@...ikod.net>
Subject: Re: [PATCH] ebpf: verify the output of the JIT
On Tue, Apr 04, 2017 at 09:45:36PM -0600, Tycho Andersen wrote:
> Hi Kees,
>
> On Tue, Apr 04, 2017 at 03:17:57PM -0700, Kees Cook wrote:
> > On Tue, Apr 4, 2017 at 3:08 PM, Tycho Andersen <tycho@...ker.com> wrote:
> > > The goal of this patch is to protect the JIT against an attacker with a
> > > write-in-memory primitive. The JIT allocates a buffer which will eventually
> > > be marked +x, so we need to make sure that what was written to this buffer
> > > is what was intended.
> > >
> > > We acheive this by building a hash of the instruction buffer as
> > > instructions are emittted and then comparing that to a hash at the end of
> > > the JIT compile after the buffer has been marked read-only.
> > >
> > > Signed-off-by: Tycho Andersen <tycho@...ker.com>
> > > CC: Daniel Borkmann <daniel@...earbox.net>
> > > CC: Alexei Starovoitov <ast@...nel.org>
> > > CC: Kees Cook <keescook@...omium.org>
> > > CC: Mickaël Salaün <mic@...ikod.net>
> >
> > Cool! This closes the race condition on producing the JIT vs going
> > read-only. I wonder if it might be possible to make this a more
> > generic interface to the BPF which would be allocate the hash, provide
> > the update callback during emit, and then do the hash check itself at
> > the end of bpf_jit_binary_lock_ro()?
>
> Yes, probably so. I can look into that for the next version.
Nack.
Please stop wasting yours and our time with buggy code that pretends
to fix a problem that doesn't exist.
This security paranoia around JIT must stop.
Make sure that CONFIG_BPF_JIT is off in your system.
Powered by blists - more mailing lists