Skip to content

Commit b5dd186

Browse files
pmachatadavem330
authored andcommitted
net: skb_scrub_packet(): Scrub offload_fwd_mark
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: 6bc506b ("bridge: switchdev: Add forward mark support for stacked devices") Fixes: abf4bb6 ("skbuff: Add the offload_mr_fwd_mark field") Signed-off-by: Petr Machata <[email protected]> Suggested-by: Ido Schimmel <[email protected]> Acked-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f2cbd48 commit b5dd186

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

net/core/skbuff.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4854,6 +4854,11 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet)
48544854
nf_reset(skb);
48554855
nf_reset_trace(skb);
48564856

4857+
#ifdef CONFIG_NET_SWITCHDEV
4858+
skb->offload_fwd_mark = 0;
4859+
skb->offload_mr_fwd_mark = 0;
4860+
#endif
4861+
48574862
if (!xnet)
48584863
return;
48594864

0 commit comments

Comments
 (0)