[PATCH v5] eal: fix uncheck lcore role

Stephen Hemminger stephen at networkplumber.org
Thu Aug 7 05:15:45 CEST 2025


On Thu, 7 Aug 2025 10:49:36 +0800
Dengdui Huang <huangdengdui at huawei.com> wrote:

> diff --git a/lib/eal/common/eal_common_launch.c b/lib/eal/common/eal_common_launch.c
> index a7deac6ecd..be7226e4b6 100644
> --- a/lib/eal/common/eal_common_launch.c
> +++ b/lib/eal/common/eal_common_launch.c
> @@ -36,8 +36,15 @@ RTE_EXPORT_SYMBOL(rte_eal_remote_launch)
>  int
>  rte_eal_remote_launch(lcore_function_t *f, void *arg, unsigned int worker_id)
>  {
> +	enum rte_lcore_role_t role;
>  	int rc = -EBUSY;
>  
> +	role = lcore_config[worker_id].core_role;
> +	if (role != ROLE_RTE && role != ROLE_SERVICE) {
> +		rc = -EINVAL;
> +		goto finish;
> +	}

worker_id could be any value, if it was out of the range of the array
you would end up reading junk.


More information about the dev mailing list