Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1617975

Re: [PATCH] ebpf: verify the output of the JIT

From Alexei Starovoitov <alexei.starovoitov@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] ebpf: verify the output of the JIT
Date 2017-04-06 15:00 +0200
Message-ID <ttfb4-cf-15@gated-at.bofh.it> (permalink)
References <tsEXU-2s7-23@gated-at.bofh.it> <tsEXU-2s7-21@gated-at.bofh.it> <tsK7f-5H7-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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@docker.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@docker.com>
> > > CC: Daniel Borkmann <daniel@iogearbox.net>
> > > CC: Alexei Starovoitov <ast@kernel.org>
> > > CC: Kees Cook <keescook@chromium.org>
> > > CC: Mickaël Salaün <mic@digikod.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.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] ebpf: verify the output of the JIT Tycho Andersen <tycho@docker.com> - 2017-04-05 00:20 +0200
  Re: [PATCH] ebpf: verify the output of the JIT Kees Cook <keescook@chromium.org> - 2017-04-05 00:20 +0200
    Re: [PATCH] ebpf: verify the output of the JIT Tycho Andersen <tycho@docker.com> - 2017-04-05 05:50 +0200
      Re: [PATCH] ebpf: verify the output of the JIT Alexei Starovoitov <alexei.starovoitov@gmail.com> - 2017-04-06 15:00 +0200

csiph-web