Commit a6dd2222 authored by Thomas Graf's avatar Thomas Graf Committed by Luis Henriques

net: Reset secmark when scrubbing packet

commit b8fb4e06 upstream.

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: default avatarThomas Graf <tgraf@suug.ch>
Acked-by: default avatarFlavio Leitner <fbl@sysclose.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent db6ed1cc
...@@ -3933,6 +3933,7 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet) ...@@ -3933,6 +3933,7 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet)
skb->ignore_df = 0; skb->ignore_df = 0;
skb_dst_drop(skb); skb_dst_drop(skb);
skb->mark = 0; skb->mark = 0;
skb_init_secmark(skb);
secpath_reset(skb); secpath_reset(skb);
nf_reset(skb); nf_reset(skb);
nf_reset_trace(skb); nf_reset_trace(skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment