27/10/2026 17:14, Rupesh Chiluka:
> In __rte_lpm_lookup_vec() (SVE), the main loop condition was
>
> for (i = 0; i < n - vl; i += vl)
>
> where n is uint32_t and vl is uint64_t. When n < vl the subtraction
> is done in 64-bit unsigned arithmetic and wraps to a very large
> value, so the loop does not terminate at the end of the input array.
> It reads past the end of ips[] resulting in a segmentation fault.
>
> Rewrite the condition as "i + vl < n" so no unsigned wrap occurs. The
> existing tail handling with svwhilelt_b32() covers the remaining
> elements, including n == 0.
>
> Fixes: b29ccbea24 ("lpm: use SVE for bulk lookup")
> Cc: [email protected]
>
> Signed-off-by: Rupesh Chiluka <[email protected]>
Applied, thanks.