[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMEtUuyoWELJ0Yf+=5sDKxFEfgsiQ3kMCK+Wn_bdJgS8qaH2og@mail.gmail.com>
Date: Tue, 2 Sep 2014 14:31:47 -0700
From: Alexei Starovoitov <ast@...mgrid.com>
To: Hannes Frederic Sowa <hannes@...essinduktion.org>
Cc: Network Development <netdev@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Brad Spengler <spender@...ecurity.net>,
Daniel Borkmann <dborkman@...hat.com>,
Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH net-next v2] net: bpf: make eBPF interpreter images read-only
On Tue, Sep 2, 2014 at 1:53 PM, Hannes Frederic Sowa
<hannes@...essinduktion.org> wrote:
> From: Daniel Borkmann <dborkman@...hat.com>
>
> With eBPF getting more extended and exposure to user space is on it's way,
> hardening the memory range the interpreter uses to steer its command flow
> seems appropriate. This patch moves the to be interpreted bytecode to
> read-only pages.
...
> 11 files changed, 144 insertions(+), 32 deletions(-)
nice. quite short.
> +#ifdef CONFIG_DEBUG_SET_MODULE_RONX
> +static inline void bpf_prog_lock_ro(struct bpf_prog *fp)
> +{
> + set_memory_ro((unsigned long)fp, fp->pages);
since ronx are ifdef checked together,
would probably make sense to set nx too?
> +static inline void bpf_prog_unlock_ro(struct bpf_prog *fp)
> +{
> + set_memory_rw((unsigned long)fp, fp->pages);
why rw is needed?
since fp is allocated with vmalloc, vfree doesn't need
to touch the pages to free them, no?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists