[PATCH 2/3] net/i40e/base: fix loop counter width in DCB parsing
Ciara Loftus
ciara.loftus at intel.com
Tue May 19 16:52:22 CEST 2026
From: Deepthi Kavalur <deepthi.kavalur at intel.com>
Loop counters in i40e_parse_cee_app_tlv() and
i40e_add_ieee_app_pri_tlv() are declared as u8 but compared against
numapps which is u32. If numapps exceeds 255 the counter wraps,
truncating the iteration. Widen the counters to u32.
Fixes: 166dceeeeafc ("i40e/base: add parsing for CEE DCBX TLVs")
Fixes: 0d9d27bb8684 ("i40e/base: prepare local LLDP MIB in TLV")
Cc: stable at dpdk.org
Signed-off-by: Deepthi Kavalur <deepthi.kavalur at intel.com>
Signed-off-by: Ciara Loftus <ciara.loftus at intel.com>
---
.mailmap | 1 +
drivers/net/intel/i40e/base/i40e_dcb.c | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/.mailmap b/.mailmap
index f3130df686..6121833c25 100644
--- a/.mailmap
+++ b/.mailmap
@@ -371,6 +371,7 @@ Dean Marx <dmarx at iol.unh.edu>
Declan Doherty <declan.doherty at intel.com>
Deepak Khandelwal <deepak.khandelwal at intel.com>
Deepak Kumar Jain <deepak.k.jain at intel.com>
+Deepthi Kavalur <deepthi.kavalur at intel.com>
Deirdre O'Connor <deirdre.o.connor at intel.com>
Dekel Peled <dekelp at nvidia.com> <dekelp at mellanox.com>
Dengdui Huang <huangdengdui at huawei.com>
diff --git a/drivers/net/intel/i40e/base/i40e_dcb.c b/drivers/net/intel/i40e/base/i40e_dcb.c
index 04322ea034..c1d97fabab 100644
--- a/drivers/net/intel/i40e/base/i40e_dcb.c
+++ b/drivers/net/intel/i40e/base/i40e_dcb.c
@@ -364,7 +364,7 @@ static void i40e_parse_cee_app_tlv(struct i40e_cee_feat_tlv *tlv,
{
u16 length, typelength, offset = 0;
struct i40e_cee_app_prio *app;
- u8 i;
+ u32 i;
typelength = I40E_NTOHS(tlv->hdr.typelen);
length = (u16)((typelength & I40E_LLDP_TLV_LEN_MASK) >>
@@ -1169,9 +1169,9 @@ static void i40e_add_ieee_app_pri_tlv(struct i40e_lldp_org_tlv *tlv,
struct i40e_dcbx_config *dcbcfg)
{
u16 typelength, length, offset = 0;
- u8 priority, selector, i = 0;
u8 *buf = tlv->tlvinfo;
- u32 ouisubtype;
+ u32 ouisubtype, i = 0;
+ u8 priority, selector;
/* No APP TLVs then just return */
if (dcbcfg->numapps == 0)
--
2.43.0
More information about the stable
mailing list