DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Chengwen Feng <fengchengwen@huawei.com>
Cc: <thomas@monjalon.net>, <ferruh.yigit@amd.com>, <dev@dpdk.org>,
	<zr@semihalf.com>, <lironh@marvell.com>
Subject: Re: [PATCH v2] net/mvneta: fix possible out-of-bounds write
Date: Wed, 9 Oct 2024 11:00:40 -0700	[thread overview]
Message-ID: <20241009110040.11386e4f@hermes.local> (raw)
In-Reply-To: <20241009060845.2702-1-fengchengwen@huawei.com>

On Wed, 9 Oct 2024 06:08:45 +0000
Chengwen Feng <fengchengwen@huawei.com> wrote:

> The mvneta_ifnames_get() function will save 'iface' value to ifnames,
> it will out-of-bounds write if passed many iface pairs (e.g.
> 'iface=xxx,iface=xxx,...').
> 
> Fixes: 4ccc8d770d3b ("net/mvneta: add PMD skeleton")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
> 
> ---
> v2: add error log which address Stephen's comment.
> 
> ---
>  drivers/net/mvneta/mvneta_ethdev.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c
> index 3841c1ebe9..e641f19266 100644
> --- a/drivers/net/mvneta/mvneta_ethdev.c
> +++ b/drivers/net/mvneta/mvneta_ethdev.c
> @@ -91,6 +91,11 @@ mvneta_ifnames_get(const char *key __rte_unused, const char *value,
>  {
>  	struct mvneta_ifnames *ifnames = extra_args;
>  
> +	if (ifnames->idx >= NETA_NUM_ETH_PPIO) {
> +		MVNETA_LOG(ERROR, "Detect too many ifnames!");
> +		return -EINVAL;
> +	}
> +

Compile fails due to typo. Need to use "ERR," not "ERROR,"

  parent reply	other threads:[~2024-10-09 18:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09  2:23 [PATCH] " Chengwen Feng
2024-10-09  3:48 ` Stephen Hemminger
2024-10-09  3:48 ` zhoumin
2024-10-09  6:08 ` [PATCH v2] " Chengwen Feng
2024-10-09 15:09   ` Stephen Hemminger
2024-10-09 18:00   ` Stephen Hemminger [this message]
2024-10-10  1:01     ` fengchengwen
2024-10-10  0:53 ` [PATCH v3] " Chengwen Feng
2024-10-10  1:10   ` 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=20241009110040.11386e4f@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=ferruh.yigit@amd.com \
    --cc=lironh@marvell.com \
    --cc=thomas@monjalon.net \
    --cc=zr@semihalf.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).