eventdev: fix eth dev ID truncation in telemetry
cover eventdev: fix eth dev ID truncation in telemetry
This series fixes an out-of-bounds access in eventdev rx adapter telemetry handlers caused by eth dev ID truncation.
Patches:
- eventdev: fix eth dev ID truncation in telemetry
- mailmap: add Sergei Iashin
Sergei Iashin (2):
eventdev: fix eth dev ID truncation in telemetry
mailmap: add Sergei Iashin
.mailmap | 1 + lib/eventdev/rte_event_eth_rx_adapter.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-)
Signature · 1 line
2.39.5
PATCH 1/2 eventdev: fix eth dev ID truncation in telemetry
eth_dev_id is declared as int in handle_rxa_get_queue_conf(), handle_rxa_get_queue_stats(), handle_rxa_queue_stats_reset(), and handle_rxa_instance_get(), but is implicitly narrowed to uint16_t when passed to rte_eth_dev_is_valid_port() via RTE_EVENT_ETH_RX_ADAPTER_PORTID_VALID_OR_GOTO_ERR_RET().
A value like 65535 + N passes validation as N, but is then used as-is as an array index, causing out-of-bounds access and SIGSEGV.
To reproduce (requires telemetry enabled):
echo "/eventdev/rxa_queue_conf,0,65536,0" | \
socat - UNIX-CONNECT:/var/run/dpdk/vpp/dpdk_telemetry.v2,type=5
Result:
SIGSEGV at handle_rxa_get_queue_conf + 0x34a, faulting address 0x50
This patch changes eth_dev_id from int to uint16_t to avoid truncation.
--- lib/eventdev/rte_event_eth_rx_adapter.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
lib/eventdev/rte_event_eth_rx_adapter.c +8 -4
@@ -3827,7 +3827,8 @@ handle_rxa_get_queue_conf(const char *cmd __rte_unused, {uint8_t rx_adapter_id;uint16_t rx_queue_id; -int eth_dev_id, ret =-1 ; +uint16_t eth_dev_id; +int ret =-1 ;char *token, *l_params;struct rte_event_eth_rx_adapter_queue_conf queue_conf;
@@ -3899,7 +3900,8 @@ handle_rxa_get_queue_stats(const char *cmd __rte_unused, {uint8_t rx_adapter_id;uint16_t rx_queue_id; -int eth_dev_id, ret =-1 ; +uint16_t eth_dev_id; +int ret =-1 ;char *token, *l_params;struct rte_event_eth_rx_adapter_queue_stats q_stats;
@@ -3970,7 +3972,8 @@ handle_rxa_queue_stats_reset(const char *cmd __rte_unused, {uint8_t rx_adapter_id;uint16_t rx_queue_id; -int eth_dev_id, ret =-1 ; +uint16_t eth_dev_id; +int ret =-1 ;char *token, *l_params;if (params ==NULL ||strlen (params) ==0 || !isdigit (*params))
@@ -4031,7 +4034,8 @@ handle_rxa_instance_get(const char *cmd __rte_unused, {uint8_t instance_id;uint16_t rx_queue_id; -int eth_dev_id, ret =-1 ; +uint16_t eth_dev_id; +int ret =-1 ;char *token, *l_params;if (params ==NULL ||strlen (params) ==0 || !isdigit (*params))
Signature · 1 line
2.39.5
PATCH 2/2 mailmap: add Sergei Iashin
In reply to Sergei IashinAdd my name and email mapping to .mailmap
--- .mailmap | 1 + 1 file changed, 1 insertion(+)
.mailmap +1 -0
@@ -1936,3 +1936,4 @@ Zoltan Kiss <[email protected]> <[email protected]> Zorik Machulsky <[email protected]> Zyta Szpak <[email protected]> <[email protected]> Zyta Szpak <[email protected]> <[email protected]> +Sergei Iashin <[email protected]>
Signature · 1 line
2.39.5
Re: [PATCH 2/2] mailmap: add Sergei Iashin
Quoted 13 lines · Sergei Iashin
Add my name and email mapping to .mailmap
Signed-off-by Sergei Iashin <[email protected]>--- .mailmap | 1 + 1 file changed, 1 insertion(+).mailmap +0
-0
.mailmap Zoltan Kiss <[email protected]> <[email protected]> · line 1939
Quoted 4 lines
.mailmap +1
-0@@ -1936,3 +1936,4 @@ Zoltan Kiss <[email protected]> <[email protected]> Zorik Machulsky <[email protected]> Zyta Szpak <[email protected]> <[email protected]> Zyta Szpak <[email protected]> <[email protected]> +Sergei Iashin <[email protected]>
Fixed the name order by making it as alphabetical
Squashed with 1/2 patch
Applied to dpdk-next-eventdev/for-main. Thanks
Quoted 3 lines
--
2.39.5