Skip to contentSkip to conversation

net/ice: fix storing field offset arg

PATCH In review Bruce Richardson 2 participants 3 messages Sep 14 – Sep 25 1 message not in the archive Network drivers

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 net/ice: fix storing field offset arg

In reply to a message not in the archive

The field offset argument type inside ice driver is of "int" type, but when parsing and storing the value from a devarg, a uint8_t type is used, leading to 3 bytes being potentially uninitialized. Fix this by storing to an int type instead.

Bugzilla ID: 2038

Fixes df539aaf35cb ("net/ice: refactor flex descriptor protocol field extraction")

---
Note: this fix is superceded by the kvargs numeric args patchset [1]. However, that patchset relies on new kvargs features unlikely to be backported, so this standalone fix is useful for backporting or if the whole other set doesn't make the 26.11 release.

[1] https://patches.dpdk.org/project/dpdk/list/?series=39247

---
 drivers/net/intel/ice/ice_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/intel/ice/ice_ethdev.c +1 -1
index 3938186228..2f97140bef 100644
@@ -735,7 +735,7 @@ static int
 handle_field_offs_arg(__rte_unused const char *key, const char *value,
 				void *offs_args)
 {
-	uint8_t *offset = offs_args;
+	int *offset = offs_args;
 
 	if (value == NULL || offs_args == NULL)
 		return -EINVAL;
Signature · 1 line
2.53.0
Acked-by on v1 1/1
#2 lore raw
Quoted 10 lines · Bruce Richardson

The field offset argument type inside ice driver is of "int" type, but when parsing and storing the value from a devarg, a uint8_t type is used, leading to 3 bytes being potentially uninitialized. Fix this by storing to an int type instead.

Bugzilla ID: 2038

Fixes df539aaf35cb ("net/ice: refactor flex descriptor protocol field extraction")
Quoted 8 lines

---
Note: this fix is superceded by the kvargs numeric args patchset [1]. However, that patchset relies on new kvargs features unlikely to be backported, so this standalone fix is useful for backporting or if the whole other set doesn't make the 26.11 release.

[1] https://patches.dpdk.org/project/dpdk/list/?series=39247
---

Signature · 2 lines
Thanks,
Anatoly
author Applied
#3 lore raw
Quoted 17 lines · Anatoly
Quoted 16 lines · Bruce Richardson

The field offset argument type inside ice driver is of "int" type, but when parsing and storing the value from a devarg, a uint8_t type is used, leading to 3 bytes being potentially uninitialized. Fix this by storing to an int type instead.

Bugzilla ID: 2038

Fixes df539aaf35cb ("net/ice: refactor flex descriptor protocol field extraction")

---
Note: this fix is superceded by the kvargs numeric args patchset [1]. However, that patchset relies on new kvargs features unlikely to be backported, so this standalone fix is useful for backporting or if the whole other set doesn't make the 26.11 release.

Quoted 6 lines
Quoted 2 lines

[1] https://patches.dpdk.org/project/dpdk/list/?series=39247
---

Applied to dpdk-next-net-intel.

/Bruce