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 CE19545C9E; Wed, 6 Nov 2024 21:11:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 971FC42E54; Wed, 6 Nov 2024 21:11:37 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id AE1C4402BC for ; Wed, 6 Nov 2024 21:11:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730923895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HLmv6KYF6TXGKZH7ccgk4x+PD62yCrfLjlUjs358SMc=; b=c31c1c3t15WhBfvNvBaSN4wW4sEiQ3wjBjmD4PpewbNTMj1f6rGUdkdFSRYwKz/OWpV3wb 0k68hZbD/IoXpir5v9YHdvW5mDSbM3Ky3GDG8wfEnlHgprrK75EAYuUzNr20SOuNKVPm0d PpdAb1cSoM7QdQ9Q52SSmuB+vM/JEes= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-442-Y4oA4AGONpWt8HdLHhYUyw-1; Wed, 06 Nov 2024 15:11:34 -0500 X-MC-Unique: Y4oA4AGONpWt8HdLHhYUyw-1 X-Mimecast-MFC-AGG-ID: Y4oA4AGONpWt8HdLHhYUyw Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-2fb50150039so902991fa.2 for ; Wed, 06 Nov 2024 12:11:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730923892; x=1731528692; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HLmv6KYF6TXGKZH7ccgk4x+PD62yCrfLjlUjs358SMc=; b=ShnUNSUNU+ZFvdwOytQ3KhSRu3r5+s7kxwNmRp4wvK2SwBVApHIiRjn4Z+L3G9R00O KfKMLbjsA/o617Y27zHnSwyk6JACMNMg0ccGMFvGX2OKDeNI9wdjSpZKa66h4aOXVGie 0SukZOhmTdNf+kmx6LgVsgVs5VPuj2vbX61DlurPAfaFIeQZcBygvkIzmJhEQEkKrfpa u1HHimIVDrdTvvYP3gSCLhjz49liVrabIKMzXffdvwNMyYkCkYrUCmWdmcrBjkJPhOeL hxn1bdyN8r1Ew9grP4TwrdiJ0Az1Yo5FJytLTCAJ4rRrAJJZYof9S3OtZGNugUIDTsRU PiYQ== X-Gm-Message-State: AOJu0Yx9rgAwUVYSIuO3pLcVR1YfDZItjZIOa19fbNeT4TS5HSsmYjt8 3iUbF8h2msI6j75gWo36sFXzb9cF86/q1AXDzZaRsZ8/0if/SLuOTiAlECbACW0vzMErK1k3IyU Ny2EYQw68/1W9eSdS4aOfC01BgoGnMRquu3ALEc1F7R7hF34l59t2kWqJJsqi/2ldZRTDE77ZeC LcdRdkVsCOpkJOUbg= X-Received: by 2002:a2e:be0d:0:b0:2fb:8774:440c with SMTP id 38308e7fff4ca-2fedb7a2a10mr103266211fa.10.1730923892394; Wed, 06 Nov 2024 12:11:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IH4HbHiwEUfKKypeSwWpHmbluC4x/OlTFKRv8+fBIyR3AiPu6GWlxJEtzOiBZjHh3gkY8ID/Sz/HkB489GKKrI= X-Received: by 2002:a2e:be0d:0:b0:2fb:8774:440c with SMTP id 38308e7fff4ca-2fedb7a2a10mr103266001fa.10.1730923891931; Wed, 06 Nov 2024 12:11:31 -0800 (PST) MIME-Version: 1.0 References: <20231113104550.2138654-1-haijie1@huawei.com> <20241026101451.29135-1-haijie1@huawei.com> In-Reply-To: <20241026101451.29135-1-haijie1@huawei.com> From: David Marchand Date: Wed, 6 Nov 2024 21:11:21 +0100 Message-ID: Subject: Re: [PATCH v4 00/13] replace strtok with reentrant version To: Jie Hai Cc: dev@dpdk.org, thomas@monjalon.net, ferruh.yigit@amd.com, lihuisong@huawei.com, fengchengwen@huawei.com, huangdengdui@huawei.com, Stephen Hemminger , Tyler Retzlaff X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: LjEIjR6vnJYGMOPiIlKqFcNsZ_M_BZ5dAsjeChYDOG8_1730923892 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Hello, On Sat, Oct 26, 2024 at 12:26=E2=80=AFPM 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. > > This patchset replaces strtok with strtok_r in app, example, lib > and drivers. And adds check for use of strtok in checkpatches.sh. - The current v4 series breaks compilation on Windows with clang. http://mails.dpdk.org/archives/test-report/2024-November/819978.html The reason is that some include of rte_os_shim.h are missing. =3D=3D=3D=3D 20 line log output for Windows Server 2022 (dpdk_win_llvm_comp= ile): =3D=3D=3D=3D vchan_param =3D strtok_r(end_param, ",", &sp); ^ ../lib/dmadev/rte_dmadev.c:1038:17: note: did you mean 'strtok_s'? C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt\string.h:68:29: note: 'strtok_s' declared here _ACRTIMP char* __cdecl strtok_s( ^ ../lib/dmadev/rte_dmadev.c:1038:15: error: incompatible integer to pointer conversion assigning to 'const char *' from 'int' [-Wint-conversion] vchan_param =3D strtok_r(end_param, ",", &sp); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. [10/836] Linking static target lib/librte_gpudev.a [11/836] Compiling C object lib/librte_mldev.a.p/mldev_mldev_utils_scalar_bfloat16.c.obj [12/836] Compiling C object lib/librte_gro.a.p/gro_gro_udp4.c.obj [13/836] Compiling C object lib/librte_mldev.a.p/mldev_mldev_utils_scalar.c= .obj [14/836] Compiling C object lib/librte_gro.a.p/gro_rte_gro.c.obj [15/836] Compiling C object lib/librte_gro.a.p/gro_gro_tcp6.c.obj [16/836] Compiling C object lib/librte_gro.a.p/gro_gro_tcp4.c.obj [17/836] Compiling C object lib/librte_gro.a.p/gro_gro_vxlan_tcp4.c.obj [18/836] Compiling C object lib/librte_cryptodev.a.p/cryptodev_rte_cryptodev.c.obj ninja: build stopped: subcommand failed. - grep shows that there are a number of missed places in drivers and app, which contradicts the commitlog. I don't like leaving some places with strtok while checkpatches.sh warn on the rest. And I think others were expecting too that the whole tree is fixed after this series. Re-reading the thread, were the changes on app/ dropped, following comments from Stephen? I understand his request was to remove the backport request (iow no Cc: stable@dpdk.org in the commitlogs), not to drop the changes. --=20 David Marchand