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 B5E40A00C4; Thu, 29 Sep 2022 10:40:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A9EA541143; Thu, 29 Sep 2022 10:40:43 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 0180640694; Thu, 29 Sep 2022 10:40:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664440842; x=1695976842; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=tppb4YAn4JNcrV7Dbm07RJzZBS2GE++ZzHMGm0huSAg=; b=kn6clkjESHNlJ3gdRP1S9spvq2aZkDsCLWHRjGEYRmqh8EDefWVmzzYu hesTXWSS0/Eh+SqbSZN3ksSWzonmo2BPxuK62LivNat2dGuD8kIOvefxg H9OcgbVECfXDNYuWPf0tFrMSGj+SN43s2ov0fG3BWEFCsMtf98KZQEt9S 7j+k+V/GtryIbR0AImLKXpe67LumFhQHtncvYTuxKEOhpD087u3yEt6G7 3+fTkf2PfXjfZsnuNSWu/IrJMGyDVe6Xc5sBEmOz8xK7R6vSXWfTxpKpB jccjMtvtl745ETE5aSHXac240AUFjJj/2k5PHZmtj9aHzYNMgYYHW5MCo A==; X-IronPort-AV: E=McAfee;i="6500,9779,10484"; a="365880581" X-IronPort-AV: E=Sophos;i="5.93,354,1654585200"; d="scan'208";a="365880581" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2022 01:40:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10484"; a="599910239" X-IronPort-AV: E=Sophos;i="5.93,354,1654585200"; d="scan'208";a="599910239" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga006.jf.intel.com with ESMTP; 29 Sep 2022 01:40:40 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 29 Sep 2022 01:40:39 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 29 Sep 2022 01:40:39 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Thu, 29 Sep 2022 01:40:39 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.109) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Thu, 29 Sep 2022 01:40:38 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZsbllGeuk7ex3bL++kk831iTUXbi/yioeRxFXtznG1k1hIArVLrgt+UJkcKNsnDiK/uOERBRI62JYBfGdCFLxbei+2yZvYd5BXRX7ipb8yRASE/Of9B3zytDsy18U4SlcV+nFCpZnhqbSWx7X8Ao+OOiAuKG9uNOsgTuLUVQyo6t7peMRN1OBTDAMGieqq24onQPBMtlvGzfKNkjb3hlyHchDxAJOF92WH6/q5MQDMGMoMAAMwAv5HRP4icLJMU5a5OpHk1fpy5qS2r18Ag345WH7XoSq4YNzBNGtTp6wVrMule0uh/Yx6QLAT/g2SKCMmQQSPHy2JVqmNnTHPjW3w== 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=007FnDcPy3Qn1AK18l3ZHhWoxjWHXg10TDmJi7S2oN0=; b=BFnLtxVi7bKM/bmiqYstBJALzelTplpRkdYmpQRr4NPYFmbDMYDJ4V0WDodDVx3Fw6YGxtpcYknTGC1cPG1Y4yrwX5JmNxzj1TiL2Ma6Mbg+Cm4iUkebYBy8+u942C+37r0hwpY8q0q1PCypygMpDiYc5H7ZjutBqLl9StEvMbClik7yslJus3R1RYxU4m4/MPhMfZJ6P5ucKRdB5F9oIdAGmlrM04VswPEsvopke8ne15e9u+0tiEvGwDrgGAk+HyKPN4bJejXDVUoMM61z+odKA+rJ9iGzPTIA+Z+CKWKdMNT9jjy8b1iYlQq/W8YWKSaR3mBQVFhfikVreki1UA== 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 Received: from SN6PR11MB3504.namprd11.prod.outlook.com (2603:10b6:805:d0::17) by DS0PR11MB7286.namprd11.prod.outlook.com (2603:10b6:8:13c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25; Thu, 29 Sep 2022 08:40:36 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::39bf:57b1:4824:d40d]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::39bf:57b1:4824:d40d%6]) with mapi id 15.20.5676.017; Thu, 29 Sep 2022 08:40:36 +0000 From: "Xia, Chenbo" To: "Ma, WenwuX" , "maxime.coquelin@redhat.com" , "dev@dpdk.org" CC: "Hu, Jiayu" , "Wang, Yinan" , "He, Xingguang" , "Ling, WeiX" , "Wang, YuanX" , "stable@dpdk.org" Subject: RE: [PATCH] examples/vhost: fix use after free Thread-Topic: [PATCH] examples/vhost: fix use after free Thread-Index: AQHYl0DlKyIv8oTyDE6NFhssbWJb9a1+779AgGz1EmCACqrhcA== Date: Thu, 29 Sep 2022 08:40:36 +0000 Message-ID: References: <20220714051106.1134222-1-wenwux.ma@intel.com> In-Reply-To: Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SN6PR11MB3504:EE_|DS0PR11MB7286:EE_ x-ms-office365-filtering-correlation-id: f63b1a63-b23b-47a7-c7ae-08daa1f64798 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: rdecAvJGBEhjrLy7etN939wm9UxfiVVbk3SWj+VQcXKNoyXYDsysYrty6oi5GnOZVE9/BkzUu8HlgCXGun6FSmYBZw5xbc7/rDbGYDryMO/KXwWJauOt6ED2tkLxF+Irgy7QXyjsc9jRjPWtcutOTztX696aL0gURSRMqti+gQLpg/SclGrhzEtIaPlfWHRutOLv6A4H5gkgaWIItGeDRfBtA1WyzKtATaNbeQ2D1AAT0QNCAFTyirDcfz3JLnZ3may7IqWgcqEdiOF3PF5CcCfH8WLtPpxXkRuQLiYGZO09e9M58/sISgqYHWX6/Ifbx9UtRHB+qvMaeHXpKvZMQO9Y/NAoEG58lEsVRJ3wP6ft1k2hqx1OrRmL9jmbsmsky065NYCWlr4bxtinjgPx19DF4aFrGcFDvslzYx4ZNpeE+czQc2xJ5APvghFQT0cbq40mAvkneecdtkFQwYgOGOsYMM9Hz3dHoTG9XFiw0LKeuQNEbAdtveEPeWvbJ5sRsFPf9qSP4M/PpQ0aS5fIERsPHy9uxEizpHmqVXaQNs7r6Z0BC+uL+AfqEARq/2kU81HPyst7ZBMu0HpdMZcStypq4N0kN0ek8DEU26+weon8Ska7ghVjpMfnrJrITTun8I8vulMkieeu0jLWj/ovYLoDdEN1cmZquDzq0KEwzognnwCRvcsOILL98OHGNQOlrX+sZTIo+f/KKId8hqAlq75eiKdNiEBmWOUQKuwvIV2WicG3fBgxGkT90ZU55XruxL6X1Mss3OyviNqVKT4SDQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3504.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(136003)(39860400002)(346002)(366004)(376002)(451199015)(86362001)(38100700002)(82960400001)(33656002)(122000001)(38070700005)(186003)(5660300002)(55016003)(6506007)(71200400001)(26005)(53546011)(478600001)(9686003)(41300700001)(7696005)(8676002)(83380400001)(66476007)(2906002)(4326008)(66446008)(316002)(66946007)(54906003)(64756008)(110136005)(76116006)(8936002)(52536014)(66556008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?80dr4HkMVfqyOe4piNFKnaF0+k4GvOVqvyPjWasHTNGMx5n+BPFsIwLaPuEi?= =?us-ascii?Q?ByVlNoF0SJzkASfLHD4cR1bEmCpUHEx4fkwN5ACBEb1AlcCZ6TqPUs7VRbSe?= =?us-ascii?Q?KQxq8s3a31mHJqazG4l9JmTnjhEx/wDmOJlvejoHD4PJ7+zQVc28EdqVUW/y?= =?us-ascii?Q?ANzH6dKIv6qaYTEtWdGza45wzXNZ16vc0byU9j4/pUuREhPW5Ny+tF53ZGAS?= =?us-ascii?Q?GL9qgwhNLCEGXFGwhF7I91oB4aBwSzYUt73k2De6ozhohMzSngXCYWuryU9h?= =?us-ascii?Q?4rjcZfKq5haYQJlDIH/dloamIcERzwTqcMZb8vW6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q5lZjs18OBFzbboE8YO/q0O1xUKBuRvFChHYwfqVWPRe2M4Yx9Lqva5YBS4c?= =?us-ascii?Q?+3uQBiJ+JjHKgDNCwKabugrDCk//O2ByQqcI4K59zZpGq2CQ7Zsy1Qx5rGKA?= =?us-ascii?Q?5LcI0p6uxIQ8xFOzxk9UwsR6V1RYKf15CrJGkfVSe1eMJgvPo6XOjtIZWlG8?= =?us-ascii?Q?LrMZv1XuNDGbl3zTH5oHQl5wsn+1xGH1tPyBmN8ldreyLFXyXwvcBqXHnlgF?= =?us-ascii?Q?i47+4IPHl1dIvcbQLBEo29UmyvRePj3j7ncLbKBYJouT8s9o8AW3dHqCs/D5?= =?us-ascii?Q?iLSQcakqWT9d3qjHHbJTvmg25Vg5E8P1aXfys+kvm6KxgUCu3CQc+6FI6yZE?= =?us-ascii?Q?Wx8a32nz05ND/cdY9duCwx/sE9vSaGejEfgSubib?= 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: SN6PR11MB3504.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f63b1a63-b23b-47a7-c7ae-08daa1f64798 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Sep 2022 08:40:36.1099 (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: z0SBluNZZe98wAnZ694Id7wnrHOO5jtJcgZoObCgzjR40aPTkGdPP3ZrSnJbQEvnXKegXBvh8SiGw7E+YhTZ0A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7286 X-OriginatorOrg: intel.com 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 > -----Original Message----- > From: Xia, Chenbo > Sent: Thursday, September 22, 2022 9:47 PM > To: Ma, WenwuX ; maxime.coquelin@redhat.com; > dev@dpdk.org > Cc: Hu, Jiayu ; Wang, Yinan ; H= e, > Xingguang ; Ling, WeiX ; Wan= g, > YuanX ; stable@dpdk.org > Subject: RE: [PATCH] examples/vhost: fix use after free >=20 > > -----Original Message----- > > From: Xia, Chenbo > > Sent: Friday, July 15, 2022 1:55 PM > > To: Ma, WenwuX ; maxime.coquelin@redhat.com; > > dev@dpdk.org > > Cc: Hu, Jiayu ; Wang, Yinan ; > He, > > Xingguang ; Ling, WeiX ; > Wang, > > YuanX ; stable@dpdk.org > > Subject: RE: [PATCH] examples/vhost: fix use after free > > > > > -----Original Message----- > > > From: Ma, WenwuX > > > Sent: Thursday, July 14, 2022 1:11 PM > > > To: maxime.coquelin@redhat.com; Xia, Chenbo ; > > > dev@dpdk.org > > > Cc: Hu, Jiayu ; Wang, Yinan ; > > He, > > > Xingguang ; Ling, WeiX ; > > Wang, > > > YuanX ; Ma, WenwuX ; > > > stable@dpdk.org > > > Subject: [PATCH] examples/vhost: fix use after free > > > > > > In async_enqueue_pkts(), the failed pkts will > > > be freed before return, but, the failed pkts may be > > > retried later, it will cause use after free. So, > > > we free the failed pkts after retry. > > > > > > Fixes: 1907ce4baec3 ("examples/vhost: fix retry logic on Rx path") > > > Cc: stable@dpdk.org > > > > > > Signed-off-by: Wenwu Ma > > > --- > > > examples/vhost/main.c | 19 ++++++++++++------- > > > 1 file changed, 12 insertions(+), 7 deletions(-) > > > > > >=20 > Reviewed-by: Chenbo Xia Applied to next-virtio/main, thanks