Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8096325imu; Tue, 4 Dec 2018 02:56:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/WMrNohl5pDed8CsH4/pzyQH6y+IXSoaevne4BbKKXo2RXCSrUnaHmtYxlVqasvxClLbOXO X-Received: by 2002:a63:b218:: with SMTP id x24mr15875080pge.223.1543921019620; Tue, 04 Dec 2018 02:56:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543921019; cv=none; d=google.com; s=arc-20160816; b=NkTI3Hdpl4Ipexn6AAXhtzGLsMhc0CkQ9lwcNIx5JJCCmVwZ0rE8IZ0QHvKn92gFwj tk+xhW0me7ZIHgY9F7jKKnEtsoHAEXTBjXkQmuwOe4wPngujXVC112Wn17f5oDzH9gMC z2BP4OIGTIcPTTzUtV7nT3azJOMe/AUpM1jvdOzRdL7WFYQbw06M3/cn9EjBA7rJvhIl HoYsklJ0enODquN6aKZuUcW0nHEimJU7J3RHfW09WmEzYsczJ1Yehrh0AVpgBBnQUS+O kP3+TR+vIDI8qw/qwONoDt0MSpFtT6vHzEmviUolNZC+4EAE/v+ROqfdCeq9dfoIR6cP Yj1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hLNALMPZy2WImP+GFvt8qG081a6J04QoafdaB1kPoqY=; b=E2pC2l2HPEjxPGO6FNOaWdrkrNYpDBhDYhODG2sUw9pAySHYqqGRfL6KA52qzs15aX PnEGwHyPHvnklN9XP1xBJtgA1a3I3eXqPoJQrCv1MZ69XiwHzjhCXF5j2dUwMXak7UUd sMlQzrJnfIflgthfyB+1aILOuCWiN3HY/2b5uFhHDQTnPapGg35iahTbzINj61OHd4Zw d9IQgqwmZenyjh+O4hxNCxvj4ilqwtlJizrtykFBmrP+q5nsCD2K6pvLBooAOJZMlOn/ 8T7CjCMECGeHvcUXhtAg3VYgeUPpoYMg1DdHNAkdTFnwTlk32wKVo4qyB0f9ynFFdeT1 qWPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S8CGjNLB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m7si14859481pgi.547.2018.12.04.02.56.44; Tue, 04 Dec 2018 02:56:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S8CGjNLB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726341AbeLDKzs (ORCPT + 99 others); Tue, 4 Dec 2018 05:55:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:38686 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726321AbeLDKzp (ORCPT ); Tue, 4 Dec 2018 05:55:45 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6B5B8214C1; Tue, 4 Dec 2018 10:55:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543920944; bh=R0mJtqZce4o6Y/HgqXNN/jURM/VpDgiINhL/DoQCFwU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S8CGjNLBqLgD1lcoBZz1jgxUv6H7oBfWTh4WYvm7byFE76YHUUlIF5wI/tuXxyamN PzR2MBmKVFONQqedtjPXJr+MSU4EVYJQZYvcP0j+5abOGemez8I2mdiG6jF7zmmXhq JNKXR6IH6E4o9v7K6TwIso4ZiX6TLONsBUVR8tBc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Petr Machata , Ido Schimmel , Jiri Pirko , "David S. Miller" Subject: [PATCH 4.19 020/139] net: skb_scrub_packet(): Scrub offload_fwd_mark Date: Tue, 4 Dec 2018 11:48:21 +0100 Message-Id: <20181204103650.809480977@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181204103649.950154335@linuxfoundation.org> References: <20181204103649.950154335@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Petr Machata [ Upstream commit b5dd186d10ba59e6b5ba60e42b3b083df56df6f3 ] When a packet is trapped and the corresponding SKB marked as already-forwarded, it retains this marking even after it is forwarded across veth links into another bridge. There, since it ingresses the bridge over veth, which doesn't have offload_fwd_mark, it triggers a warning in nbp_switchdev_frame_mark(). Then nbp_switchdev_allowed_egress() decides not to allow egress from this bridge through another veth, because the SKB is already marked, and the mark (of 0) of course matches. Thus the packet is incorrectly blocked. Solve by resetting offload_fwd_mark() in skb_scrub_packet(). That function is called from tunnels and also from veth, and thus catches the cases where traffic is forwarded between bridges and transformed in a way that invalidates the marking. Fixes: 6bc506b4fb06 ("bridge: switchdev: Add forward mark support for stacked devices") Fixes: abf4bb6b63d0 ("skbuff: Add the offload_mr_fwd_mark field") Signed-off-by: Petr Machata Suggested-by: Ido Schimmel Acked-by: Jiri Pirko Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/skbuff.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -4912,6 +4912,11 @@ void skb_scrub_packet(struct sk_buff *sk nf_reset(skb); nf_reset_trace(skb); +#ifdef CONFIG_NET_SWITCHDEV + skb->offload_fwd_mark = 0; + skb->offload_mr_fwd_mark = 0; +#endif + if (!xnet) return;