[dpdk-dev] Ignoring number of bytes read in eal

2016-07-11 Thread Sergio Gonzalez Monroy
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


[dpdk-dev] Ignoring number of bytes read in eal

2016-07-11 Thread David Marchand
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 ?


-- 
David Marchand


[dpdk-dev] Ignoring number of bytes read in eal

2016-06-28 Thread Kobylinski, MichalX
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