From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8875FA034F; Wed, 31 Mar 2021 11:12:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C5184069E; Wed, 31 Mar 2021 11:12:20 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 4BA4A40141 for ; Wed, 31 Mar 2021 11:12:18 +0200 (CEST) IronPort-SDR: BQoBASbwB/yklGU7GOrSAPQI4hgV6Ef04QnJkXRE85gIeiiAyPT6NY+RtCV+y1tCHo015FMeP/ 7ufvNJYOiHrg== X-IronPort-AV: E=McAfee;i="6000,8403,9939"; a="192063920" X-IronPort-AV: E=Sophos;i="5.81,293,1610438400"; d="scan'208";a="192063920" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2021 02:12:13 -0700 IronPort-SDR: v4BxwBB3XG8XMA40bit+oj0vETT0x4FywB8LvpfcAr4mKIReq42521vRyUiGcJkOHM6tlQDloN NjtSVyBrAzOQ== X-IronPort-AV: E=Sophos;i="5.81,293,1610438400"; d="scan'208";a="412057742" Received: from unknown (HELO localhost.localdomain) ([10.240.183.109]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2021 02:12:12 -0700 From: Wenwu Ma To: olivier.matz@6wind.com, andrew.rybchenko@oktetlabs.ru, dev@dpdk.org Date: Wed, 31 Mar 2021 21:05:57 +0000 Message-Id: <20210331210557.4919-1-wenwux.ma@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] test/mempool: Fix illegal pointer access in mempool test X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The value of parameter private_data_size of function rte_mempool_create() called in test_mempool() should not be 0, Otherwise, the function rte_pktmbuf_priv_size() called in rte_pktmbuf_init() will cause heap-buffer-overflow. Signed-off-by: Wenwu Ma --- app/test/test_mempool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/test/test_mempool.c b/app/test/test_mempool.c index 084842fda..fc06a9c6f 100644 --- a/app/test/test_mempool.c +++ b/app/test/test_mempool.c @@ -543,7 +543,8 @@ test_mempool(void) mp_stack_mempool_iter = rte_mempool_create("test_iter_obj", MEMPOOL_SIZE, MEMPOOL_ELT_SIZE, - RTE_MEMPOOL_CACHE_MAX_SIZE, 0, + RTE_MEMPOOL_CACHE_MAX_SIZE, + sizeof(struct rte_pktmbuf_pool_private), NULL, NULL, my_obj_init, NULL, SOCKET_ID_ANY, 0); -- 2.25.1