[dpdk-stable] patch 'net/ice: fix illegal access when removing MAC filter' has been queued to stable release 20.11.2

Xueming Li xuemingl at nvidia.com
Mon May 10 18:02:13 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/12/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/1cb30b35c9061267146bbfd72e2a61c91f12a8b6

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 1cb30b35c9061267146bbfd72e2a61c91f12a8b6 Mon Sep 17 00:00:00 2001
From: Wenwu Ma <wenwux.ma at intel.com>
Date: Fri, 2 Apr 2021 13:52:47 +0000
Subject: [PATCH] net/ice: fix illegal access when removing MAC filter
Cc: Luca Boccassi <bluca at debian.org>

[ upstream commit f4b6eb2b91f38dc9ebc6c4e2b913fd1d25f14773 ]

When removing the mac filter in ice_remove_all_mac_vlan_filters(),
TAILQ_FOREACH_SAFE should be used instead of TAILQ_FOREACH,
Otherwise, it will result in a illegal pointer access.

Fixes: e0dcf94a0d7f ("net/ice: support VLAN ops")

Signed-off-by: Wenwu Ma <wenwux.ma at intel.com>
Tested-by: Zhihong Peng <zhihongx.peng at intel.com>
Acked-by: Qi Zhang <qi.z.zhang at intel.com>
---
 drivers/net/ice/ice_ethdev.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index b6d940c2ff..7c20936123 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -10,6 +10,8 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
+#include <rte_tailq.h>
+
 #include "base/ice_sched.h"
 #include "base/ice_flow.h"
 #include "base/ice_dcb.h"
@@ -1088,12 +1090,13 @@ ice_remove_all_mac_vlan_filters(struct ice_vsi *vsi)
 {
 	struct ice_mac_filter *m_f;
 	struct ice_vlan_filter *v_f;
+	void *temp;
 	int ret = 0;
 
 	if (!vsi || !vsi->mac_num)
 		return -EINVAL;
 
-	TAILQ_FOREACH(m_f, &vsi->mac_list, next) {
+	TAILQ_FOREACH_SAFE(m_f, &vsi->mac_list, next, temp) {
 		ret = ice_remove_mac_filter(vsi, &m_f->mac_info.mac_addr);
 		if (ret != ICE_SUCCESS) {
 			ret = -EINVAL;
@@ -1104,7 +1107,7 @@ ice_remove_all_mac_vlan_filters(struct ice_vsi *vsi)
 	if (vsi->vlan_num == 0)
 		return 0;
 
-	TAILQ_FOREACH(v_f, &vsi->vlan_list, next) {
+	TAILQ_FOREACH_SAFE(v_f, &vsi->vlan_list, next, temp) {
 		ret = ice_remove_vlan_filter(vsi, v_f->vlan_info.vlan_id);
 		if (ret != ICE_SUCCESS) {
 			ret = -EINVAL;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-05-10 23:59:31.338774100 +0800
+++ 0185-net-ice-fix-illegal-access-when-removing-MAC-filter.patch	2021-05-10 23:59:26.630000000 +0800
@@ -1 +1 @@
-From f4b6eb2b91f38dc9ebc6c4e2b913fd1d25f14773 Mon Sep 17 00:00:00 2001
+From 1cb30b35c9061267146bbfd72e2a61c91f12a8b6 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit f4b6eb2b91f38dc9ebc6c4e2b913fd1d25f14773 ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
@@ -21 +23 @@
-index a1365131e0..84d1735255 100644
+index b6d940c2ff..7c20936123 100644
@@ -33 +35 @@
-@@ -1092,12 +1094,13 @@ ice_remove_all_mac_vlan_filters(struct ice_vsi *vsi)
+@@ -1088,12 +1090,13 @@ ice_remove_all_mac_vlan_filters(struct ice_vsi *vsi)
@@ -48 +50 @@
-@@ -1108,7 +1111,7 @@ ice_remove_all_mac_vlan_filters(struct ice_vsi *vsi)
+@@ -1104,7 +1107,7 @@ ice_remove_all_mac_vlan_filters(struct ice_vsi *vsi)
@@ -54 +56 @@
- 		ret = ice_remove_vlan_filter(vsi, &v_f->vlan_info.vlan);
+ 		ret = ice_remove_vlan_filter(vsi, v_f->vlan_info.vlan_id);


More information about the stable mailing list