You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kmod-redhat-atlantic/SOURCES/0064-netdrv-net-atlantic-fi...

58 lines
2.2 KiB

From 8075ce5872ceed25476fbb740b58eb7e25eedb79 Mon Sep 17 00:00:00 2001
From: Igor Russkikh <irusskik@redhat.com>
Date: Fri, 6 Nov 2020 18:37:21 -0500
Subject: [PATCH 064/139] [netdrv] net: atlantic: fix out of range usage of
active_vlans array
Message-id: <1604687916-15087-65-git-send-email-irusskik@redhat.com>
Patchwork-id: 338491
Patchwork-instance: patchwork
O-Subject: [RHEL8.4 BZ 1857861 064/139] net: atlantic: fix out of range usage of active_vlans array
Bugzilla: 1857861
RH-Acked-by: David Arcari <darcari@redhat.com>
RH-Acked-by: John Linville <linville@redhat.com>
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
Bugzilla: http://bugzilla.redhat.com/1857861
commit 5a292c89a84d49b598f8978f154bdda48b1072c0
Author: Dmitry Bogdanov <dbogdanov@marvell.com>
Date: Fri Feb 14 18:44:58 2020 +0300
net: atlantic: fix out of range usage of active_vlans array
fix static checker warning:
drivers/net/ethernet/aquantia/atlantic/aq_filters.c:166 aq_check_approve_fvlan()
error: passing untrusted data to 'test_bit()'
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 7975d2aff5af: ("net: aquantia: add support of rx-vlan-filter offload")
Signed-off-by: Dmitry Bogdanov <dbogdanov@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Igor Russkikh <irusskik@redhat.com>
Cc: David Arcari <darcari@redhat.com>
Cc: Igor Russkikh <irusskik@redhat.com>
Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
drivers/net/ethernet/aquantia/atlantic/aq_filters.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_filters.c b/drivers/net/ethernet/aquantia/atlantic/aq_filters.c
index 6102251bb909..03ff92bc4a7f 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_filters.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_filters.c
@@ -163,7 +163,7 @@ aq_check_approve_fvlan(struct aq_nic_s *aq_nic,
}
if ((aq_nic->ndev->features & NETIF_F_HW_VLAN_CTAG_FILTER) &&
- (!test_bit(be16_to_cpu(fsp->h_ext.vlan_tci),
+ (!test_bit(be16_to_cpu(fsp->h_ext.vlan_tci) & VLAN_VID_MASK,
aq_nic->active_vlans))) {
netdev_err(aq_nic->ndev,
"ethtool: unknown vlan-id specified");
--
2.13.6