DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  test-pmd: Free of address-of expression
@ 2016-05-17  7:55 Mrozowicz, SlawomirX
  2016-05-17  8:16 ` Olivier MATZ
  0 siblings, 1 reply; 2+ messages in thread
From: Mrozowicz, SlawomirX @ 2016-05-17  7:55 UTC (permalink / raw)
  To: olivier.matz; +Cc: dev

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

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

* Re: [dpdk-dev] test-pmd: Free of address-of expression
  2016-05-17  7:55 [dpdk-dev] test-pmd: Free of address-of expression Mrozowicz, SlawomirX
@ 2016-05-17  8:16 ` Olivier MATZ
  0 siblings, 0 replies; 2+ messages in thread
From: Olivier MATZ @ 2016-05-17  8:16 UTC (permalink / raw)
  To: Mrozowicz, SlawomirX; +Cc: dev

Hi,


On 05/17/2016 09:55 AM, Mrozowicz, SlawomirX wrote:
> 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.

This file (app/test-pmd/mempool_anon.c) will be removed soon.
Please see http://dpdk.org/dev/patchwork/patch/12067/

So I think we can ignore this alert, as the new code does not
have the same issue.

Regards,
Olivier

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

end of thread, other threads:[~2016-05-17  8:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-17  7:55 [dpdk-dev] test-pmd: Free of address-of expression Mrozowicz, SlawomirX
2016-05-17  8:16 ` Olivier MATZ

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).