From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 938B345C04;
	Tue, 29 Oct 2024 01:56:25 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 60C9D4014F;
	Tue, 29 Oct 2024 01:56:25 +0100 (CET)
Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255])
 by mails.dpdk.org (Postfix) with ESMTP id 6EF4740144
 for <dev@dpdk.org>; Tue, 29 Oct 2024 01:56:23 +0100 (CET)
Received: from mail.maildlp.com (unknown [172.19.88.105])
 by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4XcsGC6kPJz1T90v;
 Tue, 29 Oct 2024 08:54:11 +0800 (CST)
Received: from dggpeml500024.china.huawei.com (unknown [7.185.36.10])
 by mail.maildlp.com (Postfix) with ESMTPS id E68C4140157;
 Tue, 29 Oct 2024 08:56:20 +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; Tue, 29 Oct 2024 08:56:20 +0800
Message-ID: <74ae461a-de52-4ba4-916d-508d2d0a0746@huawei.com>
Date: Tue, 29 Oct 2024 08:56:20 +0800
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 02/13] eal: replace strtok with reentrant version
To: Stephen Hemminger <stephen@networkplumber.org>, Ferruh Yigit
 <ferruh.yigit@amd.com>, Thomas Monjalon <thomas@monjalon.net>
CC: Jie Hai <haijie1@huawei.com>, <dev@dpdk.org>, Anatoly Burakov
 <anatoly.burakov@intel.com>, Tyler Retzlaff <roretzla@linux.microsoft.com>,
 Amit Prakash Shukla <amitprakashs@marvell.com>, <lihuisong@huawei.com>,
 <huangdengdui@huawei.com>
References: <20231113104550.2138654-1-haijie1@huawei.com>
 <20241026101451.29135-1-haijie1@huawei.com>
 <20241026101451.29135-3-haijie1@huawei.com>
 <20241026200028.44b83e1b@hermes.local>
 <f59b013c-7e33-4b6f-82ce-29f049fc7521@huawei.com>
 <20241028083112.25b96ae1@hermes.local>
Content-Language: en-US
From: fengchengwen <fengchengwen@huawei.com>
In-Reply-To: <20241028083112.25b96ae1@hermes.local>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-Originating-IP: [10.67.121.161]
X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) 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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

On 2024/10/28 23:31, Stephen Hemminger wrote:
> On Mon, 28 Oct 2024 21:04:08 +0800
> fengchengwen <fengchengwen@huawei.com> wrote:
> 
>> On 2024/10/27 11:00, Stephen Hemminger wrote:
>>> On Sat, 26 Oct 2024 18:14:40 +0800
>>> Jie Hai <haijie1@huawei.com> 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 <haijie1@huawei.com>
>>>> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
>>>> Acked-by: Amit Prakash Shukla <amitprakashs@marvell.com>
>>>> Acked-by: Morten Brørup <mb@smartsharesystems.com>  
>>>
>>> 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.
>>
> 
> Yes but. The replacement should not go to stable.
> One of the rules of stable is that changes should be minimized, and fixes should
> not be accepted for things that can not ever happen with current code.

Hope more opinion from TB members.