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 B80DB45BFE; Mon, 28 Oct 2024 16:31:16 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6E6AE40E0B; Mon, 28 Oct 2024 16:31:16 +0100 (CET) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by mails.dpdk.org (Postfix) with ESMTP id B9E02400D7 for ; Mon, 28 Oct 2024 16:31:15 +0100 (CET) Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-71e8235f0b6so3286911b3a.3 for ; Mon, 28 Oct 2024 08:31:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1730129475; x=1730734275; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=zgjOI8NDqJ3PoZb1Wfpl4OhXYWSUgKsTuRSONyrLifs=; b=EoKlnFWyZKBym5zt1I5jeEgYi917id0hW6GMBGYGFw4TwVlAOdFrOoy/x57XZGrEJE l8R6l6NY2potJewWvU61Np0lpKEUHCgi/GsAL6lPKWJqy0K06kK6N/jUgPT0dESkGfVu tUcLzCCx9qOSxfuYYPsvhu1Tew3u4nT076laNg6a0fR+sHuTqwAVzoFB+tR7ucHsLtCY IeWi7nYjFWUcQ76oYNTRIXOx4+ocLdnehoPFoMkZ8vJU6ga9cxe64uymPMfOAsU9EpqT Z0WQpeqCtcWX9i2JJLptL2ULwRu+yKqXyuCTGtxWe7OCxt7qDcCU0mn3He/lY0/pTeML 6k9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730129475; x=1730734275; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zgjOI8NDqJ3PoZb1Wfpl4OhXYWSUgKsTuRSONyrLifs=; b=n+7cKIlaJfSJdbLmbF/yFvbn7EBnzH6z6pH48h2t/EMGz3OlVlZ6sY193AYJZ2moUp 93KWyqf1U4VrJS03ck5FpRj0+sZF1ThnHQCKlc1PnzRTYzPpP7/9aQdfecTVFj1ppjc6 z9s++sG8bYzSAbgm2QOpP6ppXqPvGsxrludOHsuEMF6ftPNmrskvrrchpBsbTgwXKWzx ImQID98HoFpCurO2RJGSM3FiBiL6vKdW9MSaSgF+e2tsgmATI6wkoElop/9JgqSjgBDF doO2eLIDMyjyd24jErbdhwe8VOhxhUzg82THh+EJehW/C2DyxxvuK8gBEIPFx607WAmm E6TA== X-Forwarded-Encrypted: i=1; AJvYcCViuT4sqHXZSEUmW9WTGt1TxsH8/oMrGL9wHUwfzw90tc2NbVt4lVY2ASPjwJrsS1F4f74=@dpdk.org X-Gm-Message-State: AOJu0Yy7FNe5sY23hm8X5haPcyB1i6TBL7BSqg3SBqeCppo4lmDWgIb/ fBTGyweeKM5v3aDV+cyNkQ1xicmgPbpWZQ9Wz5ttOiXd6f2jMqwTXHYPRaMK07A= X-Google-Smtp-Source: AGHT+IEaZfOitG8tSj0DIaUiqYrChnlaBpCNz2O5XPGmrj/MADMDoszQ38N1b78EQPvM+5ziYro2dQ== X-Received: by 2002:a05:6a20:4389:b0:1d9:2018:9e24 with SMTP id adf61e73a8af0-1d9a83b042fmr13484444637.10.1730129474718; Mon, 28 Oct 2024 08:31:14 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72057a3bd53sm5850469b3a.185.2024.10.28.08.31.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2024 08:31:14 -0700 (PDT) Date: Mon, 28 Oct 2024 08:31:12 -0700 From: Stephen Hemminger To: fengchengwen Cc: Jie Hai , , , , Anatoly Burakov , Tyler Retzlaff , Amit Prakash Shukla , , Subject: Re: [PATCH v4 02/13] eal: replace strtok with reentrant version Message-ID: <20241028083112.25b96ae1@hermes.local> In-Reply-To: References: <20231113104550.2138654-1-haijie1@huawei.com> <20241026101451.29135-1-haijie1@huawei.com> <20241026101451.29135-3-haijie1@huawei.com> <20241026200028.44b83e1b@hermes.local> MIME-Version: 1.0 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 On Mon, 28 Oct 2024 21:04:08 +0800 fengchengwen wrote: > On 2024/10/27 11:00, Stephen Hemminger wrote: > > On Sat, 26 Oct 2024 18:14:40 +0800 > > Jie Hai wrote: > > =20 > >> 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=C3=B8rup =20 > >=20 > > This doesn't need to go to stable. parse_params is always single thread= ed. =20 >=20 > 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 strt= ok when you encounter it. >=20 Yes but. The replacement should not go to stable. One of the rules of stable is that changes should be minimized, and fixes s= hould not be accepted for things that can not ever happen with current code.