[PATCH v3 1/2] net/vmxnet3: fix potential out of bounds access
Ferruh Yigit
ferruh.yigit at amd.com
Wed Nov 6 03:04:29 CET 2024
On 11/4/2024 10:52 AM, Morten Brørup wrote:
> With virtual hardware version 6, the max number of RX queues was increased
> to VMXNET3_EXT_MAX_RX_QUEUES (32) from VMXNET3_MAX_RX_QUEUES (16),
> similarly, the max number of TX queues was increased to
> VMXNET3_EXT_MAX_TX_QUEUES (32) from VMXNET3_MAX_TX_QUEUES (8).
> These increases were not fully considered in the PMD...
>
> The configured number of queues to provide statistics for
> (RTE_ETHDEV_QUEUE_STAT_CNTRS) can be smaller than driver's max number of
> supported transmit queues for virtual hardware version 6
> (VMXNET3_EXT_MAX_RX_QUEUES) (32), which will cause accessing the queue
> stats array out of boundary if the application uses more than
> RTE_ETHDEV_QUEUE_STAT_CNTRS queues.
>
> This patch fixes this by two modifications:
> - Increased stats array size to support hardware version 6.
> - Respect RTE_ETHDEV_QUEUE_STAT_CNTRS when getting the per-queue counters.
>
> The build time check
> RTE_BUILD_BUG_ON(RTE_ETHDEV_QUEUE_STAT_CNTRS < VMXNET3_MAX_TX_QUEUES)
> has become irrelevant, so it is removed.
> With this removal, per-queue stats for fewer queues is supported.
>
> Fixes: b1584dd0affe ("net/vmxnet3: support version 6")
>
> Signed-off-by: Morten Brørup <mb at smartsharesystems.com>
>
Acked-by: Ferruh Yigit <ferruh.yigit at amd.com>
Applied to dpdk-next-net/main, thanks.
More information about the dev
mailing list