From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759909AbbAYTa6 (ORCPT ); Sun, 25 Jan 2015 14:30:58 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:57362 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754543AbbAYSIx (ORCPT ); Sun, 25 Jan 2015 13:08:53 -0500 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Graf , Flavio Leitner , "David S. Miller" Subject: [PATCH 3.14 10/98] net: Reset secmark when scrubbing packet Date: Sun, 25 Jan 2015 10:06:28 -0800 Message-Id: <20150125180713.306411907@linuxfoundation.org> X-Mailer: git-send-email 2.2.2 In-Reply-To: <20150125180712.859646324@linuxfoundation.org> References: <20150125180712.859646324@linuxfoundation.org> User-Agent: quilt/0.63-1 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Graf [ 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 --- net/core/skbuff.c | 1 + 1 file changed, 1 insertion(+) --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -3937,6 +3937,7 @@ void skb_scrub_packet(struct sk_buff *sk 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);