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 3F039A0C43 for ; Thu, 30 Sep 2021 09:44:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 35A6441100; Thu, 30 Sep 2021 09:44:25 +0200 (CEST) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by mails.dpdk.org (Postfix) with ESMTP id DE9AE4067E; Thu, 30 Sep 2021 09:44:22 +0200 (CEST) Received: by mail-lf1-f44.google.com with SMTP id z24so21460593lfu.13; Thu, 30 Sep 2021 00:44:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=q6LCrP4anrUbBRMzMAWWmAGsWRtvOiGfWSHCm755eWU=; b=OOnj7bSNa78s4J8f2iaouG8soqzX6IMeDRm+/mtSnUHnvRdkw/74N8J5BNpiHwqL/Z x4AjuIU2hKwHoujfnL4qFKSNbYT4FN4nG+DG8YfvIftnf71GvC/1HpLD1qsXKtJXpf+q KZAvJWjL4D9luoyZ9VGIgC57TM4rSVfT/1QYuP4qRmrlk39KfoM2/Pw1yNNgflT4auCB 0+cpAZSFYQqEd1u3sASixWR3vVMZlNB7FvGK00eIifwdk9/+gqEGuIxHXsMhvszlnXtO D35KA2cuv+rXa64NBLnnxfLymrD/KeilWa/ZpOiZKmhvK+RDhXDWk1L37eJ+/1uPNXXy EulA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=q6LCrP4anrUbBRMzMAWWmAGsWRtvOiGfWSHCm755eWU=; b=skur5I/AcT09GsXvyLXd+DL2tDMtQdrkL4Bl5G7W5pg+gWxKNu+bBfcQ4jEMW1oV0X w+RpLNvHS+l9wANYtTjIQ8wq/HncSVHfI+G/3cF9djWjuE+W82Ufo6oQOLsjewx4eEdF S6logNaBzbsXGSIleHo84QfH/jFd8B/P7sjZSbivTwjRIKHTg5a7NftEPnzO+ppHWAYX WQ7ziGF7l5uHsXqliiiy6XoV4JRsOr5xAbjjgmgTWZ9dG+QfsZCzRyGqEQ45Z0BNnwod aGI5KzRi9U3zgizzRxAHLpao1Pn5X4TzPRJNJKIx16I5ppGHoF6AsEffve89L1eiJ+QI f3Lw== X-Gm-Message-State: AOAM5305jtvwJ5ap8u1Q6E2jOlVIWDXs0oCHDgFSQOYx+FeWBWtzV30S GTUPHvSqNVZlNvGxkxCvKVSG1G04K3k= X-Google-Smtp-Source: ABdhPJxy2XlDiLGwZG7oIgsaXOM2EaJf1e8+JtSE/pDLsX+tKz8/bTXxGxPp2lrolDCv8Ot01E/gsQ== X-Received: by 2002:ac2:544f:: with SMTP id d15mr4379501lfn.221.1632987862406; Thu, 30 Sep 2021 00:44:22 -0700 (PDT) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id a6sm277842lfr.142.2021.09.30.00.44.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 00:44:21 -0700 (PDT) Date: Thu, 30 Sep 2021 10:44:20 +0300 From: Dmitry Kozlyuk To: "Peng, ZhihongX" , "olivier.matz@6wind.com" Cc: "dev@dpdk.org" , "stable@dpdk.org" Message-ID: <20210930104420.13fe1e82@sovereign> In-Reply-To: References: <20210831022844.18057-1-zhihongx.peng@intel.com> <20210831205224.14ddb447@sovereign> <20210906103333.13ce4760@sovereign> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] lib/cmdline: release cl when cmdline exit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 2021-09-30 06:53 (UTC+0000), Peng, ZhihongX: > > -----Original Message----- > > From: Dmitry Kozlyuk > > Sent: Monday, September 6, 2021 3:34 PM > > To: Peng, ZhihongX > > Cc: olivier.matz@6wind.com; dev@dpdk.org; stable@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH] lib/cmdline: release cl when cmdline exit > > > > 2021-09-06 05:51 (UTC+0000), Peng, ZhihongX: > > > > -----Original Message----- > > > > From: Dmitry Kozlyuk > > > > Sent: Wednesday, September 1, 2021 1:52 AM > > > > To: Peng, ZhihongX > > > > Cc: olivier.matz@6wind.com; dev@dpdk.org; stable@dpdk.org > > > > Subject: Re: [dpdk-dev] [PATCH] lib/cmdline: release cl when cmdline > > > > exit > > > > > > > > 2021-08-31 10:28 (UTC+0800), zhihongx.peng@intel.com: > > > > > From: Zhihong Peng > > > > > > > > > > Malloc cl in the cmdline_stdin_new function, so release in the > > > > > cmdline_stdin_exit function is logical, so that cl will not be > > > > > released alone. > > > > > > > > > > Fixes: af75078fece3 (first public release) > > > > > Cc: stable@dpdk.org > > > > > > > > > > Signed-off-by: Zhihong Peng > > > > > --- > > > > > lib/cmdline/cmdline_socket.c | 1 + > > > > > 1 file changed, 1 insertion(+) > > > > > > > > > > diff --git a/lib/cmdline/cmdline_socket.c > > > > > b/lib/cmdline/cmdline_socket.c index 998e8ade25..ebd5343754 100644 > > > > > --- a/lib/cmdline/cmdline_socket.c > > > > > +++ b/lib/cmdline/cmdline_socket.c > > > > > @@ -53,4 +53,5 @@ cmdline_stdin_exit(struct cmdline *cl) > > > > > return; > > > > > > > > > > terminal_restore(cl); > > > > > + cmdline_free(cl); > > > > > } > > > > > > > > Now cmdline_free() may not be called after cmdline_stdin_exit(). > > > > User code that does so needs to be changed to avoid double-free. > > > > This behavior change must be documented in the release notes. > > > > I'm not sure it should be backported because of the above. > > > Using the asan tool, I found that many dpdk apps did not call cmdline_free, > > only one app called. > > > > I mean external programs that use DPDK, not DPDK bundled apps only. > > If some of them use a stable DPDK branch and the change is backported, a > > double-free will be introduced by upgrading DPDK to a minor version. > > Users of current DPDK version that call cmdline_free() after > > cmdline_stdin_exit() will have to upgrade their code, release notes are the > > place to inform them about this need. > > The patch itself is good and now it is the right time for it. > > Can you give me an ack, I have submitted v2: > http://patches.dpdk.org/project/dpdk/patch/20210917021502.502560-1-zhihongx.peng@intel.com/ Hi Zhihong, v2 doesn't address my concerns above. Do you have any objections?