[PATCH v2] app/testpmd: fix segfault in flow rule parser
Stephen Hemminger
stephen at networkplumber.org
Sun Jul 26 18:40:55 CEST 2026
On Tue, 21 Jul 2026 13:09:31 -0600
Mohammad Shuab Siddique <mohammad-shuab.siddique at broadcom.com> wrote:
> From: Artin Davari <artin.davari at broadcom.com>
>
> Replace temporary stack arrays in the flow rule parser with static
> arrays in three parse functions - prefix spec, RSS type, and RSS
> queue handling - to prevent invalid pointer access during parsing
> of complex flow rules.
>
> NEXT_ENTRY() expands to a compound literal, which has automatic
> storage duration when used inside a function body. The parser stores
> the resulting pointer in ctx->next[], which is dereferenced after the
> function returns, so the stack storage backing it is no longer valid
> by the time it is accessed. Declaring the arrays 'static const' gives
> them a lifetime that outlives the call, fixing the dangling pointer.
>
> Fixes: c439a84f1a78 ("app/testpmd: fix build with MSVC on non-constant initializer")
> Cc: stable at dpdk.org
>
> Signed-off-by: Artin Davari <artin.davari at broadcom.com>
> ---
Applied to next-net
More information about the stable
mailing list