From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
Reshma Pattan <reshma.pattan@intel.com>,
Aman Singh <aman.deep.singh@intel.com>,
Naga Harish K S V <s.v.naga.harish.k@intel.com>,
Bruce Richardson <bruce.richardson@intel.com>,
Kishore Padmanabha <kishore.padmanabha@broadcom.com>,
Ajit Khaparde <ajit.khaparde@broadcom.com>,
Nithin Dabilpuram <ndabilpuram@marvell.com>,
Kiran Kumar K <kirankumark@marvell.com>,
Sunil Kumar Kori <skori@marvell.com>,
Satha Rao <skoteshwar@marvell.com>,
Harman Kalra <hkalra@marvell.com>,
Anatoly Burakov <anatoly.burakov@intel.com>,
Cristian Dumitrescu <cristian.dumitrescu@intel.com>,
Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [PATCH v2] ethdev: add buffer size parameter to rte_eth_dev_get_name_by_port()
Date: Tue, 2 Jun 2026 13:53:06 -0700 [thread overview]
Message-ID: <20260602135226.33840db1@phoenix.local> (raw)
In-Reply-To: <20260529000748.275863-1-stephen@networkplumber.org>
On Thu, 28 May 2026 17:07:48 -0700
Stephen Hemminger <stephen@networkplumber.org> wrote:
> rte_eth_dev_get_name_by_port() uses strcpy() into a caller-provided
> buffer with no bounds checking. A mistaken caller that supplies a
> buffer smaller than RTE_ETH_NAME_MAX_LEN can overflow the buffer.
>
> Add a size parameter and replace strcpy() with strlcpy(), returning
> -ERANGE if the name is truncated. The copy is now performed under
> the ethdev shared data lock so that the name cannot be mutated by
> another process between reading and copying.
>
> The previous ABI is preserved via symbol versioning (DPDK_26) with a
> thin wrapper that delegates to the new implementation with
> RTE_ETH_NAME_MAX_LEN. The versioned symbol will be removed in 26.11.
>
> Update all in-tree callers to pass sizeof(name) as the new parameter.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> ---
Applied to next-net
next prev parent reply other threads:[~2026-06-02 20:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-09 1:36 [RFC] ethdev: add buffer size parameter to rte_eth_dev_get_name_by_port() Stephen Hemminger
2026-04-09 6:59 ` Andrew Rybchenko
2026-04-09 7:58 ` Bruce Richardson
2026-04-09 9:05 ` Andrew Rybchenko
2026-04-09 15:23 ` Stephen Hemminger
2026-05-29 0:07 ` [PATCH v2] " Stephen Hemminger
2026-06-02 20:53 ` Stephen Hemminger [this message]
2026-06-03 2:20 ` Stephen Hemminger
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=20260602135226.33840db1@phoenix.local \
--to=stephen@networkplumber.org \
--cc=ajit.khaparde@broadcom.com \
--cc=aman.deep.singh@intel.com \
--cc=anatoly.burakov@intel.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=bruce.richardson@intel.com \
--cc=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=hkalra@marvell.com \
--cc=kirankumark@marvell.com \
--cc=kishore.padmanabha@broadcom.com \
--cc=ndabilpuram@marvell.com \
--cc=reshma.pattan@intel.com \
--cc=s.v.naga.harish.k@intel.com \
--cc=skori@marvell.com \
--cc=skoteshwar@marvell.com \
--cc=thomas@monjalon.net \
/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