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 D1777A0C43 for ; Fri, 8 Oct 2021 08:55:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B3CAB40F35; Fri, 8 Oct 2021 08:55:13 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 8AC1C40696; Fri, 8 Oct 2021 08:55:11 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="226400526" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="226400526" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:55:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="713637146" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga006.fm.intel.com with ESMTP; 07 Oct 2021 23:55:09 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 7 Oct 2021 23:55:08 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 7 Oct 2021 23:55:08 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 7 Oct 2021 23:55:08 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.105) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 7 Oct 2021 23:55:08 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z0HG72Pl53fc3xTBCuTkoPhu/7wlXO4nYkTtT0NB4AY9A2p02nlwEx7s0SWPEPl7w38jhUMKWh9Q/p6gtT/KUxFTFoDaJGg/IOyQYkZFNnlooQXt1C+BRX25QFM2HrB7k1+9XHjDqy6tRI0BZLaDZ1TpNmtG5RtS+JN1TLD3kZVQ6WxVTNJX6dWFTVP5MTuPuqHGQkgaq9FBUHHu1AtPDSbcxCGbCl2eaJwy6Md/GKF1PO2BWiB29hirDvUkVburd1bTlaZ/LrGef5er8ldVMa1u5obU+495DhKjqX8Gj2IwzR1iDg+2EEZoWw5vsk8PhNlKDak8GttQ5enpeatpwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PA0b5ZMOKHfU/Nnu42HFdktG95yGAumlNGrOf1t5nb0=; b=FaU3P6JCIB6T8F7UAEc8y5bj6wKo8hCFkZbk9jWbb3dujlf2vmactR8rpH3ANxRfakpTaqqjhRBnYgve+HwFxqq14sgXppYtwlbbRykI3Wk6PXYoQP/Mcefls6UW6Odmx2Q7qJgJo7Uqs9Oggx9XyzDlyBoQXfuvEv57TNznKildf42k5AaMCvuSZz8wkY49cCX8DiCAoWIcGjNHB3nsMLUinlFDcXGrI5VMHMGua9u9LKaCtKm164zMnKULfJF1y8jb7r6/O+1A76E6lu04XahHJOSz2UVGIwC/VbruzqDiZ1KxZDSTMFDEEjKOqZYWxzcdUBucCiyWsW5Ipnz7WA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PA0b5ZMOKHfU/Nnu42HFdktG95yGAumlNGrOf1t5nb0=; b=hdoPtrMCqvQedeMvVxt2Q0vmgCiT/R9vAIoOKE6MuqfGIDwvBtICbvlzO9mbPaxX9Wlyo8jeKkOFUERN68uYK6b++lJsVf9qJcsowiB1T18G7BignSygeqCR/sFi0s5qSezs2cR1oXRR66whV4VMtH0/Hxj95bO9+v9igEDBsEg= Received: from DM8PR11MB5591.namprd11.prod.outlook.com (2603:10b6:8:38::23) by DM8PR11MB5622.namprd11.prod.outlook.com (2603:10b6:8:36::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Fri, 8 Oct 2021 06:55:06 +0000 Received: from DM8PR11MB5591.namprd11.prod.outlook.com ([fe80::3d47:b590:aa2a:d5cc]) by DM8PR11MB5591.namprd11.prod.outlook.com ([fe80::3d47:b590:aa2a:d5cc%9]) with mapi id 15.20.4587.022; Fri, 8 Oct 2021 06:55:06 +0000 From: "Peng, ZhihongX" To: Dmitry Kozlyuk , "olivier.matz@6wind.com" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] lib/cmdline: release cl when cmdline exit Thread-Index: AQHXnhC381HXo9uzAU2Gt5tm0Dvog6uN5cYAgAikmsCAABx8gIAlrHIAgAAOhQCADIRyYA== Date: Fri, 8 Oct 2021 06:55:06 +0000 Message-ID: References: <20210831022844.18057-1-zhihongx.peng@intel.com> <20210831205224.14ddb447@sovereign> <20210906103333.13ce4760@sovereign> <20210930104420.13fe1e82@sovereign> In-Reply-To: <20210930104420.13fe1e82@sovereign> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a6932967-66a6-4294-8b49-08d98a289007 x-ms-traffictypediagnostic: DM8PR11MB5622: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: hgkGlUWcXrhqjhKHEQm+2hIkjJWbumwblC2slbaNa7nccC0UFEO1rG5jKwKSidxKfztYpaVt4KOYKj30W10Cy8DhSBTfi4wLM0cUoD/5pVEjHPAnuXOYBytcPKwwYzOIDrrpRgOujQlMVSRYd5MgQtkHcSG+ApOcqWP+gYW6cvd9XjZYrTbkGK2kWN6l1iCL8D9rhuy3j0/PGAelSk9o1g0RXKIUeZ70BwP7wIndxGjJch6s2dpR1+BzwcLdrZuk+LKGiaeFzdKDFnGV+FF//U49GFK4LluT07GvsGkdq6daQUEOC65l8+ch/+VAPUDqaYooiP5gOQYrp/v2OVMs+Gqb2eHMKihHSpwVnDpxEBkABL4j+UpEquXyKpIIFnmABN+T3l4phpfXmqmI4wiInx1laz6DJQU8UZs8aI6u6Fh1cs9m5cWgjtA8akhSP9/UnATbw6ZG+xCwJc9V7MNwhp19vn5uZyWvqGs7eRRS3N0cv5I7Iqsoz+QuUPagHwAyVkM/9/a2UUhQ01gtZYBe/Ogva4VgoJG4cmLlrbIF93SirdriCSm+n8uqknfEG2pIQ31TYsV5r+h0s+pjhR9RxFkKPShX2O6lbCQQ84tp7ZngUNKr4vpQEfDOdB68/tjAMA4x3zrXvE7N99KoMjkJi28hToJMF/8OIXcVx8173vZ/jw0rioUV5rdF3FhBWzFntZEE+4rAdXo8zi4OaDm7x49gX5E0R5Qjrp3YcSdg1njFqKl6UbxJZ3H7FS0fiCJ3bRI/FU8DYITvY/jA0Hxqbs27G4p/5tsG55k6kRcq1WQ= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM8PR11MB5591.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(33656002)(508600001)(5660300002)(2906002)(66476007)(9686003)(53546011)(6506007)(83380400001)(966005)(4326008)(8936002)(76116006)(122000001)(8676002)(66556008)(55016002)(66946007)(7696005)(71200400001)(86362001)(66446008)(38100700002)(64756008)(316002)(186003)(38070700005)(110136005)(26005)(54906003)(52536014); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?nLNjWezko+bomG0zKrqQmfWUnDmMFDCLmez19/xrNS82v7ZpKdpjvopTYBr3?= =?us-ascii?Q?tRN7cUE1/KWBaTAwvsFuLIGaaVxNRO8K9cdR0CoaBF3/qpUJYZ46LaWAzs2V?= =?us-ascii?Q?ECqDlCsjFmpWgOeSq8DJNmcrA9rKon3e6i8CnYEonb+OKAQFcmP+on0o6Nq7?= =?us-ascii?Q?R+DbwOIH3oAuios2w0nVVDjP+DVVw957xAECzijs6FarMitev6JEUi58EvUG?= =?us-ascii?Q?ZNM4A3daa2nNFKUOGbBH+XXvKPZ2PVuTcXXRrV2C9YW3H6J3EmDu/7UY1ekc?= =?us-ascii?Q?lq5Jdke/N/ToztA5CJBLrhYgrAefbrIfjjuVsCKwYyxO2GDCbY6USWbbk53X?= =?us-ascii?Q?Y2o7zgIagKJNQ10+cHO4+jwjuo/HWQhG9U5ZkdtouzE2Vh7Li2Dc3Tp+sscH?= =?us-ascii?Q?MTgctpbw4dNpCPeoqyC05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PL2gnF1?= =?us-ascii?Q?vaY=3D?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8PR11MB5591.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a6932967-66a6-4294-8b49-08d98a289007 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Oct 2021 06:55:06.8527 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: dHuEMRA9KEI0NGn6n6z5czyIA71qvcpHMaKxzr5aWVBzh8JPPz2BrauxPc5dR/iweYJ3PHYLj/ITwfxo2J3MtA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5622 X-OriginatorOrg: intel.com 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" > -----Original Message----- > From: Dmitry Kozlyuk > Sent: Thursday, September 30, 2021 3:44 PM > To: Peng, ZhihongX ; olivier.matz@6wind.com > Cc: dev@dpdk.org; stable@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] lib/cmdline: release cl when cmdline exit >=20 > 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- > zhi > > hongx.peng@intel.com/ >=20 > Hi Zhihong, > v2 doesn't address my concerns above. > Do you have any objections? I got it wrong, I have submitted the v3 version and added the rel_notes doc= ument.