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 0605FA0547 for ; Thu, 16 Jun 2022 07:46:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F142F42BBE; Thu, 16 Jun 2022 07:46:46 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 28808410D0; Thu, 16 Jun 2022 07:46:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655358404; x=1686894404; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LgU4qSFbexViodUe3SKINVUNwPEbo+QLsVFVAXosvyA=; b=ni/1WOfuL5oYzwC/KdvQzAsLgSzUhKN9WpcSXJ5Hw57WhMOMAcKw6KcC KcWxtf+p4V8D8yf8EeJSoPx0aVXDJCc8zjfnGNCNKFTtkBrzKkWcHcaCN y9VRBXo+Fm8bHPNFgGy4lOOSs//UOimEodFRYLGOx52WCNDz7ekn5/Loa YGutNKO8p0EzYCLzXJQj8Zk2K1lem+G5x44hbXrmR17eMdTJ4Sx56lx8B MeCZXKy0sa0fUFqanFOniirrCNOWClbQVuZZA9XffthaKRium+NOzYcxW weVG96w+ABf/sGLu7l8QKyBFM0qopEdjGy0d44tM8LyLwEqWOMrQq+SJ2 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10379"; a="267860706" X-IronPort-AV: E=Sophos;i="5.91,304,1647327600"; d="scan'208";a="267860706" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2022 22:46:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,304,1647327600"; d="scan'208";a="618759453" Received: from unknown (HELO localhost.localdomain) ([10.190.210.133]) by orsmga001.jf.intel.com with ESMTP; 15 Jun 2022 22:46:41 -0700 From: Naga Harish K S V To: s.v.naga.harish.k@intel.com, jay.jayatheerthan@intel.com, jerinj@marvell.com Cc: dev@dpdk.org, stable@dpdk.org Subject: [PATCH v2] eventdev/eth_tx: fix adapter create Date: Thu, 16 Jun 2022 10:44:58 +0530 Message-Id: <20220616051458.2197410-1-s.v.naga.harish.k@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220616050441.2197264-1-s.v.naga.harish.k@intel.com> References: <20220616050441.2197264-1-s.v.naga.harish.k@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org During adapter create, memory is allocated for storing event port configuration which is freed during adapter free. The following error is seen during free "EAL: Error: Invalid memory" The service data pointer storage for txa_service_data_array is allocated during adapter create with incorrect size which is less than the required size. Initialization of this memory causes buffer overflow and result in metadata overwrite of event port config memory allocated above and results in the above error message during free. Allocating the correct size of memory for txa_service_data_array prevents overwriting other memory areas like event port config memory. Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation") Cc: stable@dpdk.org Signed-off-by: Naga Harish K S V --- v2: * fix commit message --- lib/eventdev/rte_event_eth_tx_adapter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_event_eth_tx_adapter.c index 1b304f0a73..c700fb7b1f 100644 --- a/lib/eventdev/rte_event_eth_tx_adapter.c +++ b/lib/eventdev/rte_event_eth_tx_adapter.c @@ -224,7 +224,7 @@ txa_service_data_init(void) if (txa_service_data_array == NULL) { txa_service_data_array = txa_memzone_array_get("txa_service_data_array", - sizeof(int), + sizeof(*txa_service_data_array), RTE_EVENT_ETH_TX_ADAPTER_MAX_INSTANCE); if (txa_service_data_array == NULL) return -ENOMEM; -- 2.25.1