From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <aburakov@ecsmtp.ir.intel.com>
Received: from mga14.intel.com (mga14.intel.com [192.55.52.115])
 by dpdk.org (Postfix) with ESMTP id 340B92C12
 for <dev@dpdk.org>; Wed, 25 Apr 2018 11:56:50 +0200 (CEST)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga005.fm.intel.com ([10.253.24.32])
 by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 25 Apr 2018 02:56:48 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.49,325,1520924400"; d="scan'208";a="223192368"
Received: from irvmail001.ir.intel.com ([163.33.26.43])
 by fmsmga005.fm.intel.com with ESMTP; 25 Apr 2018 02:56:48 -0700
Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com
 [10.237.217.45])
 by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id
 w3P9ulCu010728; Wed, 25 Apr 2018 10:56:47 +0100
Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1])
 by sivswdev01.ir.intel.com with ESMTP id w3P9ul8e021880;
 Wed, 25 Apr 2018 10:56:47 +0100
Received: (from aburakov@localhost)
 by sivswdev01.ir.intel.com with LOCAL id w3P9ulVJ021876;
 Wed, 25 Apr 2018 10:56:47 +0100
From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net
Date: Wed, 25 Apr 2018 10:56:38 +0100
Message-Id: <cover.1524650130.git.anatoly.burakov@intel.com>
X-Mailer: git-send-email 1.7.0.7
In-Reply-To: <cover.1523977588.git.anatoly.burakov@intel.com>
References: <cover.1523977588.git.anatoly.burakov@intel.com>
Subject: [dpdk-dev] [PATCH v3 0/9] Coverity fixes for EAL memory
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 25 Apr 2018 09:56:50 -0000

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.

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  | 22 ++++++++++++++++------
 lib/librte_eal/linuxapp/eal/eal_memory.c    |  1 +
 4 files changed, 23 insertions(+), 11 deletions(-)

-- 
2.7.4