[PATCH] power: fix off-by-one in uncore env bounds check

Thomas Monjalon thomas at monjalon.net
Thu Jun 11 00:36:27 CEST 2026


03/06/2026 06:21, Denis Sergeev:
> The condition in rte_power_set_uncore_env() uses '<=' instead of '<'
> when comparing the env argument against the size of uncore_env_str[].
> Since RTE_DIM(uncore_env_str) equals 4 and valid indices are 0..3,
> a caller passing env=4 bypasses the guard and causes an out-of-bounds
> read of uncore_env_str[4] at two sites within the same block.
> 
> Fix by replacing '<=' with '<', consistent with the correct pattern
> already used in rte_power_uncore_init() in the same file.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Fixes: ac1edcb6621a ("power: refactor uncore power management API")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Denis Sergeev <denserg.edu at gmail.com>

Applied, thanks.




More information about the dev mailing list