]> git.droids-corp.org - dpdk.git/commit
test/mbuf: fix access to freed memory
authorOlivier Matz <olivier.matz@6wind.com>
Fri, 29 Oct 2021 12:15:44 +0000 (14:15 +0200)
committerDavid Marchand <david.marchand@redhat.com>
Thu, 4 Nov 2021 10:19:26 +0000 (11:19 +0100)
commit7dc627426e534c3b04e4f872343e1899df26471e
tree142c921ca26c97feac7abcf77cc83e1c0b92e30f
parent86e361cdeb495c70a154f25cd47fd6581c9aff89
test/mbuf: fix access to freed memory

Seen by ASan.

In the external buffer mbuf test, we check that the buffer is freed
by checking that its refcount is 0.
This is not a valid condition, because it accesses to an already
freed area.

Fix this by setting a boolean flag in the callback when rte_free()
is actually called, and check this flag instead.

Bugzilla ID: 867
Fixes: 7b295dceea07 ("test/mbuf: add unit test cases")
Cc: stable@dpdk.org
Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
app/test/test_mbuf.c