From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 246CA347BC6; Tue, 21 Jul 2026 22:49:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784674201; cv=none; b=aPEhTvY9B+JpHq+qIP2Rwagol5SJHtHOKOgMCNNqWh187GTR9jtDDQGRNGbLOPkiMfBuPXaatZxHpXkQlxR9zqUqlaaJhiqIzuDz592whk2O5V8dUs0SJmbP8sOYUyTsYiKBefEhgGuliXxpVDEVsHa/AAYfgCOS51WYqzYRa7I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784674201; c=relaxed/simple; bh=ZXfTpI9o+B2ev9OpcbqkloKwDyEOpnJMTboF/r13roI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tfc+nv43RaVDFcVEtVGqMtsJZ8xHj2SXDrd0P8MCIK76yHaSoPMEnQ+q+jImiMtTFENqVr12PjnstcFa5KuFhLcG0kLFcaFwqpwG2USHU9/B/Fjt4+ctfNWydXdhxZNNbPf5SFm9Z/kX5mBQjgOxAZap2Jv33oH2jeNDNmgPSS4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XK0/ExK6; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="XK0/ExK6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 526D21F00A3A; Tue, 21 Jul 2026 22:49:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784674199; bh=1gXrlrkiclQw8S0KB3HICwN25vvHsMDK8URUsLGlCyk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=XK0/ExK62HsMMu+amgLhV/UOOPqRYM1Uh6IoHyawTvR7nCTljsg1uMnOKlT3YET8l yXWbnQpQENdfjNJP7XUHVrKv4NDrtV1lsA7fJ28PWLoHGhlCBjvZEkacJiOXDzDMYJ Krw89wB6PZpN5bBGPA/TOad6STfNsWtMiJUL4Th4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Enrico Pozzobon , Nicolai Buchwitz , Paolo Abeni , Sasha Levin Subject: [PATCH 5.10 408/699] net: usb: lan78xx: disable VLAN filter in promiscuous mode Date: Tue, 21 Jul 2026 17:22:47 +0200 Message-ID: <20260721152404.899319205@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152355.667394603@linuxfoundation.org> References: <20260721152355.667394603@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Enrico Pozzobon [ Upstream commit 60444706aa17616efc03190d099ac347e28b3d0a ] The hardware VLAN filter (RFE_CTL_VLAN_FILTER_) drops VLAN-tagged frames whose VID has not been registered via lan78xx_vlan_rx_add_vid(). It is left enabled in promiscuous mode, so packet capture (e.g. tcpdump or Wireshark) does not see tagged frames for unregistered VIDs. Clear the filter while the interface is promiscuous and restore it from NETIF_F_HW_VLAN_CTAG_FILTER otherwise. Enforce the same condition in lan78xx_set_features() so netdev_update_features() cannot re-enable the filter while promiscuous. Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver") Signed-off-by: Enrico Pozzobon Reviewed-by: Nicolai Buchwitz Link: https://patch.msgid.link/20260701-lan78xx-vlan-promisc-v3-1-232266d32743@dissecto.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/usb/lan78xx.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index af0622e9425849..1a76fccee9a8d7 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -1092,6 +1092,17 @@ static void lan78xx_deferred_multicast_write(struct work_struct *param) lan78xx_write_reg(dev, RFE_CTL, pdata->rfe_ctl); } +static void lan78xx_update_vlan_filter(struct lan78xx_priv *pdata, + struct net_device *netdev, + netdev_features_t features) +{ + if ((features & NETIF_F_HW_VLAN_CTAG_FILTER) && + !(netdev->flags & IFF_PROMISC)) + pdata->rfe_ctl |= RFE_CTL_VLAN_FILTER_; + else + pdata->rfe_ctl &= ~RFE_CTL_VLAN_FILTER_; +} + static void lan78xx_set_multicast(struct net_device *netdev) { struct lan78xx_net *dev = netdev_priv(netdev); @@ -1126,6 +1137,8 @@ static void lan78xx_set_multicast(struct net_device *netdev) } } + lan78xx_update_vlan_filter(pdata, dev->net, dev->net->features); + if (netdev_mc_count(dev->net)) { struct netdev_hw_addr *ha; int i; @@ -2397,10 +2410,7 @@ static int lan78xx_set_features(struct net_device *netdev, else pdata->rfe_ctl &= ~RFE_CTL_VLAN_STRIP_; - if (features & NETIF_F_HW_VLAN_CTAG_FILTER) - pdata->rfe_ctl |= RFE_CTL_VLAN_FILTER_; - else - pdata->rfe_ctl &= ~RFE_CTL_VLAN_FILTER_; + lan78xx_update_vlan_filter(pdata, netdev, features); spin_unlock_irqrestore(&pdata->rfe_ctl_lock, flags); -- 2.53.0