[PATCH] app/test-pmd: terminate process on second signal

Bruce Richardson bruce.richardson at intel.com
Tue Apr 28 10:00:15 CEST 2026


On Mon, Apr 27, 2026 at 10:26:17AM -0700, Stephen Hemminger wrote:
> The SIGINT/SIGTERM handler starts a graceful shutdown via
> prompt_exit(), after which prompt() frees the cmdline object with
> cmdline_stdin_exit(). A second signal delivered during or after
> that free re-enters prompt_exit() and dereferences testpmd_cl,
> producing a use-after-free.
> 
> Set SA_RESETHAND so the second signal terminates the process via
> SIG_DFL instead of re-running the shutdown path. On Windows the
> C runtime's signal() already resets the disposition after delivery,
> so behavior is consistent without an #ifdef.
> 
> Fixes: f1d0993e034e ("app/testpmd: fix interactive mode on Windows")
> Cc: stable at dpdk.org
> Reported-by: Sunyang Wu <sunyang.wu at jaguarmicro.com>
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> ---
>  app/test-pmd/testpmd.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
Acked-by: Bruce Richardson <bruce.richardson at intel.com>


More information about the stable mailing list