bpf, skb_do_redirect: clear sender_cpu before xmit
authorDaniel Borkmann <daniel@iogearbox.net>
Wed, 7 Oct 2015 08:16:09 +0000 (10:16 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Oct 2015 12:03:08 +0000 (05:03 -0700)
Similar to commit c29390c6dfee ("xps: must clear sender_cpu before
forwarding"), we also need to clear the skb->sender_cpu when moving
from RX to TX via skb_do_redirect() due to the shared location of
napi_id (used on RX) and sender_cpu (used on TX).

Fixes: 27b29f63058d ("bpf: add bpf_redirect() helper")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/filter.c

index da3e5357f13866424f53d939f9ea4fb96f71d36d..8f4603c712cd08ff9899cb7766c7bfed9184ad7d 100644 (file)
@@ -1462,6 +1462,7 @@ int skb_do_redirect(struct sk_buff *skb)
                return dev_forward_skb(dev, skb);
 
        skb->dev = dev;
+       skb_sender_cpu_clear(skb);
        return dev_queue_xmit(skb);
 }