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 B3FF3A04B7; Tue, 13 Oct 2020 19:24:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 14C911D70F; Tue, 13 Oct 2020 19:24:07 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 0B41E1D6F8; Tue, 13 Oct 2020 19:24:03 +0200 (CEST) IronPort-SDR: uz5b4V7fsZnbqtR5L39UIZ6i8xyWl2RzyoT7rMePEjb/CF5P52PHnyCd0Q7uKINNMBD++1mAZC O4/VWtJy55Ug== X-IronPort-AV: E=McAfee;i="6000,8403,9773"; a="163313556" X-IronPort-AV: E=Sophos;i="5.77,371,1596524400"; d="scan'208";a="163313556" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2020 10:24:02 -0700 IronPort-SDR: Y5E6zRkctlZUYf6RoiNC2Yom6YGjyUAeJGxvyqzLRa4mNWIk+p1eEHOzjUxyg3nrz+me/bQR8i K8Ap4ro2mzoQ== X-IronPort-AV: E=Sophos;i="5.77,371,1596524400"; d="scan'208";a="530488999" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.214.64]) ([10.213.214.64]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2020 10:24:00 -0700 To: Kevin Laatz , dev@dpdk.org Cc: bruce.richardson@intel.com, stephen@networkplumber.org, stable@dpdk.org References: <20201001170902.487111-1-kevin.laatz@intel.com> <20201013130704.1186595-1-kevin.laatz@intel.com> From: Ferruh Yigit Message-ID: <155dc035-457d-f794-0bfc-8bb20b09ca68@intel.com> Date: Tue, 13 Oct 2020 18:23:53 +0100 MIME-Version: 1.0 In-Reply-To: <20201013130704.1186595-1-kevin.laatz@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v3] net/ring: fix unchecked return value X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 10/13/2020 2:07 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 <...> > +#define ETH_RING_INTERNAL_ARG_MAX_LEN 19 Added following comment while merging: /* "0x..16chars..\0" */ <...> > - sscanf(value, "%p", &args); > + /* make sure 'value' is valid pointer length */ > + if (strnlen(value, ETH_RING_INTERNAL_ARG_MAX_LEN) >= > + ETH_RING_INTERNAL_ARG_MAX_LEN) { > + PMD_LOG(ERR, "Error parsing internal args, 'value' too long"); 'value' is variable name and may not fit to the debug log. Replaced with "..., argument is too long" while merging. Reviewed-by: Ferruh Yigit Applied to dpdk-next-net/main, thanks.