DPDK patches and discussions
 help / color / mirror / Atom feed
From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [DPDK/ethdev Bug 1791] cnxk driver reference past requested xstat array
Date: Tue, 23 Sep 2025 14:05:45 +0000	[thread overview]
Message-ID: <bug-1791-3@https.bugs.dpdk.org/> (raw)

[-- Attachment #1: Type: text/plain, Size: 1446 bytes --]

https://bugs.dpdk.org/show_bug.cgi?id=1791

            Bug ID: 1791
           Summary: cnxk driver reference past requested xstat array
           Product: DPDK
           Version: 25.07
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: ethdev
          Assignee: dev@dpdk.org
          Reporter: stephen@networkplumber.org
  Target Milestone: ---

Because the cnxk driver ignores the limit arguement in some functions such as
xstat_names_get(). If the application asks for only some of the values in the
xstats then an out of bounds reference is possible.

Something like:
  struct rte_esth_xstat_name names[20];

  rte_eth_xstat_get_names(port_id, names, 20);

will cause out of bound array reference down here:



int
roc_nix_xstats_names_get(struct roc_nix *roc_nix,
                         struct roc_nix_xstat_name *xstats_names,
                         unsigned int limit)
{
        struct nix *nix = roc_nix_to_nix_priv(roc_nix);
        struct idev_cfg *idev = idev_get_cfg();
        uint64_t i, count = 0;

        PLT_SET_USED(limit);

        for (i = 0; i < CNXK_NIX_NUM_TX_XSTATS; i++) {
                NIX_XSTATS_NAME_PRINT(xstats_names, count, nix_tx_xstats, i);
                count++;
        }

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #2: Type: text/html, Size: 3325 bytes --]

                 reply	other threads:[~2025-09-23 14:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=bug-1791-3@https.bugs.dpdk.org/ \
    --to=bugzilla@dpdk.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;
as well as URLs for NNTP newsgroup(s).