summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorPetr Machata2018-11-20 12:39:56 +0100
committerGreg Kroah-Hartman2018-12-05 19:31:59 +0100
commit4aaa233c79f69b6ec0ec5ce50e29ab144901838f (patch)
treef5a5c609461a3b39972a7c755a770ca5f88f0342 /net/core
parentnet: thunderx: set xdp_prog to NULL if bpf_prog_add fails (diff)
downloadkernel-qcow2-linux-4aaa233c79f69b6ec0ec5ce50e29ab144901838f.tar.gz
kernel-qcow2-linux-4aaa233c79f69b6ec0ec5ce50e29ab144901838f.tar.xz
kernel-qcow2-linux-4aaa233c79f69b6ec0ec5ce50e29ab144901838f.zip
net: skb_scrub_packet(): Scrub offload_fwd_mark
[ Upstream commit b5dd186d10ba59e6b5ba60e42b3b083df56df6f3 ] When a packet is trapped and the corresponding SKB marked as already-forwarded, it retains this marking even after it is forwarded across veth links into another bridge. There, since it ingresses the bridge over veth, which doesn't have offload_fwd_mark, it triggers a warning in nbp_switchdev_frame_mark(). Then nbp_switchdev_allowed_egress() decides not to allow egress from this bridge through another veth, because the SKB is already marked, and the mark (of 0) of course matches. Thus the packet is incorrectly blocked. Solve by resetting offload_fwd_mark() in skb_scrub_packet(). That function is called from tunnels and also from veth, and thus catches the cases where traffic is forwarded between bridges and transformed in a way that invalidates the marking. Fixes: 6bc506b4fb06 ("bridge: switchdev: Add forward mark support for stacked devices") Fixes: abf4bb6b63d0 ("skbuff: Add the offload_mr_fwd_mark field") Signed-off-by: Petr Machata <petrm@mellanox.com> Suggested-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/skbuff.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index f817f336595d..abbbd7fd17fe 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -4912,6 +4912,11 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet)
nf_reset(skb);
nf_reset_trace(skb);
+#ifdef CONFIG_NET_SWITCHDEV
+ skb->offload_fwd_mark = 0;
+ skb->offload_mr_fwd_mark = 0;
+#endif
+
if (!xnet)
return;