From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id EBE7F2BBD for ; Mon, 11 Jul 2016 10:51:22 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP; 11 Jul 2016 01:51:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,345,1464678000"; d="scan'208";a="1004471097" Received: from smonroyx-mobl.ger.corp.intel.com (HELO [10.237.220.129]) ([10.237.220.129]) by fmsmga001.fm.intel.com with ESMTP; 11 Jul 2016 01:51:22 -0700 To: David Marchand , "Kobylinski, MichalX" References: <987EE72691933347B9F0B5C19E71B5BB1F0A9974@IRSMSX101.ger.corp.intel.com> Cc: "dev@dpdk.org" From: Sergio Gonzalez Monroy Message-ID: <58c5063d-32ba-085f-184a-aa9486e23ed9@intel.com> Date: Mon, 11 Jul 2016 09:51:20 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] Ignoring number of bytes read in eal X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2016 08:51:23 -0000 On 11/07/2016 05:48, David Marchand wrote: > Hello, > > On Tue, Jun 28, 2016 at 10:40 AM, Kobylinski, MichalX > wrote: >> CID 13212 - Ignoring number of bytes read: >> The number of bytes copied into the buffer can be smaller than the requested number and the buffer can potentially be accessed out of range. >> In rte_mem_virt2phy: Value returned from a function and indicating the number of bytes read is ignored. >> >> File: /lib/librte_eal/linuxapp/eal/eal_memory.c >> Line: 187 >> >> Can I mark this error as "False Positive"? >> >> Because return from read function is checked in "if" condition. If return from read is less than 0 function rte_mem_virt2phy is aborted and return: log message, RTE_BAD_PHYS_ADDR. > ? > > Coverity is complaining because (in theory) read can return less than > sizeof(uint64_t). > This most likely can't happen, but still coverity is right from my pov. > > I'd rather fix this than mark this as false positive, Sergio ? I agree with David, let's fix this. Sergio