From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH 0/2] net/cnxk: harden telemetry parameter parsing
Date: Fri, 5 Jun 2026 15:44:38 -0700 [thread overview]
Message-ID: <20260605224514.651081-1-stephen@networkplumber.org> (raw)
The cnxk telemetry handlers parse their command parameters with strtok(),
which keeps non-reentrant internal state and races when telemetry callbacks
run on per-connection threads. Both handlers also trust the parsed integers
more than they should: values are narrowed to the destination width or
aliased to a valid index before any range check, so an out-of-range port or
queue id can slip through and read past the backing array.
These two patches replace the strtok() walks with strtoul()/endptr parsing,
range-check each value before it is used, and drop the strdup()/free() that
the old SA-info path needed. The NIX handler additionally copies the full
parameter string rather than capping it at PCI_PRI_STR_SIZE + 1, which had
been truncating the queue id for longer device addresses.
Stephen Hemminger (2):
net/cnxk: fix telemetry SA info parameter parsing
common/cnxk: fix thread-unsafe NIX telemetry parsing
drivers/common/cnxk/cnxk_telemetry_nix.c | 80 ++++++++------------
drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c | 50 ++++++------
2 files changed, 54 insertions(+), 76 deletions(-)
--
2.53.0
next reply other threads:[~2026-06-05 22:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-05 22:44 Stephen Hemminger [this message]
2026-06-05 22:44 ` [PATCH 1/2] net/cnxk: fix telemetry SA info parameter parsing Stephen Hemminger
2026-06-05 22:44 ` [PATCH 2/2] common/cnxk: fix thread-unsafe NIX telemetry parsing Stephen Hemminger
2026-06-09 5:02 ` Jerin Jacob
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=20260605224514.651081-1-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
/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