Skip to content

Commit b8fb4e0

Browse files
tgrafdavem330
authored andcommitted
net: Reset secmark when scrubbing packet
skb_scrub_packet() is called when a packet switches between a context such as between underlay and overlay, between namespaces, or between L3 subnets. While we already scrub the packet mark, connection tracking entry, and cached destination, the security mark/context is left intact. It seems wrong to inherit the security context of a packet when going from overlay to underlay or across forwarding paths. Signed-off-by: Thomas Graf <tgraf@suug.ch> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 796f2da commit b8fb4e0

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎net/core/skbuff.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4148,6 +4148,7 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet)
41484148
skb->ignore_df = 0;
41494149
skb_dst_drop(skb);
41504150
skb->mark = 0;
4151+
skb_init_secmark(skb);
41514152
secpath_reset(skb);
41524153
nf_reset(skb);
41534154
nf_reset_trace(skb);

0 commit comments

Comments
 (0)