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 46C5A46CFC; Mon, 11 Aug 2025 12:54:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D95E640B91; Mon, 11 Aug 2025 12:54:35 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 50C8E406B7 for ; Mon, 11 Aug 2025 12:54:33 +0200 (CEST) Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4c0rzt5R1rz23jlV; Mon, 11 Aug 2025 18:51:54 +0800 (CST) Received: from kwepemk500009.china.huawei.com (unknown [7.202.194.94]) by mail.maildlp.com (Postfix) with ESMTPS id EF2B41A016C; Mon, 11 Aug 2025 18:54:31 +0800 (CST) Received: from localhost.localdomain (10.50.165.33) by kwepemk500009.china.huawei.com (7.202.194.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 11 Aug 2025 18:54:31 +0800 From: Chengwen Feng To: CC: , Subject: [PATCH 1/9] app/dma-perf: fix use-after-free Date: Mon, 11 Aug 2025 18:54:22 +0800 Message-ID: <20250811105430.55791-2-fengchengwen@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20250811105430.55791-1-fengchengwen@huawei.com> References: <20250811105430.55791-1-fengchengwen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.50.165.33] X-ClientProxiedBy: kwepems100002.china.huawei.com (7.221.188.206) To kwepemk500009.china.huawei.com (7.202.194.94) 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 The test_case->eal_args was pointer the entry of cfgfile, it will be used later, but the cfgfile was closed in load_configs(). This commit fix it by using strdup. Fixes: 623dc9364dc6 ("app/dma-perf: introduce DMA performance test") Cc: stable@dpdk.org Signed-off-by: Chengwen Feng --- app/test-dma-perf/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/test-dma-perf/main.c b/app/test-dma-perf/main.c index 0586b3e1d0..25a79d1d6c 100644 --- a/app/test-dma-perf/main.c +++ b/app/test-dma-perf/main.c @@ -480,6 +480,8 @@ load_configs(const char *path) section_name, "test_seconds")); test_case->eal_args = rte_cfgfile_get_entry(cfgfile, section_name, "eal_args"); + if (test_case->eal_args != NULL) + test_case->eal_args = strdup(test_case->eal_args); test_case->is_valid = true; } -- 2.17.1