Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4823526ybl; Wed, 22 Jan 2020 05:25:49 -0800 (PST) X-Google-Smtp-Source: APXvYqy/2DtcjwHMmfHil9x0isMcc2Nge9gquetHb74lAZYcDi/BhR8Tk9sxToE8C2uj7dTy1M5z X-Received: by 2002:a05:6830:1481:: with SMTP id s1mr7272010otq.66.1579699549571; Wed, 22 Jan 2020 05:25:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699549; cv=none; d=google.com; s=arc-20160816; b=aSAyIiv81rZOqa3c+Jn/8ol1w4QvhNs9e3F97Uc+sur0il5XyH4mfGXD2RuJ2aLtVF Kx5yRp+Z/Vs1T8EMnhZ/EMtwH0QLCdF0zcTa9LgsvGmkGYW6lSiJBeM8dLQB0VLTKxmP lezBPHlE0UkjFJAu15SfCeOYb3Kj/lstyBNmMNmc8l4QUddReCc+c4mjLCef/AA8l4ZS eHbh/MehrqKIVi7KiAbys/eAMD8aLy5ggGYfG9mCsi9XBeVHZ+79tcyuaX9Wrsm2XYKd xltR9iqpfLCF+qDa8fcDWj49e99BPIHGJpJESqqkqdnz4PecySZw54pygliUwiWvmptr 9K3g== 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=GxuKk/z+tN/e3QGqG8di3b+13BRFjt0ylXwNbr8u5AY=; b=VG8ya6qrlRUkOhgR9NBY5IWCLhiLKrm8Wqv3ZW9y45Pt4NGkbFruq9aoeMjuj9Ows0 Mi8JgMCga8gjzlEc/KY3+hW4Tv3BlOfYlqq0Pmh4Srw81GJ7SXx6yLJfTTSKiLKr6xlV jr9tj4Fn26kl4eey1P36KyHArgPZXJvoxPwEt8A8MZk4hG+tqSTxn2xkuIy14Di5Xtcc FgDKqswWgSwGLAq+U7tJ4ESCjyOB3r8xnhEvRQreEDn5yGBaSHgujyQ96ICzKGD6Qlht r00QNpGwFNqb5ECW2yirP+F/dSfwbqFQ+IOLIt9xXX/54axS4iZx9oojarDcau4aK6Fb 7Esg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AERGFrby; 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 s13si22779765otd.186.2020.01.22.05.25.37; Wed, 22 Jan 2020 05:25:49 -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=AERGFrby; 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 S1730397AbgAVNXg (ORCPT + 99 others); Wed, 22 Jan 2020 08:23:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:41806 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729988AbgAVNXb (ORCPT ); Wed, 22 Jan 2020 08:23:31 -0500 Received: from localhost (unknown [84.241.205.26]) (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 B90C524688; Wed, 22 Jan 2020 13:23:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699411; bh=8qmqtz19kIcpBztqBKiS3fsOhMTzXlrJKD67CNz8vh0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AERGFrbyLSYp4f2yxpvlnTNWxonELWRJsAO6jXPIiyO348YmiUhj85KbW4YLUA//9 4JSgypPQrrYmoQbhX5q0UstRwBV6zoOQmKgrg+f2FZHGwm8GtfjzbYe0iLtgCpV1Vh 5d9d/se8hZM9gED0MbVgunRDpCuNx9RPL3iubbcc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , Jurgen Van Ham , Matteo Croce , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 136/222] macvlan: use skb_reset_mac_header() in macvlan_queue_xmit() Date: Wed, 22 Jan 2020 10:28:42 +0100 Message-Id: <20200122092843.478479187@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Eric Dumazet [ Upstream commit 1712b2fff8c682d145c7889d2290696647d82dab ] I missed the fact that macvlan_broadcast() can be used both in RX and TX. skb_eth_hdr() makes only sense in TX paths, so we can not use it blindly in macvlan_broadcast() Fixes: 96cc4b69581d ("macvlan: do not assume mac_header is set in macvlan_broadcast()") Signed-off-by: Eric Dumazet Reported-by: Jurgen Van Ham Tested-by: Matteo Croce Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/macvlan.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 747c0542a53c..c5bf61565726 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -259,7 +259,7 @@ static void macvlan_broadcast(struct sk_buff *skb, struct net_device *src, enum macvlan_mode mode) { - const struct ethhdr *eth = skb_eth_hdr(skb); + const struct ethhdr *eth = eth_hdr(skb); const struct macvlan_dev *vlan; struct sk_buff *nskb; unsigned int i; @@ -513,10 +513,11 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev) const struct macvlan_dev *dest; if (vlan->mode == MACVLAN_MODE_BRIDGE) { - const struct ethhdr *eth = (void *)skb->data; + const struct ethhdr *eth = skb_eth_hdr(skb); /* send to other bridge ports directly */ if (is_multicast_ether_addr(eth->h_dest)) { + skb_reset_mac_header(skb); macvlan_broadcast(skb, port, dev, MACVLAN_MODE_BRIDGE); goto xmit_world; } -- 2.20.1