Skip to content

Commit de2c211

Browse files
LPhghPaolo Abeni
authored andcommitted
ipvs: Always clear ipvs_property flag in skb_scrub_packet()
We found an issue when using bpf_redirect with ipvs NAT mode after commit ff70202 ("dev_forward_skb: do not scrub skb mark within the same name space"). Particularly, we use bpf_redirect to return the skb directly back to the netif it comes from, i.e., xnet is false in skb_scrub_packet(), and then ipvs_property is preserved and SNAT is skipped in the rx path. ipvs_property has been already cleared when netns is changed in commit 2b5ec1a ("netfilter/ipvs: clear ipvs_property flag when SKB net namespace changed"). This patch just clears it in spite of netns. Fixes: 2b5ec1a ("netfilter/ipvs: clear ipvs_property flag when SKB net namespace changed") Signed-off-by: Philo Lu <[email protected]> Acked-by: Julian Anastasov <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 29b036b commit de2c211

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/core/skbuff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6033,11 +6033,11 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet)
60336033
skb->offload_fwd_mark = 0;
60346034
skb->offload_l3_fwd_mark = 0;
60356035
#endif
6036+
ipvs_reset(skb);
60366037

60376038
if (!xnet)
60386039
return;
60396040

6040-
ipvs_reset(skb);
60416041
skb->mark = 0;
60426042
skb_clear_tstamp(skb);
60436043
}

0 commit comments

Comments
 (0)