DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: ": Ruifeng Wang" <ruifeng.wang@arm.com>,
	Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Cc: dev@dpdk.org
Subject: Unsafe memory access in testpmd
Date: Thu, 13 Oct 2022 16:39:28 -0700	[thread overview]
Message-ID: <20221013163928.49930348@hermes.local> (raw)

Noticed that test-pmd is using a signal handler to exit.
And that signal handle clears a flag "f_quit".
But that variable is updated without atomic and is not volatile.

Simple fix to use atomic, would fix that part.
But the signal_handler is calling a bunch of functions that are not
safe in a signal handler.

The signal handler in testpmd should only be doing atomic
update of f_quit.  All the cleanup logic needs to be moved to
a place where thread is an safe state, like after exiting
the forwarding loop in main thread.

The problem is that testpmd has grown in complexity and not
sure if this won't break other things.

             reply	other threads:[~2022-10-13 23:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-13 23:39 Stephen Hemminger [this message]
2022-10-17  8:03 ` Ruifeng Wang

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=20221013163928.49930348@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=ruifeng.wang@arm.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;
as well as URLs for NNTP newsgroup(s).