net/mvpp2: fix stack corruption
authorYuri Chipchev <yuric@marvell.com>
Wed, 27 Jan 2021 16:09:15 +0000 (18:09 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 29 Jan 2021 17:16:10 +0000 (18:16 +0100)
Fixes stack corruption in mrvl_fill_bpool function
in case num > MRVL_PP2_RXD_MAX

Fixes: c3637258d894 ("net/mrvl: fix Rx descriptors number")
Cc: stable@dpdk.org
Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
drivers/net/mvpp2/mrvl_ethdev.c

index 1d67f2a..2f5b2f2 100644 (file)
@@ -1614,8 +1614,8 @@ mrvl_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
 static int
 mrvl_fill_bpool(struct mrvl_rxq *rxq, int num)
 {
-       struct buff_release_entry entries[MRVL_PP2_RXD_MAX];
-       struct rte_mbuf *mbufs[MRVL_PP2_RXD_MAX];
+       struct buff_release_entry entries[num];
+       struct rte_mbuf *mbufs[num];
        int i, ret;
        unsigned int core_id;
        struct pp2_hif *hif;