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 60DF3436D2; Tue, 12 Dec 2023 15:37:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E53C042DB2; Tue, 12 Dec 2023 15:37:40 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id 12B0D4025C; Tue, 12 Dec 2023 15:37:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702391859; x=1733927859; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Lf1eOcCuD0BsUGtYFwOVV4ONU171TElMfX9fbVoxJjQ=; b=VqiSfVwYSOse1blBi9mTLDXpHw6TJjqiacHlJRmD9vKTBBbyuGkXRasa 7XqS229KZgpy0awD7uuJsprf5KzPUJkungA296gSB9ViSD1TH+iNTjO0T 0S+52ydnujSEc9Q/WBC6oiZS9RkMhSMrbwK8E1dTSpM2sFbbH9w3Af6hG BH+Al6MoNIGCK7ugye83xUL6PY3sZhtmdIA9C5r3vN6BYMyB5mg+fnYUQ M7I+MzSMsZnWzOBKjsoOipZ4fFFMMP7tDYBDNIXtEwbJqJAbvI3MKWfQB mBNou73AZZIyLJnu3X44YsISV8Lb4Q8VcvZdNwfXdj8Zg/+VHKqV+IVTb Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10922"; a="8176441" X-IronPort-AV: E=Sophos;i="6.04,270,1695711600"; d="scan'208";a="8176441" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2023 06:37:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10922"; a="807790121" X-IronPort-AV: E=Sophos;i="6.04,270,1695711600"; d="scan'208";a="807790121" Received: from silpixa00401012.ir.intel.com ([10.243.22.112]) by orsmga001.jf.intel.com with ESMTP; 12 Dec 2023 06:37:36 -0800 From: Sivaramakrishnan Venkat To: Cc: dev@dpdk.org, stable@dpdk.org, gakhil@marvell.com, Sivaramakrishnan Venkat Subject: [PATCH v1] net/tap: fix buffer overflow for ptypes list Date: Tue, 12 Dec 2023 14:37:22 +0000 Message-Id: <20231212143722.1803259-1-venkatx.sivaramakrishnan@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 Incorrect ptypes list causes buffer overflow for Address Sanitizer run and a tap device. The last element in the ptypes lists to be to "RTE_PTYPE_UNKNOWN" for rte_eth_dev_get_supported_ptypes(). In rte_eth_dev_get_supported_ptypes(), the loop iterates until it finds "RTE_PTYPE_UNKNOWN" to detect last element of the ptypes array. Fix tap_dev_supported_ptypes_get() method to return correct lists. Fixes: 0849ac3b6122 ("net/tap: add packet type management") Cc: stable@dpdk.org Signed-off-by: Sivaramakrishnan Venkat --- drivers/net/tap/rte_eth_tap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index b41fa971cb..3fa03cdbee 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -1803,6 +1803,7 @@ tap_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) RTE_PTYPE_L4_UDP, RTE_PTYPE_L4_TCP, RTE_PTYPE_L4_SCTP, + RTE_PTYPE_UNKNOWN }; return ptypes; -- 2.25.1