Re: [PATCH net-next] bpf: fix cb access in socket filter programs

2015-10-07 Thread Alexei Starovoitov
On 10/7/15 6:09 AM, Daniel Borkmann wrote: bpf_prog_run_clear_cb() wouldn't work on dev_forward_skb() as skb->pkt_type is then being scrubbed to PACKET_HOST, so on the receive path, AF_PACKET might not always see clean skbs->cb[] as assumed ... I think that the skb->pkt_type part needs to be drop

Re: [PATCH net-next] bpf: fix cb access in socket filter programs

2015-10-07 Thread Daniel Borkmann
On 10/07/2015 11:39 AM, Daniel Borkmann wrote: On 10/07/2015 04:18 AM, Alexei Starovoitov wrote: eBPF socket filter programs may see junk in 'u32 cb[5]' area, since it could have been used by protocol layers earlier. On the receive path the af_packet sees clean skb->cb. On the xmit the dev_queu

Re: [PATCH net-next] bpf: fix cb access in socket filter programs

2015-10-07 Thread Daniel Borkmann
On 10/07/2015 04:18 AM, Alexei Starovoitov wrote: eBPF socket filter programs may see junk in 'u32 cb[5]' area, since it could have been used by protocol layers earlier. On the receive path the af_packet sees clean skb->cb. On the xmit the dev_queue_xmit_nit() delivers cloned skb, so we can cond

[PATCH net-next] bpf: fix cb access in socket filter programs

2015-10-06 Thread Alexei Starovoitov
eBPF socket filter programs may see junk in 'u32 cb[5]' area, since it could have been used by protocol layers earlier. On the receive path the af_packet sees clean skb->cb. On the xmit the dev_queue_xmit_nit() delivers cloned skb, so we can conditionally clean 20 bytes of skb->cb that could be us