Thread (24 messages) flat view 24 messages, 6 authors, 2014-08-26

Re: [PATCH v6 net-next 1/6] net: filter: add "load 64-bit immediate" eBPF instruction

From: Andy Lutomirski <hidden>
Date: 2014-08-26 01:38:51
Also in: linux-api, lkml

On Mon, Aug 25, 2014 at 6:35 PM, Alexei Starovoitov [off-list ref] wrote:
On Mon, Aug 25, 2014 at 6:06 PM, David Miller [off-list ref] wrote:
quoted
From: Alexei Starovoitov <ast-uqk4Ao+rVK5Wk0Htik3J/w@public.gmane.org>
Date: Mon, 25 Aug 2014 18:00:53 -0700
quoted
add BPF_LD_IMM64 instruction to load 64-bit immediate value into a register.
I think you need to rethink this.

I understand that you want to be able to compile arbitrary C code into
eBPF, but you have to restrict strongly what data the eBPF code can get
to.
I believe verifier already does restrict it. I don't see any holes in
the architecture. I'm probably not explaining it clearly though :(
quoted
Arbitrary pointer loads is asking for trouble.
Of course.
There is no arbitrary pointer from user space.
Verifier checks all pointers.
I guess this commit log description is confusing.
It says:
BPF_LD_IMM64(R1, const_imm_map_ptr)
that's what appears in the program _after_ it goes through verifier.
User space cannot pass a pointer into the kernel.
If you don't intend for userspace to load a program that contains this
instruction, then why does it need to be an instruction that the
verifier rewrites?  Why not have an instruction "load immediate
relocated pointer" that contains a reference to a relocation table and
have the JIT do it?  That might be easier to understand than having
the verifier do it, and it'll avoid committing to ABIs before we need
them.

--Andy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help