Re: [V2 PATCH net-next 2/2] xdp: catch invalid XDP_REDIRECT API usage

2017-09-07 Thread Daniel Borkmann
On 09/07/2017 04:13 PM, Daniel Borkmann wrote: [...] +uint64_t addr = (unsigned long)prog; And of course: s/uint64_t/u64/. Lack of context switch. ;-)

Re: [V2 PATCH net-next 2/2] xdp: catch invalid XDP_REDIRECT API usage

2017-09-07 Thread Daniel Borkmann
Hey Jesper, On 09/07/2017 02:33 PM, Jesper Dangaard Brouer wrote: Catch different invalid XDP_REDIRECT and bpf_redirect_map API usage. It is fairly easy to create a dangling redirect_info->map pointer, which (until John or Daniel fix this) can crash the kernel. [...] Here's what I wrote up ye

[V2 PATCH net-next 2/2] xdp: catch invalid XDP_REDIRECT API usage

2017-09-07 Thread Jesper Dangaard Brouer
Catch different invalid XDP_REDIRECT and bpf_redirect_map API usage. It is fairly easy to create a dangling redirect_info->map pointer, which (until John or Daniel fix this) can crash the kernel. The intended usage of the BPF helper bpf_redirect_map(), is to return XDP_REDIRECT action after invok