Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2109744ioo; Mon, 23 May 2022 10:15:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0xw4HWQaxig2Jf9MGrA4DOYeFJsme5/AGkHVvMw6FE5lVY2AHnRkNwzDw3QpBoHBz90Lt X-Received: by 2002:a17:902:b692:b0:14c:935b:2b03 with SMTP id c18-20020a170902b69200b0014c935b2b03mr23681625pls.81.1653326111003; Mon, 23 May 2022 10:15:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653326110; cv=none; d=google.com; s=arc-20160816; b=hPgguBEPzyh/5bxN8zevTVKlYzIPIP7RAYkjNjGswf1qQ+alMVKZMrWsnjmzlJ77Ep zjguhmppPsZEeEigu1T+fZGlsSY1rolw1DUk05nVt7Am7aPfTcCgmUzQaZzQk4BiaCnl i1Ss4zekM97RzIPnBcm4iC25q5kKo5epZOw2TA4IjPefW2aPJaKeL2CJztcBpW/h3dol KFvmBtqNOSft7cC8x3irZY60UX+kgw2Bw2YCPDNfVCwRZYC2cl03j3nKn2yVpiZOu96u Xy0QK2kRYPWgVncEIhEFviIrhViN+ZCODhd9W9N4l49K3bQHq/MrL9Ldx61SHvYDoTf1 U8ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=A3PyzFDj3kTsXxz/ddL/NugXSxTXc+mH2qyJxuCqbNg=; b=WPhsr8iPtsrl9sgto+eBUcGcjRvH5wosdvZyvRnIOsWMPK4KWlr5SUiqGee5Itj45F asg4G14K3u9z7+l0AHGL9xLxpWj5o4V0RDb1+fVr4sRnpUkWJmglmD9SoxBZqjBmDd1r wneBnuPyyJHK+bw8i/36xuSS7uvbLqXEvE8mBjHpZzB3JwzeA/YuvGIjvY1YpqdtfpDk 7quXj5lDGXp0Hnv9IrruLYJr2Dq68koNpuuJL+vfDV/p32nodqteYuvo2CpxvlN9012D P9qKio5IoEcQ4+SnYok5HaVu0+17U15LMf4A0WdGVrIvHbsbutraDL99HRxqaCKcNfA/ 221Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=q3CLH3k+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id v17-20020a170902e8d100b001589c9ea308si9994021plg.349.2022.05.23.10.15.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:15:10 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=q3CLH3k+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 85EB97036E; Mon, 23 May 2022 10:14:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239652AbiEWRKY (ORCPT + 99 others); Mon, 23 May 2022 13:10:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239698AbiEWRJR (ORCPT ); Mon, 23 May 2022 13:09:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 802D46C576; Mon, 23 May 2022 10:08:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EC0C3614E9; Mon, 23 May 2022 17:08:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFC13C385A9; Mon, 23 May 2022 17:08:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653325724; bh=JfAwZZ17NteAR96/4WAUozQ2gUJnoL9mOSXadpYdRp0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q3CLH3k+/5oWMUQfDCN3c+HNSmpNtX/gD2odQWiCVUB2K7jdr1aZg05ff6H7E2ZwU fiBmjSm4Cvw137l/bFzcD1tTb/Q6KDPmI/1EtOlvunTSW9qrXE+9q9I8LXkqerhgLs 0O0ZzaQoOmXezgzO2glhItbeYjkJKlFBJDS0E72w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrew Lunn , Ido Schimmel , Nikolay Aleksandrov , Paolo Abeni , Sasha Levin Subject: [PATCH 4.14 23/33] net: bridge: Clear offload_fwd_mark when passing frame up bridge interface. Date: Mon, 23 May 2022 19:05:12 +0200 Message-Id: <20220523165751.986280695@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165746.957506211@linuxfoundation.org> References: <20220523165746.957506211@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrew Lunn [ Upstream commit fbb3abdf2223cd0dfc07de85fe5a43ba7f435bdf ] It is possible to stack bridges on top of each other. Consider the following which makes use of an Ethernet switch: br1 / \ / \ / \ br0.11 wlan0 | br0 / | \ p1 p2 p3 br0 is offloaded to the switch. Above br0 is a vlan interface, for vlan 11. This vlan interface is then a slave of br1. br1 also has a wireless interface as a slave. This setup trunks wireless lan traffic over the copper network inside a VLAN. A frame received on p1 which is passed up to the bridge has the skb->offload_fwd_mark flag set to true, indicating that the switch has dealt with forwarding the frame out ports p2 and p3 as needed. This flag instructs the software bridge it does not need to pass the frame back down again. However, the flag is not getting reset when the frame is passed upwards. As a result br1 sees the flag, wrongly interprets it, and fails to forward the frame to wlan0. When passing a frame upwards, clear the flag. This is the Rx equivalent of br_switchdev_frame_unmark() in br_dev_xmit(). Fixes: f1c2eddf4cb6 ("bridge: switchdev: Use an helper to clear forward mark") Signed-off-by: Andrew Lunn Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20220518005840.771575-1-andrew@lunn.ch Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- net/bridge/br_input.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c index 10fa84056cb5..07e7cf2b4cfb 100644 --- a/net/bridge/br_input.c +++ b/net/bridge/br_input.c @@ -47,6 +47,13 @@ static int br_pass_frame_up(struct sk_buff *skb) u64_stats_update_end(&brstats->syncp); vg = br_vlan_group_rcu(br); + + /* Reset the offload_fwd_mark because there could be a stacked + * bridge above, and it should not think this bridge it doing + * that bridge's work forwarding out its ports. + */ + br_switchdev_frame_unmark(skb); + /* Bridge is just like any other port. Make sure the * packet is allowed except in promisc modue when someone * may be running packet capture. -- 2.35.1