patches for DPDK stable branches
 help / color / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Kevin Laatz <kevin.laatz@intel.com>, dev@dpdk.org
Cc: bruce.richardson@intel.com, stable@dpdk.org,
	David Marchand <david.marchand@redhat.com>,
	Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: [dpdk-stable] [PATCH] net/ring: fix unchecked return value
Date: Thu, 1 Oct 2020 15:51:38 +0100
Message-ID: <8e441cd7-b6f4-fd46-7448-c116a41a295d@intel.com> (raw)
In-Reply-To: <6eceabb8-ab9c-8774-46d9-b5ffef5cdab7@intel.com>

On 10/1/2020 3:14 PM, Kevin Laatz wrote:
> 
> On 25/09/2020 13:43, Ferruh Yigit wrote:
>> On 9/22/2020 6:20 PM, Kevin Laatz wrote:
>>> Add a check for the return value of the sscanf call in
>>> parse_internal_args(), returning an error if we don't get the expected
>>> result.
>>>
>>> Coverity issue: 362049
>>> Fixes: 96cb19521147 ("net/ring: use EAL APIs in PMD specific API")
>>> Cc: stable@dpdk.org
>>>
>>> Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
>>> ---
>>>   drivers/net/ring/rte_eth_ring.c | 3 ++-
>>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
>>> index 40fe1ca4ba..62060e46ce 100644
>>> --- a/drivers/net/ring/rte_eth_ring.c
>>> +++ b/drivers/net/ring/rte_eth_ring.c
>>> @@ -539,7 +539,8 @@ parse_internal_args(const char *key __rte_unused, const 
>>> char *value,
>>>       struct ring_internal_args **internal_args = data;
>>>       void *args;
>>>   -    sscanf(value, "%p", &args);
>>> +    if (sscanf(value, "%p", &args) != 1)
>>> +        return -1;
>>
>> I am aware that this is just to fix the coverity error to check the return 
>> value, BUT :)
>>
>> The internal args is mainly to pass the information get by API 
>> ('rte_eth_from_ring()') to ring probe. And the main information to pass is the 
>> ring.
>> It may be possible to pass the ring_name only and eliminate internal args 
>> completely, the driver already has a way to pass ring name:
>> "nodeaction=name:node:ATTACH" devargs.
>>
>> If you have time, can you please check if it can be possible to fill and pass 
>> the nodeaction devargs in 'rte_eth_from_rings()' and eliminate the 'internal' 
>> devargs completely?
>> If it works, as a bonus it will resolve above coverity issue by removing it :)
>>
> Hi Ferruh,
> 
> It seems to be used for more than just that - after the parsing, the internal 
> args are passed to do_eth_dev_ring_create() as multiple parameters.
> 

Yes multiple args passed to 'do_eth_dev_ring_create()' from internal arg, and 
they may be provided via existing nodeaction arg too, needs to be checked.

Anyway, the option to eliminate the internal args is just a good to have, we can 
check it later instead making the this coverity fix more complex.

  reply index

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22 17:20 Kevin Laatz
2020-09-23  8:06 ` [dpdk-stable] [dpdk-dev] " David Marchand
2020-09-23  9:39   ` Bruce Richardson
2020-09-23  9:43     ` David Marchand
2020-09-23 10:04       ` Kevin Laatz
2020-09-23 10:25       ` Bruce Richardson
2020-09-25 12:43 ` [dpdk-stable] " Ferruh Yigit
2020-10-01 14:14   ` Kevin Laatz
2020-10-01 14:51     ` Ferruh Yigit [this message]
2020-10-01 17:09 ` [dpdk-stable] [PATCH v2] " Kevin Laatz
2020-10-12 11:57   ` Ferruh Yigit
2020-10-12 12:45     ` Bruce Richardson
2020-10-12 13:04       ` Ferruh Yigit
2020-10-12 13:11         ` Bruce Richardson
2020-10-13 13:07   ` [dpdk-stable] [PATCH v3] " Kevin Laatz
2020-10-13 17:23     ` Ferruh Yigit

Reply instructions:

You may reply publically 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=8e441cd7-b6f4-fd46-7448-c116a41a295d@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=kevin.laatz@intel.com \
    --cc=stable@dpdk.org \
    --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

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox