Skip to content

Coverity fixes for malloc

Anatoly Burakov dpdk-dev 2 versions – Applied

Status from this message: Applied, thanks

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 5 repliesApplied
  2. v15 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- Dropped fixes for 272571, 272590, 272597 as false positives

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3malloc: replace snprintf with strlcpylib/librte_eal/common/malloc_mp.c+11 -121 reply
2/3malloc: fix potential out-of-bounds array accesslib/librte_eal/common/malloc_heap.c+2 -11 reply
3/3malloc: fix potential dereferencing of NULL pointerlib/librte_eal/common/malloc_elem.c+6 -02 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchHarry van Haaren
1/3A-b
2/3A-b
3/3A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] Coverity fixes for malloc

This patchset fixes a few Coverity issues in malloc introduced by recent DPDK memory hotplug patchset.

Coverity issues fixed:
- 272566 - possible null dereference
- 272574 - use value before verification

The following coverity issues were not fixed:
- 272573 - calling memset with size 0
- This is intentional, size will not be 0 in malloc debug
- 272571 - negative return not handled
- False positive, proper API usage ensures no negative returns
- 272590 - negative return not handled
- Same as above
- 272597 - negative return not handled
- Same as above

Also, replace all instaces of snprintf with strlcpy.

v2:
- Dropped fixes for 272571, 272590, 272597 as false positives

Anatoly Burakov (3):
malloc: replace snprintf with strlcpy
malloc: fix potential out-of-bounds array access
malloc: fix potential dereferencing of NULL pointer

 lib/librte_eal/common/malloc_elem.c |  6 ++++++
 lib/librte_eal/common/malloc_heap.c |  3 ++-
 lib/librte_eal/common/malloc_mp.c   | 23 +++++++++++------------
 3 files changed, 19 insertions(+), 13 deletions(-)
Signature · 1 line
2.7.4