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 F3ED543CB2 for ; Thu, 14 Mar 2024 10:54:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3193842E93; Thu, 14 Mar 2024 10:54:42 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by mails.dpdk.org (Postfix) with ESMTP id 8912A42E65; Thu, 14 Mar 2024 10:54: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=1710410079; x=1741946079; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=saAQ6BjDU9X0Bry3EqndEr033TMw3MpKb2PQcUKZCTI=; b=AiWE0dD/+KstQOLrnaimF14QCVFCWlw211Y8dr6I0Fs50cmUzUYZ2cDa wLyxDYScwRznhfEelb81rw24FGWnFXACLuRI3fmiu0uP3bSHH9rlGG9HZ SULji0loVz+K6eWgZ/i6zfLcWegJZf0CUGB8q6oEzpei+e1kLtyT/Jqei 9Z/4pL7gu3HYlXRZSx0Oy8TTVrQlmvvJJUTVTgznQzIUp6IwR/WNHph41 1P3T+U7wkXKfd6D4SOEhlaDmqcG9N8+Vmo8jcx5EC0EwiczCtIhXTWfZT UulPKjJdnb4qZQvH2jv55Z9LBLNbKgcTQsmTukq7xPYQxLijtwJwsmqoG Q==; X-IronPort-AV: E=McAfee;i="6600,9927,11012"; a="5339887" X-IronPort-AV: E=Sophos;i="6.07,125,1708416000"; d="scan'208";a="5339887" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2024 02:54:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,125,1708416000"; d="scan'208";a="12125219" Received: from unknown (HELO localhost.localdomain) ([10.239.252.253]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2024 02:54:37 -0700 From: Mingjin Ye To: dev@dpdk.org Cc: Mingjin Ye , stable@dpdk.org Subject: [PATCH 3/3] net/vdev: fix insert vdev core dump Date: Thu, 14 Mar 2024 09:36:30 +0000 Message-Id: <20240314093630.1066948-4-mingjinx.ye@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240314093630.1066948-1-mingjinx.ye@intel.com> References: <20240314093630.1066948-1-mingjinx.ye@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 Inserting a vdev device when the device arguments are already stored in devargs_list, the rte_devargs_insert function replaces the supplied new devargs with the found devargs and frees the new devargs. As a result, the use of free devargs results in a core dump. This patch fixes the issue by using valid devargs. Fixes: f3a1188cee4a ("devargs: make device representation generic") Cc: stable@dpdk.org Signed-off-by: Mingjin Ye --- drivers/bus/vdev/vdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index 1a6cc7d12d..53fc4a6e21 100644 --- a/drivers/bus/vdev/vdev.c +++ b/drivers/bus/vdev/vdev.c @@ -286,7 +286,6 @@ insert_vdev(const char *name, const char *args, struct rte_vdev_device **p_dev) dev->device.bus = &rte_vdev_bus; dev->device.numa_node = SOCKET_ID_ANY; - dev->device.name = devargs->name; if (find_vdev(name)) { /* @@ -300,6 +299,7 @@ insert_vdev(const char *name, const char *args, struct rte_vdev_device **p_dev) rte_devargs_insert(&devargs); dev->device.devargs = devargs; + dev->device.name = devargs->name; TAILQ_INSERT_TAIL(&vdev_device_list, dev, next); if (p_dev) -- 2.25.1