Skip to content

Coverity fixes for EAL memory

Anatoly Burakov dpdk-dev 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest9 patches 2 repliesIn review
  2. v2 posting 2/21 patch 0 repliesSuperseded
  3. v39 patches 18 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v2 posting 1/210 patches0 repliesSuperseded
v110 patches3 repliesSuperseded

Changes in v4 from the cover letter

- Better comments for fd leak fixes
- Improve fix for double close fd

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9mem: use strlcpy instead of snprintflib/librte_eal/common/eal_common_memalloc.c+3 -20 replies
2/9mem: fix resource leaklib/librte_eal/linuxapp/eal/eal_memory.c+1 -00 replies
3/9mem: fix potential double closelib/librte_eal/linuxapp/eal/eal_memalloc.c+4 -31 reply
4/9mem: fix potential resource leaklib/librte_eal/linuxapp/eal/eal_memalloc.c+4 -30 replies
5/9mem: fix potential resource leaklib/librte_eal/linuxapp/eal/eal_memalloc.c+4 -30 replies
6/9mem: fix comparing pointer to valuelib/librte_eal/linuxapp/eal/eal_memalloc.c+1 -10 replies
7/9mem: fix potential bad unmaplib/librte_eal/linuxapp/eal/eal_memalloc.c+2 -10 replies
8/9mem: fix statement having no effectlib/librte_eal/linuxapp/eal/eal_memalloc.c+6 -10 replies
9/9mem: fix possible use-after-freelib/librte_eal/common/eal_common_memory.c+3 -30 replies

Reviews trailers per patch

8 of 9 patches have a Reviewed-by or Acked-by.

PatchBruce Richardson
1/9A-b
2/9A-b
3/9A-b
4/9A-b
5/9
6/9A-b
7/9A-b
8/9A-b
9/9A-b

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

Read the v4 thread

Cover letter [PATCH v4 0/9] Coverity fixes for EAL memory

This patchset fixes a host of coverity issues in memory subsystem introduced with recent DPDK memory hotplug patchset.

Coverity issues fixed:
- 272601 - leaking fd
- 272560 - double close fd
- 272568 - leaking fd
- 272570 - leaking fd
- 272589 - dereference before null check
- 272602 - freeing wrong pointer
- 272608 - expression does nothing
- 272584 - use after free

Coverity issues not fixed:
- 272577 - negative return not handled
- 272578 - negative return not handled
- Proper usage of API guarantees no negative returns

Additionally, also replace all instances of snprintf with strlcpy.

v4:
- Better comments for fd leak fixes
- Improve fix for double close fd

v3:
- Drop fixes for 272577 and 272578 and mark them as false positives

v2:
- Rebase on top of latest master

Anatoly Burakov (9):
mem: use strlcpy instead of snprintf
mem: fix resource leak
mem: fix potential double close
mem: fix potential resource leak
mem: fix potential resource leak
mem: fix comparing pointer to value
mem: fix potential bad unmap
mem: fix statement having no effect
mem: fix possible use-after-free

 lib/librte_eal/common/eal_common_memalloc.c |  5 +++--
 lib/librte_eal/common/eal_common_memory.c   |  6 +++---
 lib/librte_eal/linuxapp/eal/eal_memalloc.c  | 33 ++++++++++++++++++-----------
 lib/librte_eal/linuxapp/eal/eal_memory.c    |  1 +
 4 files changed, 28 insertions(+), 17 deletions(-)
Signature · 1 line
2.7.4