]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: Reset secmark when scrubbing packet
authorThomas Graf <tgraf@suug.ch>
Tue, 23 Dec 2014 00:13:18 +0000 (01:13 +0100)
committerLuis Henriques <luis.henriques@canonical.com>
Mon, 19 Jan 2015 11:25:26 +0000 (11:25 +0000)
commit b8fb4e0648a2ab3734140342002f68fb0c7d1602 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: Thomas Graf <tgraf@suug.ch>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
net/core/skbuff.c

index f5f14d54d6a263391d2cd54ab37d1baf23beb550..fe07faaed256190a4b808d7e75de40796875062c 100644 (file)
@@ -3933,6 +3933,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);