Thread (62 messages) 62 messages, 8 authors, 2014-07-05

Re: [PATCH RFC net-next 08/14] bpf: add eBPF verifier

From: Alexei Starovoitov <hidden>
Date: 2014-07-03 00:01:27
Also in: lkml, netdev

On Wed, Jul 2, 2014 at 4:35 PM, Chema Gonzalez [off-list ref] wrote:
On Wed, Jul 2, 2014 at 4:04 PM, Alexei Starovoitov [off-list ref] wrote:
quoted
quoted
quoted
+       reg = regs + BPF_REG_1; /* 1st arg to a function */
+       reg->ptr = PTR_TO_CTX;
Wait, doesn't this depend on doing "BPF_MOV64_REG(BPF_REG_CTX,
BPF_REG_ARG1)" (the bpf-to-ebpf prologue), which is only enforced on
filters converted from bpf? In fact, shouldn't this set
regs[BPF_REG_CTX] instead of regs[BPF_REG_1] ?
nope. it's REG_1.
as you said r6=r1 is only emitted by converted classic filters.
Verifier will see this 'r6=r1' assignment and will copy the r1 type into r6.
You're right. I read BPF_MOV64_REG() AT&T-syntax-style.

BTW, check_stack_write() in kernel/bpf/verifier.c has a couple of
assignments of a slot->ptr to 0 (instead of INVALID_PTR). I assume
this is unintended.
yes. good catch. Will fix it.
Too bad C compiler silently casts integers to enums
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help