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 C17E8A0C43 for ; Thu, 30 Sep 2021 08:53:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B15BD410F1; Thu, 30 Sep 2021 08:53:43 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 6A994410EA; Thu, 30 Sep 2021 08:53:40 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10122"; a="204601651" X-IronPort-AV: E=Sophos;i="5.85,335,1624345200"; d="scan'208";a="204601651" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2021 23:53:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,335,1624345200"; d="scan'208";a="707710704" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga006.fm.intel.com with ESMTP; 29 Sep 2021 23:53:32 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) 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; Wed, 29 Sep 2021 23:53:31 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 29 Sep 2021 23:53:31 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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 via Frontend Transport; Wed, 29 Sep 2021 23:53:31 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.100) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Wed, 29 Sep 2021 23:53:31 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P3HqE0L/quoLGI8ICAXey6HlJvRYoxOwTAncK0wABr/nBL2Mi4Bib7Syo59quRTX0uz68olGq6mLiK8gUqIxGRqtV75WuksAVgrMDmzY4m58oQ28L12Ng9sn1HIU3YEAOdYJLKmlME9Lldau5aFn0fKPInUCT+h/gK6uFzrj1Wb5cbXg1J5aCvuQrLyvKUOPIoW0Wk+jYy++9tpQrtCyB/V4RCjrhI82MRecsULN6xI6cwD4tuJZZ2DW4Zr+UaajpbpMBY78AFA+FMJyaNLCSa28KiejlgtU9zlonXZWJ89SFmKXnwkgtcG5ZTR69AjR+qNtTljGKsEiXv4S4q9pzg== 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; bh=ctowhpPFv5Y+CxByOyVpJsomssbsB/Xc5z2ONhqc6Sw=; b=VOZ3BBShvEkN5pvE2IhiUh+5UFPG74EGcvS0KWA8tx+bMEWuynMfjB4ChfQqGSSVsMhwu8bDMbC0ww1T35fqjVavHytUj28jdjh5GUF+pepOXznJobKC9Ug3aGKdffT45K6mCS0HpkpZ/WJw8ChDZPDIzDdp/F5tb7W5xoj0NakoN9ZkvGmMpjUf6BSgtIysfbKCKRXB0Pw4mkPKfK2nBAzmS58Jh3KESatYgZ4ireNUuAwoOQjj3tIbnD+9icLQ2iJhJjCE4vgcyL3fYJ7Q9r2mIKoSIJGtQQJ1O4T/t4mP2JO/0G6B/bYtzpfHqVHyvYb2E8VdZGyvbYWugyXJ6w== 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=ctowhpPFv5Y+CxByOyVpJsomssbsB/Xc5z2ONhqc6Sw=; b=VPq1TtGd3hnr56w7SuklDtC1EdHdX0FkbY6w+ZL75X2d9tTlK/U9h+qgfVpS7wyRsskUinUnD2vTnUdGXdgH6BNq99K50YJG11Qel62PFsWe+p4+VqxE8EwxKDlwela9YqYLzzc4/a9ZA/uWOgGdigQC0z7B61KdU6BV4hK1uyc= Received: from DM8PR11MB5591.namprd11.prod.outlook.com (2603:10b6:8:38::23) by DM8PR11MB5621.namprd11.prod.outlook.com (2603:10b6:8:38::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14; Thu, 30 Sep 2021 06:53:30 +0000 Received: from DM8PR11MB5591.namprd11.prod.outlook.com ([fe80::904:ace8:b3b:c1a2]) by DM8PR11MB5591.namprd11.prod.outlook.com ([fe80::904:ace8:b3b:c1a2%4]) with mapi id 15.20.4566.015; Thu, 30 Sep 2021 06:53:30 +0000 From: "Peng, ZhihongX" To: Dmitry Kozlyuk CC: "olivier.matz@6wind.com" , "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] lib/cmdline: release cl when cmdline exit Thread-Index: AQHXnhC381HXo9uzAU2Gt5tm0Dvog6uN5cYAgAikmsCAABx8gIAlrHIA Date: Thu, 30 Sep 2021 06:53:30 +0000 Message-ID: References: <20210831022844.18057-1-zhihongx.peng@intel.com> <20210831205224.14ddb447@sovereign> <20210906103333.13ce4760@sovereign> In-Reply-To: <20210906103333.13ce4760@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: f1b656bd-6e96-4ac1-f2b4-08d983df031c x-ms-traffictypediagnostic: DM8PR11MB5621: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3968; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: RD/u5baJtEOzhgz27IEJJrMHa4tS8yK7SFt75eh7ArLqJPtnMTG927u5GQa1J5SNMkmCVmCDrVnogdg6vjfFAfwYefxV7NHY5Jj7mxqoK269g+eKtSQVYVsrwOKjpVhV+LAs9X5SdKFqu7u3ugM1uMY63SeA4lCRYIogI+2yA9ryq484UeQ0GBjk1wvsaOFPAaLCgkZgLgU2HFTctNLUpMxIr0TS7xZJ5pH1UERjqqt3e+ZXl+JieKU7KvVkQAdPuwUkwYEiHCQ23LLmYiH1tnbdBGcwg6m1lUlgjY1xwo4xDSJfdDfOK/w8h79HPZbzPAZ14NHT4TQ2hq/LrTIHKWvVM2y8q9rJhAxHNsIVUfsKrCdTXcKMkVoJh2eiI52JpyHQq9nzeJ/5B88aorBNThQVxhDLteSwZcs/rxNy7u77MoGn5Gwafc74I7BQv2Owt7s1XG7J+JzgycW/jHPrSqJ5NLhy09JoLiJaABVvztRs7Znsrawwnvue9c26z3DreptFLo1ry1VZ/uN/i28QIcBRSCV8IcRqv/qQllctgvZoBEj0hm74r0Dtbi+5yqYfc7+skUa//vlw6++OAHQkSm1oX6nSmv3Kg+qaWZ0X9RkfhZHkPIi+PhGy3y/9zhEZOyJdA437hQipKQCwxyw4ojBwCSHhiEcy0pSG1/AtmusKktFQU50bra1cxM81Kj4IhUT54r/H0TEt4TOzgEATkAiToomGYHiazx20yggjsLsvG/lSVyYwHonwkDCvjwbVZOIiaqYqbN0KNYC7c0NUCMx/jkmYuzmUD4DaH1Tmhnk= 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)(66476007)(66446008)(66556008)(64756008)(71200400001)(7696005)(83380400001)(8936002)(8676002)(55016002)(6916009)(9686003)(316002)(4326008)(26005)(186003)(966005)(54906003)(122000001)(508600001)(76116006)(52536014)(2906002)(53546011)(6506007)(66946007)(86362001)(38100700002)(38070700005)(33656002)(5660300002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?cI8RKZFhhVM2btFEPSf4Ske+WSVovF2kvnorL/pjY78Pvo6TJge4Smxq0/9D?= =?us-ascii?Q?XSiVNAw4d3dYRBFWZ6lLy9zKxWQJZjiqklYj1vEUPIikLdvXxBu+lI54+hol?= =?us-ascii?Q?3QdyO+LjSp7+6b7zcGnEuB4LoufgzLMbAVlVRo8qhD0Toh0NjZqHh37tadAw?= =?us-ascii?Q?9zZxEMSxpJ+C/pmneVhgP9lVcYbtjI83ijIZ4dvPCb6WiAP+45J6fNsmN1MB?= =?us-ascii?Q?fTBjWhrvSd70zx2qgZz21KBKKPgJ3G3W6B+y84W0ufPKZR7g2bEvLvk4ZegM?= =?us-ascii?Q?AONr1Jni8BFDFjY+kQoEfWiQI3a3avoSu7HzzFUDS79Ao1CsOnp7IeYjzbKH?= =?us-ascii?Q?olBwBv2qPsZqQ3f6stxkIopvCODIfYRwVxmkxFJNm1mIrDlznNY5EryVFxiF?= =?us-ascii?Q?D4w/BROjwngzd+R5z0sq0h0B504Ue6M7OlFPbcjAd4SEWRyaW+DGUw3q8mxs?= =?us-ascii?Q?QSVfqx98Er4HCA87/+8wFinRhq/ZiWJ1br0wsglM33rUkgxezr2Mne7A6jIV?= =?us-ascii?Q?mar/5yUXNAvJDcucxIR3m0sbPCMGPhWD/cxzlgM1zcmz38ldFvJOschk8AfA?= =?us-ascii?Q?E/4NmvMl+QOs8NAyX1i6ujWfH/KQIjAfSck/Dvr23VTp2NKABmjVf4iQVZU/?= =?us-ascii?Q?3KomZRe5KRpiXAY9+DPA4ij6M6xm98D/jXY0hxVOHqc7hKdKp/+xxFjHIwDf?= =?us-ascii?Q?33S0A9OrqHkKtLYAUI0kNYpQeP2PXoStZh/R9u+O96BrFYCMYrDndl8XJxwB?= =?us-ascii?Q?6JbXRkG9QpeC3y5N0op8TwhDCJzlamye4spD2gxHy72oiqS8pplVr8iIvtSo?= =?us-ascii?Q?cGI6Ub9CJP1X9OvNbACFJP4aDiZDbF6neXWVcJs0nmkzwc93Cg+BARym83dc?= =?us-ascii?Q?NNs08dkJiuWI7DWByV9Igb7Hyny6QyapEYD99eptIfstplS+GgyH9Xz4gQM8?= =?us-ascii?Q?GY/B4uLnbtx3lNrunqjgV/pNjrFEWLVZwlwYuN9efZpOs4wPCkhJyEReR7Ax?= =?us-ascii?Q?cnFFgwgv/HmmrmcDZWthuzAEaQrXTvkjY+4XKjmmF4MImI17Vp62eWShmDb3?= =?us-ascii?Q?R/OYUdEgKEYvFzV99Gn39ASlmer+iTg+1PB/ftfuwbjc4XpliH4TbAYegMS7?= =?us-ascii?Q?sSs7CESbdY4HehofbM4GPqhPL2lgrZt/S3pwktNUSB9Sw4mlQ+lCRphp+5Mn?= =?us-ascii?Q?UzdsBD3h3qsJQhVgHJpphXSbsbk8jadiEFgbL9XJDzu/1urs+8sJhJii+UeJ?= =?us-ascii?Q?7Kn+eZJwrosQ/14MMf5QNSqQtEdcoi4g1IvKfq+IDeInNM86qy0m8lNpN74y?= =?us-ascii?Q?ARIjleVsV5A/P46eoqlOL1WS?= 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: f1b656bd-6e96-4ac1-f2b4-08d983df031c X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Sep 2021 06:53:30.1954 (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: vgvdQb1e5fyzfwOzKNE3Q3IGDWEFjKOHxpyuOvrs66A0YIojg4WOsBf/p4MuxNLEyu/N/2yBjA0XUJqtj1dm8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5621 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: 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 >=20 > 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_f= ree, > only one app called. >=20 > 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 t= he > 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/