From: Thomas Graf Date: Tue, 23 Dec 2014 00:13:18 +0000 (+0100) Subject: net: Reset secmark when scrubbing packet X-Git-Tag: v3.18.4~167 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=253ab5247813de6ce1d5efcdf9bf7cde749d8597;p=platform%2Fkernel%2Flinux-stable.git net: Reset secmark when scrubbing packet [ Upstream commit b8fb4e0648a2ab3734140342002f68fb0c7d1602 ] 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 Acked-by: Flavio Leitner Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 32e31c299631..d7543d0fd744 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -4040,6 +4040,7 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet) skb->ignore_df = 0; skb_dst_drop(skb); skb->mark = 0; + skb_init_secmark(skb); secpath_reset(skb); nf_reset(skb); nf_reset_trace(skb);