DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Denis Sergeev <denserg.edu@gmail.com>
Cc: dev@dpdk.org, sdl.dpdk@linuxtesting.org
Subject: Re: [PATCH] net/af_packet: fix qpairs argument upper bound check
Date: Wed, 3 Jun 2026 08:27:49 -0700	[thread overview]
Message-ID: <20260603082651.3fb3e81f@phoenix.local> (raw)
In-Reply-To: <20260603044228.117357-1-denserg.edu@gmail.com>

On Wed,  3 Jun 2026 07:42:18 +0300
Denis Sergeev <denserg.edu@gmail.com> wrote:

> diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
> index 0ee94e71ea..ebf015dd9a 100644
> --- a/drivers/net/af_packet/rte_eth_af_packet.c
> +++ b/drivers/net/af_packet/rte_eth_af_packet.c
> @@ -1169,7 +1169,7 @@ rte_eth_from_packet(struct rte_vdev_device *dev,
>  		pair = &kvlist->pairs[k_idx];
>  		if (strstr(pair->key, ETH_AF_PACKET_NUM_Q_ARG) != NULL) {
>  			qpairs = atoi(pair->value);
> -			if (qpairs < 1) {
> +			if (qpairs < 1 || qpairs > RTE_MAX_QUEUES_PER_PORT) {
>  				PMD_LOG(ERR,
>  					"%s: invalid qpairs value",
>  				        name);
> -- 

I would rather see atoi() not used in DPDK, it accepts too much and does not do
enough validation. Replace with strtoul() instead.

  reply	other threads:[~2026-06-03 15:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-03  4:42 [PATCH] net/af_packet: fix qpairs argument upper bound check Denis Sergeev
2026-06-03 15:27 ` Stephen Hemminger [this message]
2026-06-03 17:08 ` [PATCH v2] " Denis Sergeev
2026-06-03 18:13   ` [PATCH] net/af_packet: fix parsing of numeric device args 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=20260603082651.3fb3e81f@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=denserg.edu@gmail.com \
    --cc=dev@dpdk.org \
    --cc=sdl.dpdk@linuxtesting.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