summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2014-12-23 01:13:18 +0100
committerJiri Slaby <jslaby@suse.cz>2015-01-26 14:39:16 +0100
commit00c47292b1cdf7e721dccc5659879732eca6451a (patch)
tree58db3c817d663fed781e8351f40e792efdcd50f1 /net/core
parent6e1a8eb4ed3f954059ffae5563710275bc63d4fa (diff)
downloadlwn-00c47292b1cdf7e721dccc5659879732eca6451a.tar.gz
lwn-00c47292b1cdf7e721dccc5659879732eca6451a.zip
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 <tgraf@suug.ch> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/skbuff.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index a8cf33868f9c..17313d17a923 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3523,6 +3523,7 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet)
skb->local_df = 0;
skb_dst_drop(skb);
skb->mark = 0;
+ skb_init_secmark(skb);
secpath_reset(skb);
nf_reset(skb);
nf_reset_trace(skb);