From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anatoly Burakov Subject: [PATCH v4 0/9] Coverity fixes for EAL memory Date: Fri, 27 Apr 2018 18:07:01 +0100 Message-ID: References: Cc: thomas@monjalon.net, bruce.richardson@intel.com To: dev@dpdk.org Return-path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 31093AAD6 for ; Fri, 27 Apr 2018 19:07:13 +0200 (CEST) In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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(-) -- 2.7.4