patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 1/2] net/cnxk: fix overrun when processing tail drop arg
@ 2025-09-23  4:45 Stephen Hemminger
  2025-09-23  4:45 ` [PATCH 2/2] net/cnxk: fix overrun in dis_xqe_drop Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2025-09-23  4:45 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, rbhansali, stable

If cnxk is compiled with LTO, compiler detects that the code
to parse a flag is expecting to write 16 bit value into a
one byte field.

In function ‘parse_flag’,
    inlined from ‘kvargs_process_common’ at ../lib/kvargs/rte_kvargs.c:187:9,
    inlined from ‘rte_kvargs_process’ at ../lib/kvargs/rte_kvargs.c:203:9,
    inlined from ‘cnxk_ethdev_parse_devargs’ at ../drivers/net/cnxk/cnxk_ethdev_devargs.c:371:2:
../drivers/net/cnxk/cnxk_ethdev_devargs.c:166: warning: writing 2 bytes into a region of size 1 [-Wstringop-overflow=]
  166 |         *(uint16_t *)extra_args = atoi(value);
../drivers/net/cnxk/cnxk_ethdev_devargs.c: In function ‘cnxk_ethdev_parse_devargs’:
../drivers/net/cnxk/cnxk_ethdev_devargs.c:306:17: note: destination object ‘force_tail_drop’ of size 1
  306 |         uint8_t force_tail_drop = 0;
      |                 ^

Bugzilla ID: 1790
Fixes: 75473b5b62c3 ("net/cnxk: add option to force tail drop")
Cc: rbhansali@marvell.com
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/cnxk/cnxk_ethdev_devargs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/cnxk/cnxk_ethdev_devargs.c b/drivers/net/cnxk/cnxk_ethdev_devargs.c
index e42344a2ec..5d774e0d70 100644
--- a/drivers/net/cnxk/cnxk_ethdev_devargs.c
+++ b/drivers/net/cnxk/cnxk_ethdev_devargs.c
@@ -303,7 +303,7 @@ cnxk_ethdev_parse_devargs(struct rte_devargs *devargs, struct cnxk_eth_dev *dev)
 	uint16_t outb_nb_desc = 8200;
 	struct sdp_channel sdp_chan;
 	uint16_t rss_tag_as_xor = 0;
-	uint8_t force_tail_drop = 0;
+	uint16_t force_tail_drop = 0;
 	uint16_t scalar_enable = 0;
 	uint16_t tx_compl_ena = 0;
 	uint16_t custom_sa_act = 0;
-- 
2.47.3


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-09-23  9:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-23  4:45 [PATCH 1/2] net/cnxk: fix overrun when processing tail drop arg Stephen Hemminger
2025-09-23  4:45 ` [PATCH 2/2] net/cnxk: fix overrun in dis_xqe_drop Stephen Hemminger
2025-09-23  9:28   ` Jerin Jacob

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).