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 4127A45BB1; Mon, 28 Oct 2024 14:04:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D89F40E44; Mon, 28 Oct 2024 14:04:12 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 67162400D7 for ; Mon, 28 Oct 2024 14:04:11 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4XcYS01B0jzfdT4; Mon, 28 Oct 2024 21:01:36 +0800 (CST) Received: from dggpeml500024.china.huawei.com (unknown [7.185.36.10]) by mail.maildlp.com (Postfix) with ESMTPS id DE7421402CC; Mon, 28 Oct 2024 21:04:08 +0800 (CST) Received: from [10.67.121.161] (10.67.121.161) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Mon, 28 Oct 2024 21:04:08 +0800 Message-ID: Date: Mon, 28 Oct 2024 21:04:08 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 02/13] eal: replace strtok with reentrant version To: Stephen Hemminger , Jie Hai CC: , , , Anatoly Burakov , Tyler Retzlaff , Amit Prakash Shukla , , References: <20231113104550.2138654-1-haijie1@huawei.com> <20241026101451.29135-1-haijie1@huawei.com> <20241026101451.29135-3-haijie1@huawei.com> <20241026200028.44b83e1b@hermes.local> Content-Language: en-US From: fengchengwen In-Reply-To: <20241026200028.44b83e1b@hermes.local> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.121.161] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml500024.china.huawei.com (7.185.36.10) 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 On 2024/10/27 11:00, Stephen Hemminger wrote: > On Sat, 26 Oct 2024 18:14:40 +0800 > Jie Hai wrote: > >> Multiple threads calling the same function may cause condition >> race issues, which often leads to abnormal behavior and can cause >> more serious vulnerabilities such as abnormal termination, denial >> of service, and compromised data integrity. >> >> The strtok() is non-reentrant, it is better to replace it with a >> reentrant version. >> >> Fixes: 2054f31a1fcd ("mem: add memseg info in telemetry") >> Cc: stable@dpdk.org >> >> Signed-off-by: Jie Hai >> Acked-by: Chengwen Feng >> Acked-by: Amit Prakash Shukla >> Acked-by: Morten Brørup > > This doesn't need to go to stable. parse_params is always single threaded. I recommend replacing all, based on: 1\ almost at no cost. 2\ reduce analysis costs, if don't we have to analyze the callers of strtok when you encounter it.