[PATCH] net/e1000: add check for filter mask range

Burakov, Anatoly anatoly.burakov at intel.com
Mon Nov 17 17:06:45 CET 2025


On 11/14/2025 7:21 PM, Stephen Hemminger wrote:
> Gcc-16 complains about possible reference outside of array
> when managing flex filter. This is a false positive because the
> filter length can never be that long, but compiler can't detect
> that. Add guard rail check to only loop over possible array.
> 
> ../drivers/net/intel/e1000/igb_ethdev.c:4265:23: note: at offset 152 into destination object of size 176 allocated by ‘rte_zmalloc’
>   4265 |         flex_filter = rte_zmalloc("e1000_flex_filter",
>        |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   4266 |                         sizeof(struct e1000_flex_filter), 0);
>        |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../drivers/net/intel/e1000/igb_ethdev.c:4280:50: warning: writing 64 bytes into a region of size 0 [-Wstringop-overflow=]
>   4280 |                 flex_filter->filter_info.mask[i] = mask;
>        |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
> 
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> ---

Reviewed-by: Anatoly Burakov <anatoly.burakov at intel.com>

-- 
Thanks,
Anatoly


More information about the dev mailing list