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 E0BADA00C3; Thu, 16 Jun 2022 07:36:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B842241133; Thu, 16 Jun 2022 07:36:30 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 29DFC410D0 for ; Thu, 16 Jun 2022 07:36:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655357789; x=1686893789; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=WVmjPcFJJTc6hmlSH/GxHMq+VIdOkyfRifWAovdqqeY=; b=mnmy36kACO4xOiFzQisbzvTqSqBVmklq94zoDWCrp2t69Ay8b/Q8+be0 y1WTvqXjNNApFDyQr7yh3yKpF2ya9KtFlvIutBPaQnIQAqI7RgYCICMyG hWzoJfxUN5rtAcK4R7kFj+53wu1j8x+ZdknVbRwZdT30sG9dsHrByXIlt uG3L+2ECQXl9n6A44eeO5YhNbFWJYZEZL1IVHak/0UmgoihrESSOrq2GB s+NZyshsKcgBu9uI80xOP4KhLRSNDlFIS6Ts2Bl8pFV9v6G3e8UUaNbtC SQeoAcKreRqibmX87jZLKe9CadH1+rCzzBgW6d0t4np2q17ir8ZIFCqjv g==; X-IronPort-AV: E=McAfee;i="6400,9594,10379"; a="277967150" X-IronPort-AV: E=Sophos;i="5.91,304,1647327600"; d="scan'208";a="277967150" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2022 22:36:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,304,1647327600"; d="scan'208";a="574024067" Received: from unknown (HELO localhost.localdomain) ([10.190.210.133]) by orsmga002.jf.intel.com with ESMTP; 15 Jun 2022 22:36:26 -0700 From: Naga Harish K S V To: jay.jayatheerthan@intel.com, jerinj@marvell.com Cc: dev@dpdk.org Subject: [PATCH] eventdev/eth_tx: fix adapter create Date: Thu, 16 Jun 2022 10:34:41 +0530 Message-Id: <20220616050441.2197264-1-s.v.naga.harish.k@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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. Signed-off-by: Naga Harish K S V --- 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