DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Ignoring number of bytes read in eal
@ 2016-06-28  8:40 Kobylinski, MichalX
  2016-07-11  4:48 ` David Marchand
  0 siblings, 1 reply; 3+ messages in thread
From: Kobylinski, MichalX @ 2016-06-28  8:40 UTC (permalink / raw)
  To: david.marchand; +Cc: dev

Hi David,

I'm working on issue reported by Coverity.

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.

What's your opinion?

Regards,
Michal

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] Ignoring number of bytes read in eal
  2016-06-28  8:40 [dpdk-dev] Ignoring number of bytes read in eal Kobylinski, MichalX
@ 2016-07-11  4:48 ` David Marchand
  2016-07-11  8:51   ` Sergio Gonzalez Monroy
  0 siblings, 1 reply; 3+ messages in thread
From: David Marchand @ 2016-07-11  4:48 UTC (permalink / raw)
  To: Kobylinski, MichalX; +Cc: dev, Sergio Gonzalez Monroy

Hello,

On Tue, Jun 28, 2016 at 10:40 AM, Kobylinski, MichalX
<michalx.kobylinski@intel.com> 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 ?


-- 
David Marchand

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] Ignoring number of bytes read in eal
  2016-07-11  4:48 ` David Marchand
@ 2016-07-11  8:51   ` Sergio Gonzalez Monroy
  0 siblings, 0 replies; 3+ messages in thread
From: Sergio Gonzalez Monroy @ 2016-07-11  8:51 UTC (permalink / raw)
  To: David Marchand, Kobylinski, MichalX; +Cc: dev

On 11/07/2016 05:48, David Marchand wrote:
> Hello,
>
> On Tue, Jun 28, 2016 at 10:40 AM, Kobylinski, MichalX
> <michalx.kobylinski@intel.com> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-11  8:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-28  8:40 [dpdk-dev] Ignoring number of bytes read in eal Kobylinski, MichalX
2016-07-11  4:48 ` David Marchand
2016-07-11  8:51   ` Sergio Gonzalez Monroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).