DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Sunyang Wu <sunyang.wu@jaguarmicro.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"aman.deep.singh@intel.com" <aman.deep.singh@intel.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: 回复: [PATCH] app/testpmd: avoid cmdline use-after-free on SIGINT
Date: Mon, 27 Apr 2026 11:43:06 +0100	[thread overview]
Message-ID: <ae89uiRN-SC40aR_@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <KL1PR0601MB5567C08F8735C6DF18AF973F90362@KL1PR0601MB5567.apcprd06.prod.outlook.com>

On Mon, Apr 27, 2026 at 10:33:42AM +0000, Sunyang Wu wrote:
> Hi Bruce,
> 
> Thanks for the review.
> 
> I do not think a memory barrier alone would be sufficient here.
> 
> In the intended case, prompt_exit() is used from the signal path to
> interrupt the thread currently running prompt(). In that case, the
> NULL store is already ordered before cmdline_stdin_exit(). However,
> for a later signal or a signal delivered to another thread, a plain
> barrier would still not make concurrent access to testpmd_cl safe.
> 
> I think the better fix is to keep the existing prompt_exit() behavior,
> but use a local cmdline pointer for lifetime management and atomic
> load/store for testpmd_cl so the signal path cannot observe freed
> state.
> 
> If this approach looks reasonable to you, I will send a v2.
> 

Sounds reasonable to me, but I'm not an expert on the behaviour of weakly
ordered platforms! I think do a v2 with your proposal anyway, since it's
likely an improvement over the v1.

/Bruce

      reply	other threads:[~2026-04-27 10:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27  9:10 [PATCH] app/testpmd: avoid cmdline use-after-free on SIGINT Sunyang Wu
2026-04-27 10:02 ` Bruce Richardson
2026-04-27 10:33   ` 回复: " Sunyang Wu
2026-04-27 10:43     ` Bruce Richardson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ae89uiRN-SC40aR_@bricha3-mobl1.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=sunyang.wu@jaguarmicro.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox