[dpdk-dev] Ignoring number of bytes read in eal
David Marchand
david.marchand at 6wind.com
Mon Jul 11 06:48:23 CEST 2016
Hello,
On Tue, Jun 28, 2016 at 10:40 AM, Kobylinski, MichalX
<michalx.kobylinski at 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
More information about the dev
mailing list