Skip to contentSkip to conversation

net/cxgbe: rte_flow related bug fixes

PATCH In review Rahul Lakkireddy 2 participants 4 messages Dec 14, 2018 – Dec 18, 2018 Network drivers

lore
Share & tools
lore
#1 lore raw

PATCH 1/2 net/cxgbe: fix overlapping regions in TID table

In reply to Rahul Lakkireddy

Location of filter TID table should be after active TID table memory, and not from the beginning of TID table memory. This fixes memory corruption due to overlapping regions.

Fixes 3a381a4116ed ("net/cxgbe: query firmware for HASH filter resources")
---
 drivers/net/cxgbe/cxgbe_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/cxgbe/cxgbe_main.c +1 -1
index 0368db509..5fa6cdd05 100644
@@ -415,7 +415,7 @@ static int tid_init(struct tid_info *t)
 		return -ENOMEM;
 
 	t->atid_tab = (union aopen_entry *)&t->tid_tab[t->ntids];
-	t->ftid_tab = (struct filter_entry *)&t->tid_tab[t->natids];
+	t->ftid_tab = (struct filter_entry *)&t->atid_tab[t->natids];
 	t->ftid_bmap_array = t4_os_alloc(ftid_bmap_size);
 	if (!t->ftid_bmap_array) {
 		tid_free(t);
Signature · 1 line
2.18.0
#2 lore raw

PATCH 2/2 net/cxgbe: skip parsing match items with no spec

In reply to Rahul Lakkireddy

Skip parsing pattern match items that have no spec. This fixes NULL dereference when accessing their non-existent spec.

Fixes ee61f5113b17 ("net/cxgbe: parse and validate flows")
---
 drivers/net/cxgbe/cxgbe_flow.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/cxgbe/cxgbe_flow.c +4 -0
index 4deaff8f2..7b87bdf58 100644
@@ -732,6 +732,10 @@ cxgbe_rtef_parse_items(struct rte_flow *flow,
 						"parse items cannot be repeated (except void)");
 			repeat[i->type] = 1;
 
+			/* No spec found for this pattern item. Skip it */
+			if (!i->spec)
+				break;
+
 			/* validate the item */
 			ret = cxgbe_validate_item(i, e);
 			if (ret)
Signature · 1 line
2.18.0
#0 lore raw

cover net/cxgbe: rte_flow related bug fixes

Patch 1 fixes memory corruption due to overlapping regions in TID table. Patch 2 fixes NULL pointer dereference when attempting to parse pattern match items without any spec.

Thanks,
Rahul

Rahul Lakkireddy (2):
net/cxgbe: fix overlapping regions in TID table net/cxgbe: skip parsing match items with no spec

 drivers/net/cxgbe/cxgbe_flow.c | 4 ++++
 drivers/net/cxgbe/cxgbe_main.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
Signature · 1 line
2.18.0
#3 lore raw
Quoted 10 lines · Rahul Lakkireddy

Patch 1 fixes memory corruption due to overlapping regions in TID table. Patch 2 fixes NULL pointer dereference when attempting to parse pattern match items without any spec.

Thanks,
Rahul

Rahul Lakkireddy (2):
net/cxgbe: fix overlapping regions in TID table net/cxgbe: skip parsing match items with no spec

Series applied to dpdk-next-net/master, thanks.