From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A99B8A04BA for ; Thu, 1 Oct 2020 16:15:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9A58F1DB70; Thu, 1 Oct 2020 16:15:02 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 4E75C1DB70; Thu, 1 Oct 2020 16:15:00 +0200 (CEST) IronPort-SDR: Js1bhnjhmNcynNrwiWq1m4/M0yXqtJQnL7Uh7ln6l9xsP+hNjyUZXoK3Ha+0bwFFzNCwDI101M RW1fvPm2ad8w== X-IronPort-AV: E=McAfee;i="6000,8403,9760"; a="226858672" X-IronPort-AV: E=Sophos;i="5.77,323,1596524400"; d="scan'208";a="226858672" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Oct 2020 07:14:56 -0700 IronPort-SDR: iDnAiR3sprYE0HKiumDIgR2XWF2qjScarURiUoxNctAiLuEt7pk4wqWQnsxua2ryTcoU0sPTY7 gi93vC4VL1zA== X-IronPort-AV: E=Sophos;i="5.77,323,1596524400"; d="scan'208";a="503833970" Received: from klaatz-mobl1.ger.corp.intel.com (HELO [10.213.254.16]) ([10.213.254.16]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Oct 2020 07:14:55 -0700 To: Ferruh Yigit , dev@dpdk.org Cc: bruce.richardson@intel.com, stable@dpdk.org, David Marchand , Stephen Hemminger References: <20200922172015.266698-1-kevin.laatz@intel.com> <4801cf86-8a4d-f63f-d240-0176b6b51abb@intel.com> From: Kevin Laatz Message-ID: <6eceabb8-ab9c-8774-46d9-b5ffef5cdab7@intel.com> Date: Thu, 1 Oct 2020 15:14:52 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <4801cf86-8a4d-f63f-d240-0176b6b51abb@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [dpdk-stable] [PATCH] net/ring: fix unchecked return value X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 >> --- >>   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. - Kevin