[dpdk-dev] test-pmd: Free of address-of expression

Mrozowicz, SlawomirX slawomirx.mrozowicz at intel.com
Tue May 17 09:55:54 CEST 2016


Hi,

Noticed is that in the file:
app/test-pmd/mempool.c
using of the function munmap() could cause a problem.

Coverity static code analyzer provide error (CID 13184) in line 158:
munmap frees incorrect pointer uv.

I noticed information on the net:
https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxbd00/mumap.htm
"If addr is not the address of a mapping established by a prior call to mmap(), the behavior is undefined"

I have analyzed the code and I have done some test with gcc.
It seems that it is possible to free subrange of the mapping memory.
In the mempool.c code the address is calculated independently.
Anyway in my opinion the address variable uv is calculated correctly.

So we should classify this issue as a  False Positive.
Please accept the conclusion.

Slawomir Mrozowicz
Sii Engineer
Delivering outsourced services to Intel
Intel Technology Poland sp. z o.o. - KRS 101882 - ul. Slowackiego 173, 80-298 Gdansk



More information about the dev mailing list