From: Thomas Monjalon <thomas@monjalon.net>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev@dpdk.org, 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>,
Sriram Yagnaraman <sriram.yagnaraman@ericsson.com>,
Jakub Grajciar <jgrajcia@cisco.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>,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Subject: Re: [PATCH v5] ethdev: add buffer size parameter to rte_eth_dev_get_name_by_port()
Date: Thu, 19 Nov 2026 01:30:15 +0100 [thread overview]
Message-ID: <9EzA-lUmTGW-JmFduPnSYg@monjalon.net> (raw)
In-Reply-To: <20261116103711.45e7d6e5@phoenix.local>
16/11/2026 19:37, Stephen Hemminger:
> On Sun, 15 Nov 2026 13:36:21 -0800
> 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.
> >
> > Update all in-tree callers to pass the size of the buffer
> > and add checks for return value.
> >
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> > ---
>
> I think this should go into 26.11 just because it is easier to do
> API change in LTS version rather than having to do function versioning.
> If not will resend with function versioning for 27.03
This patch should have been merged earlier but was missed in next-net.
After verification, it looks safe.
Applied as an exception in -rc4, thanks.
prev parent reply other threads:[~2026-11-19 0:30 UTC|newest]
Thread overview: 14+ 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
2026-06-03 2:20 ` Stephen Hemminger
2026-07-23 21:06 ` [PATCH v3] " Stephen Hemminger
2026-08-05 17:00 ` [PATCH v4] " Stephen Hemminger
2026-08-06 17:47 ` Stephen Hemminger
2026-11-15 21:36 ` [PATCH v5] " Stephen Hemminger
2026-11-16 18:37 ` Stephen Hemminger
2026-11-19 0:30 ` Thomas Monjalon [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=9EzA-lUmTGW-JmFduPnSYg@monjalon.net \
--to=thomas@monjalon.net \
--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=jgrajcia@cisco.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=sriram.yagnaraman@ericsson.com \
--cc=stephen@networkplumber.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