[PATCH v4 02/13] eal: replace strtok with reentrant version

Stephen Hemminger stephen at networkplumber.org
Mon Oct 28 16:31:12 CET 2024


On Mon, 28 Oct 2024 21:04:08 +0800
fengchengwen <fengchengwen at huawei.com> wrote:

> On 2024/10/27 11:00, Stephen Hemminger wrote:
> > On Sat, 26 Oct 2024 18:14:40 +0800
> > Jie Hai <haijie1 at 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 at dpdk.org
> >>
> >> Signed-off-by: Jie Hai <haijie1 at huawei.com>
> >> Acked-by: Chengwen Feng <fengchengwen at huawei.com>
> >> Acked-by: Amit Prakash Shukla <amitprakashs at marvell.com>
> >> Acked-by: Morten Brørup <mb at 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.


More information about the dev mailing list