Re: [PATCH net] bpf: don't select potentially stale ri->map from buggy xdp progs

2017-09-08 Thread Jesper Dangaard Brouer
On Fri, 08 Sep 2017 14:34:13 +0200 Daniel Borkmann wrote: > On 09/08/2017 01:52 PM, Jesper Dangaard Brouer wrote: > > On Fri, 08 Sep 2017 12:34:28 +0200 Daniel Borkmann > > wrote: > >> On 09/08/2017 07:06 AM, Jesper Dangaard Brouer wrote: > >>> On Fri, 8 Sep 2017 00:14:51 +0200 > >>> Danie

Re: [PATCH net] bpf: don't select potentially stale ri->map from buggy xdp progs

2017-09-08 Thread Daniel Borkmann
On 09/08/2017 01:52 PM, Jesper Dangaard Brouer wrote: On Fri, 08 Sep 2017 12:34:28 +0200 Daniel Borkmann wrote: On 09/08/2017 07:06 AM, Jesper Dangaard Brouer wrote: On Fri, 8 Sep 2017 00:14:51 +0200 Daniel Borkmann wrote: + /* This is really only caused by a deliberately crappy +

Re: [PATCH net] bpf: don't select potentially stale ri->map from buggy xdp progs

2017-09-08 Thread Jesper Dangaard Brouer
On Fri, 08 Sep 2017 12:34:28 +0200 Daniel Borkmann wrote: > On 09/08/2017 07:06 AM, Jesper Dangaard Brouer wrote: > > On Fri, 8 Sep 2017 00:14:51 +0200 > > Daniel Borkmann wrote: > > > >> + /* This is really only caused by a deliberately crappy > >> + * BPF program, normally we would never

Re: [PATCH net] bpf: don't select potentially stale ri->map from buggy xdp progs

2017-09-08 Thread Daniel Borkmann
On 09/08/2017 07:06 AM, Jesper Dangaard Brouer wrote: On Fri, 8 Sep 2017 00:14:51 +0200 Daniel Borkmann wrote: + /* This is really only caused by a deliberately crappy +* BPF program, normally we would never hit that case, +* so no need to inform someone via tracepoints

Re: [PATCH net] bpf: don't select potentially stale ri->map from buggy xdp progs

2017-09-07 Thread Jesper Dangaard Brouer
On Fri, 8 Sep 2017 00:14:51 +0200 Daniel Borkmann wrote: > + /* This is really only caused by a deliberately crappy > + * BPF program, normally we would never hit that case, > + * so no need to inform someone via tracepoints either, > + * just bail out. > + */ > + if

Re: [PATCH net] bpf: don't select potentially stale ri->map from buggy xdp progs

2017-09-07 Thread Alexei Starovoitov
On 9/7/17 3:14 PM, Daniel Borkmann wrote: Fixes: 97f91a7cf04f ("bpf: add bpf_redirect_map helper routine") Reported-by: Jesper Dangaard Brouer Signed-off-by: Daniel Borkmann Signed-off-by: John Fastabend --- kernel/bpf/verifier.c | 16 net/core/filter.c | 21 +

[PATCH net] bpf: don't select potentially stale ri->map from buggy xdp progs

2017-09-07 Thread Daniel Borkmann
We can potentially run into a couple of issues with the XDP bpf_redirect_map() helper. The ri->map in the per CPU storage can become stale in several ways, mostly due to misuse, where we can then trigger a use after free on the map: i) prog A is calling bpf_redirect_map(), returning XDP_REDIRECT a