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 F22F6A0C4E for ; Wed, 13 Oct 2021 03:54:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DE9B3410F2; Wed, 13 Oct 2021 03:54:07 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 56EBF40150; Wed, 13 Oct 2021 03:54:05 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10135"; a="313519548" X-IronPort-AV: E=Sophos;i="5.85,369,1624345200"; d="scan'208";a="313519548" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2021 18:54:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,369,1624345200"; d="scan'208";a="659343321" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga005.jf.intel.com with ESMTP; 12 Oct 2021 18:54:03 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 12 Oct 2021 18:54:03 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 12 Oct 2021 18:54:03 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.46) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Tue, 12 Oct 2021 18:54:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GQKmjmOZOK+XcW5J1Y0Sx04HlqKV2P8lPt717sz3qLMTtFiw8jb2zNRiHZcF9ynH7gLOLCZDnU+MHfP+uKFHEWeojSy0zlfwqMSWbq67jPWkdJXtxZfJDW0V63UnpXkv/wdFHUXPz3uq7bVAFZgTaB3DEyHIxiZaTIm8OfUh7TaMa+mQ9SvC62wsxOFp8Gw5xo0RKsxNiZ8himRU6PMY9rHAoMVojynoyRiyDAyxkyCoza4j51AkSb4isVXShAoqKn3zJj0ftYH9WnKhfF1vkkIsL0sHqWfYKqW2We13lDyT4pNbFQWieHRlN/a1bnV+YP2bFLnEXZYsnZvDY2l9kw== 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=9PL76ERROw9wPWWQyq1cavhFGd8PfENJewlnv5bWtpE=; b=InrDjmFOMYTOHtKyjasNmJn+BpjI9eMc5x8SN1+y7Xvs4vo3BC5/nlvAFYq2mk89f2AtfUfcpbZtP8DjoFpebYnLvB+r6s0U9jbm3Rmov+yeombwn0l0yVsERxXmzBios934cgtr3Due+GUCpuFweeGxHa07fQlJeJcOEYBGtHTdU0iCJFzXSKQ3dH2Llio0jiCT7HQ8SXpZ1vUMKdBwNO0aVhwFpak1b6PhRKiP6d37dHun0oF4X3WBs1aEKy4IzaXUqVIJrdEeQjhg7MU1nhbRYSfYd3TRt8mkYvnGo1kLDuBvXQxLvKf2Ey/bgtLN2Yz/Dxpsgiv8pxBQnZLAPQ== 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=9PL76ERROw9wPWWQyq1cavhFGd8PfENJewlnv5bWtpE=; b=Lsb8nj1L3x4qujFpYEEOPkwS+hTz1TY1+3NrTtB30hgxE4lC4nQSjokL2McHBWLc+WvUULa66oO0ypIwt+0ucdDbB2BJA/ZMKw3tGm8+BfFs25u282nj67LFY/OP3rzp4JTMI0DfwhFSBWZV8lAdvozdNeqvKIbi9AK6bZfXYis= Received: from DM8PR11MB5591.namprd11.prod.outlook.com (2603:10b6:8:38::23) by DM8PR11MB5654.namprd11.prod.outlook.com (2603:10b6:8:33::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20; Wed, 13 Oct 2021 01:53:57 +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.026; Wed, 13 Oct 2021 01:53:57 +0000 From: "Peng, ZhihongX" To: Dmitry Kozlyuk CC: "olivier.matz@6wind.com" , "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH v3 1/2] lib/cmdline: release cl when cmdline exit Thread-Index: AQHXvBEDWyRtANFDaUWd5Nf4RvsfEavNexkAgAK1jsA= Date: Wed, 13 Oct 2021 01:53:57 +0000 Message-ID: References: <20210917021502.502560-2-zhihongx.peng@intel.com> <20211008064131.369133-1-zhihongx.peng@intel.com> <20211011112558.21c68bfa@sovereign> In-Reply-To: <20211011112558.21c68bfa@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: af163413-743b-4610-cfc0-08d98dec51e6 x-ms-traffictypediagnostic: DM8PR11MB5654: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: YOOX4VVp5/Hn3Lkwz9OmR/CE0HCWHclIIi6ffib22saIbdVN636VqA4yZot1Pu6yFaJgDEgneGuhaxhxg1sWwPb77IvMp2tgrwxWAB03xy++wETk6wa+clTCR35DhvNlVr4PvCEev2pQbDRbhu2/u+A5XsrDjb4mxkWNfz9QAMS9LGMKKleNBfe7yK7AFoPPJKqA3Ms+PDNObROXaoleepufnAt890PO5tpOCzMYfqIEONmFwvLfCGNHQHgJcJQLFVdo084k+4BIH9yAv+OqaSYJbnyGL4XqOSReCJUhO7ilJ38jf4AknJx9KdpmUwcPEjx/bkCjX1SXijleOgsjV82/fWaI1bIeW7FL7nbbhrXi1XMj2/mt4I+GeocwrOEC7AoyslQF7Y8vseAAcpZ2KeadJOY/RYnFK7dB5ML0q9U7bZ09c5IIMTT7NIB9vz2Ty+i5AXesiXdNyjRJ1YVMLwKDJVNn/LOAFodQIlJA0fP1Vr6Z1rF2/ot+C76EXEf8/r6mFx7H360fSRheUnojE750F94cED23mPhwyZhHeSU1Xg3KUph+u83jeD9vO97oM8+FPXn4PnTe35/B4XH93kbaZpMNp9QJmpwveC7PUaBLTb2L/TFtYqP41Qq3scgbx1Gf9bP05Mj6q7+6KMaBZ5BmJrIPSA5HkdAC/UQ9b1uhSyIqOujXyIUCCi3O23nO3nbvJ6ZdiHngZA40b6uMxw== 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)(38070700005)(4326008)(7696005)(316002)(54906003)(86362001)(6916009)(82960400001)(64756008)(76116006)(66446008)(66946007)(66556008)(5660300002)(83380400001)(33656002)(6506007)(53546011)(66476007)(122000001)(508600001)(71200400001)(8936002)(9686003)(26005)(8676002)(2906002)(186003)(55016002)(38100700002)(52536014); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?YAytqL3+jN2+WwogZO8+DCExwK5IZYbM9LrpZlM3i1wpHdZMtBbFpLmvv6a1?= =?us-ascii?Q?3OYh2nTbpTQmYV7DDbjRxzSZnPCxspQLmRWlRZvH1Ac7vJrPGTmt6UBlkL1T?= =?us-ascii?Q?vQwPXaB3C7GoD/tmYlc94D//uQNdR/c6M10ram0jq108t+COjrqROiGEHcLz?= =?us-ascii?Q?guK5GSlZAniBUY/8Ws8B4KXIMXOnHzLz0GC8D5FqUSpP274Ge6YnflgFO0lg?= =?us-ascii?Q?0crqt6Du242ccIm+Jv7PwdUcxFAoz9F2JAQRdQCnijKd6t7iGsS1XeRg5/9W?= =?us-ascii?Q?Qz4I6koG1j6fUCRFF1p6mhmQ4iM8CRDAQl+x6TlD3GTcmonG8sB4uYq6sdrn?= =?us-ascii?Q?guTpFFsOmIs1JVgiRdNLK/1JDhFCqU3JLlLKUYdrbpz7Ykz5fr4BbMHexZdV?= =?us-ascii?Q?tJyfegim36FuN6S7xHW982eQTyGlT6VP6YmASg4mQ+bUbm7Q+3pctGBIO+RP?= =?us-ascii?Q?Y32IOMFtGJWGTFi449DUKu9bSUClb2XBoLMm2Ugf7qdevonQBfTZX9fp97K7?= =?us-ascii?Q?vdi/alZ6GesQEsiAMX9gbDsTKxQL6oPinrXvMLQtNWTahNNjD5V9EWbwgbR4?= =?us-ascii?Q?nX6MxyXPlAPaq4WKyILuvJ0VqYt0TTXSXb4HcyQw3QQdGoCSpo6j26VuXq0y?= =?us-ascii?Q?vs0ASWq95SGWqUhePXWdBs06lg4WJdM5Nc1iFIkRd+TqvWtWEjpqBUgZ1O0k?= =?us-ascii?Q?1xSoZpXHVT7s/FmkOb2rlAofkd7ls38jBHhC8ZGxnV8egVqQIQgefMkVjcHT?= =?us-ascii?Q?Br55ATlBnm6tUXRxY0NELil2gcl1dHUXdhTU2rKpIWwScwF9JglRXBANR98O?= =?us-ascii?Q?3kDVDo/QH4fABLOAngCzLCOfmGNokigx2TxProHJXMScKLLRY6dS0i5ed7zo?= =?us-ascii?Q?a9tXkwla+kD4koIwyHvCu5vL3wEzKBhQsRPpDwK60HtLzaIh/KR/7LFPWKsW?= =?us-ascii?Q?NGyWBqr3LsmC+xdrBYuzgnNm5cWy3Dmyx5FG6hds+6l3dlZu43R1p6s4qzeB?= =?us-ascii?Q?rEcp4YuGqvN2fw9Y2NtGD6R/8laB1uHqnWJL1Qsw+Q9Ls+nPWKtqzMtdf2N6?= =?us-ascii?Q?F5vG2Qhgk8L+uyEJSUX6s8hl9HnJbNghV1aV/X7iYlvm//r2/5TW97X2udeb?= =?us-ascii?Q?zSb+Yc8YHheoQa3NpqkZwmEqPNrxUhTdeGuwdl/DsC0xOsXySfJ6+5nhAf6b?= =?us-ascii?Q?Cmoqx1chUZPEVpwnJgMaY3dqPDmj0rKekwvD0rY2mvlNCe2puac7p9kgL0u9?= =?us-ascii?Q?rm/yf4r2ipF6XgD7w9Nj5GbmryeYkAkVQbrwEahjQqJXUHXTZWnOKZuiq0Vx?= =?us-ascii?Q?5I4=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: af163413-743b-4610-cfc0-08d98dec51e6 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Oct 2021 01:53:57.4121 (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: WCTIvIbYd8lGA9DxbyhGw/lvnZOcZ9vQwDquHH67LzOFaFIJAf1R98z9Q5+w9Oj+f5qduJTrQqp/wD3foStxGw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5654 X-OriginatorOrg: intel.com Subject: Re: [dpdk-stable] [PATCH v3 1/2] 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: Monday, October 11, 2021 4:26 PM > To: Peng, ZhihongX > Cc: olivier.matz@6wind.com; dev@dpdk.org; stable@dpdk.org > Subject: Re: [PATCH v3 1/2] lib/cmdline: release cl when cmdline exit >=20 > 2021-10-08 06:41 (UTC+0000), 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 >=20 > As I have explained before, backporting this will introduce a double-free= bug > in user apps unless their code are fixed, so it must not be done. The release notes have stated that this is the only thing we can do, and this unreasonable design should be resolved as soon as possible. And the user apps change is very small. > > > > Signed-off-by: Zhihong Peng > > --- > > doc/guides/rel_notes/release_21_11.rst | 5 +++++ > > lib/cmdline/cmdline_socket.c | 1 + > > 2 files changed, 6 insertions(+) > > > > diff --git a/doc/guides/rel_notes/release_21_11.rst > > b/doc/guides/rel_notes/release_21_11.rst > > index efeffe37a0..be24925d16 100644 > > --- a/doc/guides/rel_notes/release_21_11.rst > > +++ b/doc/guides/rel_notes/release_21_11.rst > > @@ -191,6 +191,11 @@ API Changes > > the crypto/security operation. This field will be used to communicat= e > > events such as soft expiry with IPsec in lookaside mode. > > > > +* cmdline: The API cmdline_stdin_exit has added cmdline_free function. > > + Malloc cl in the cmdline_stdin_new function, so release in the > > + cmdline_stdin_exit function is logical. The application code > > + that calls cmdline_free needs to be deleted. > > + >=20 > There's probably no need to go into such details, suggestion: >=20 > * cmdline: ``cmdline_stdin_exit()`` now frees the ``cmdline`` structure. > Calls to ``cmdline_free()`` after it need to be deleted from applicatio= ns. v4 version will be fixed. > > > > ABI Changes > > ----------- > > 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); > > }