Re: [PATCH net] bpf: fix two bugs in verification logic when accessing 'ctx' pointer

2015-04-16 Thread David Miller
From: Alexei Starovoitov Date: Wed, 15 Apr 2015 16:19:33 -0700 > 1. > first bug is a silly mistake. It broke tracing examples and prevented > simple bpf programs from loading. ... > 2. > second bug is more subtle. > If malicious code is using the same dest register as source register, > the chec

[PATCH net] bpf: fix two bugs in verification logic when accessing 'ctx' pointer

2015-04-15 Thread Alexei Starovoitov
1. first bug is a silly mistake. It broke tracing examples and prevented simple bpf programs from loading. In the following code: if (insn->imm == 0 && BPF_SIZE(insn->code) == BPF_W) { } else if (...) { // this part should have been executed when // insn->code == BPF_W and insn->imm != 0 } Ob