On 7/11/2024 1:07 PM, Serhii Iliushyk wrote:
> @@ -383,6 +658,8 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev)
>               /* connect structs */
>               internals->p_drv = p_drv;
>               eth_dev->data->dev_private = internals;
> +             eth_dev->data->mac_addrs = rte_malloc(NULL, RTE_ETHER_ADDR_LEN, 
> 0);
> +             rte_memcpy(eth_dev->data->mac_addrs, internals->eth_addrs, 
> RTE_ETHER_ADDR_LEN);
>

This allocates room for 1 MAC address for 'mac_addrs',
BUT in 'eth_dev_infos_get()',
"dev_info->max_mac_addrs = NUM_MAC_ADDRS_PER_PORT;" which is 16.

This will cause crash if user tries to add more than one MAC, need to
increase size of the allocated memory.


Reply via email to