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 AC932A0543; Thu, 22 Sep 2022 15:46:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9C89C40E28; Thu, 22 Sep 2022 15:46:44 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id B975140E0F; Thu, 22 Sep 2022 15:46:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663854404; x=1695390404; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=2Q0ZWk+YM3qA8sBsHj7+3PFL13R7CIyoPwFF063gyAQ=; b=bbfoMll0LTpNWjcIdse3oMs9cAKLSs6GGCYIOZLSFkbUfiMRcmJd1JX7 CKrfU74KtkOV/aMDl9l+IrFk94o8CDy/ET0zRMUYIagEzBsGjTwTuNS5C B1nA05JliRcXOA3w9EpUmY44Qr75apy46PuKLJvlwkJJMYMjpNcI8qKOr kt9qAYmooSGSeovaxJn0DYP8ZREId/4qFCTzea22NpVl04w3gjcXcp1v7 87SJ2BcJ/LhOq03X/sIubih/j6Y/C8z3/XXAjr766PPvrriERlh56lxnj K2DvlYxB9pwwlhmG9RRsbcF3RrQ73TzjC+17KJcKBjUOD+KaHJwgtD7nF A==; X-IronPort-AV: E=McAfee;i="6500,9779,10478"; a="287379934" X-IronPort-AV: E=Sophos;i="5.93,335,1654585200"; d="scan'208";a="287379934" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2022 06:46:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,335,1654585200"; d="scan'208";a="652973692" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga001.jf.intel.com with ESMTP; 22 Sep 2022 06:46:42 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 22 Sep 2022 06:46:42 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 22 Sep 2022 06:46:41 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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.2375.31 via Frontend Transport; Thu, 22 Sep 2022 06:46:41 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.168) 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.2375.31; Thu, 22 Sep 2022 06:46:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gpr4hMohPwzNcZSCrP8KYrtxEkWhgQ154+RKVxHI8eUzlT/jqEbFa85dKQ7TRCQwCbY9EAxC92ja1njisU1Fwp+tNB7F4pFTxSLE0Nqdja4cvmLfqyY2S9gN9lG3UqAtqE7FUxXppHg8OVZEfhQESPnEFanRsE8xpm2FWmEs0tVQIPuQEiOSuKyANLjGqXyxgAAROB2UrnHu69gD9EtLS2RTrGMf1nHWy2Tqe1Nx7AC6LUI7661j9P8tEs1CV+TZ3/wYs3Tm20pPdi4JGPA4IjR0B08zDIrhDjeLQbpWbyoEKX0OgFus64VlkDYR8lOYFlJMMvSRhgKfEIzV+VqNVQ== 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=XIMqLIFdw8f64hyme4lK1QZyxTXG0PtXOuFvb1oE8Kc=; b=Z/n354mfx9FaFHpfERAMmOCMfbPSorRHj8s7Bdzs9rAy0TYUF9MWW4iyfd+I5rZCYOagTbcmCE8nW9yQ+0mtLXdFy7I7DypDgZAInYNVD2S9/i3SRdE8QbMEtZq6tSokmhvkLFYrf533dUFVS7nUVfmcHHgdGbgkH0Jv+d83TRksYnFfsushgx3fChigOV5U3QHGY6kszOMK/Rp+3Upjz1pgWbt0RWCjN1GJF0rBQAD+l1OZWZOpVYhBC2nzsezIUbEGchVA7xgMZNRUc2m4DSHcy7kZOTbg6KDkxmiFgR32wI6QzOkbk6JeVetcFe+Kc5yiqaqhDreVv7Ixvv7sKg== 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 DM8PR11MB5672.namprd11.prod.outlook.com (2603:10b6:8:26::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.18; Thu, 22 Sep 2022 13:46:35 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::408e:79cb:b715:b8ac]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::408e:79cb:b715:b8ac%4]) with mapi id 15.20.5654.018; Thu, 22 Sep 2022 13:46:35 +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+779AgGz1EmA= Date: Thu, 22 Sep 2022 13:46:35 +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_|DM8PR11MB5672:EE_ x-ms-office365-filtering-correlation-id: 383d1f01-7304-4dba-c1c0-08da9ca0ddaf x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wmR0dIrYk9N1fvxXEjmc/TrEdiPk40SFZKPDTcNvBrbH57CBC82i9oL97uTjeVlECph9qMMPhH9o83zJPwpgENPZ+DSIVEIQNuny3NRbnf6wl4LhLPxDmLMVxNW4CVgTaX6mijxIIljI2K965x65cG+mgVK9heLJsWbKte7I5iZGA4X3EbwbDWgXm04gzZrI+SdF46PeoqF8J1QpNU4/r5e7lVsAPoYINqzG/VqqDnhnSi7922897pduY8gz5dgU64dnKaC19OzHi9Zw86xq211vPRvR95UHeTzRYIMcrffPPiA9LnqxfJ4SwDQOkjRHf9uj/4DNls4FxUpJnE8RX84Nkk5y+zuqt70tPHKNO/Z2w2ZL4ktMVooAaUw223aIAWwMaG8iVczX/oxyYW1U6s/7MMtJhHippmars1tYN5AjFrQJDUeJSH44/3t4t+v/pyM25SuTBOuPs6RSYjv0NBsaV2McFA4QOEIX/Bq2jusKO2dRNZu3CHPdRx7hLc7yZtKSJGlTv/s9d6f3GZqMA7hRYD1K2RYJ0a2cHuZuip9/FYw1q48kcA5g/npCnhEIYSQYPFsKuNqSZKvUlNcJuG9FhYzJIIzj+hg6xvesIN4ipUM4FUnK0FOHLxmhITOlIjqTnrlXVC8jF2NEZjarU62Qkqgy0QRHhK6z6V0hiLYPSHakDOzz2e3W4F1zJTTg3DiLCiCHxGNKMvXCG/JNBANZ2rkW4mQ5ZjujfZRdjOkMeKqmdjrt9wyEHt8ZLaqJhn1LvEC8+H1nC+nB69lDWQ== 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)(346002)(39860400002)(376002)(136003)(366004)(451199015)(316002)(71200400001)(54906003)(38070700005)(5660300002)(110136005)(2906002)(52536014)(66946007)(66556008)(66476007)(66446008)(64756008)(76116006)(4326008)(86362001)(8676002)(8936002)(41300700001)(33656002)(186003)(55016003)(83380400001)(6506007)(122000001)(7696005)(53546011)(478600001)(82960400001)(38100700002)(26005)(9686003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?7eebNNS6ELp+D972yX/tv3vlHRrpULw3N/YO19UKMJ7Wu8Q+Cddt3vKB3CSg?= =?us-ascii?Q?T7kiO2cTnd/XtuShR/L0nPu8bZ4kEFlp51YUNFyzJFdhB/GuAEC9W6Dhd2Vi?= =?us-ascii?Q?wuLyJRBcAz91UVCVcruFA/VumkVbmn5Wo7TcNngIgHmrdWH7wxTyWLVAAHdn?= =?us-ascii?Q?v5+kXgqRakc6ZrAw9+eAd1ijeQwXE6ZeQhver3VQep4L/x2tnJpB2fld3TCK?= =?us-ascii?Q?CtNLqsbESJQ8HqiYVGP+OJAoV5rJQeN17jYH2u4lGqcKWykoTvobDmxv/8ij?= =?us-ascii?Q?dayHGUATv03HyhMOcv8Lsu6ABoI/0EF2seh72jVzL36qcLCbC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ZXWh5LyXwGrWxMu9q1a6745npJO41maCbejvJFIpSmWzF?= =?us-ascii?Q?pKZfb4ZA5wsDiexHMhTsSXcS7YvNTed+83wWNSdF9bOkMfVNwFdF1MG0FJZy?= =?us-ascii?Q?ixlymFoIMElvqTC0EH9HuYuoXU8LPKw3/aJZKIyezs9tXu+PqSOE4rHGeUW7?= =?us-ascii?Q?qN4hzosxUX9bwc+29gOArwnu+r1+FV53uD4zk45QN4ivWsIfMVDub+PyprrM?= =?us-ascii?Q?+fljAPxQ9v+G5zECqjkrmFr7GruHiVxqA6uHyzSA0RMUpZqh2QYzjQ75qon5?= =?us-ascii?Q?3WvJsm7wyAn2pT88/ckYkj/vymclLS2AHPlB/PMRGqetQ3tDnsRTyl7C91f6?= =?us-ascii?Q?NrpmK/mmNghhzVfscwXuYSiv0hbFSAldxp95nVyx?= 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: 383d1f01-7304-4dba-c1c0-08da9ca0ddaf X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Sep 2022 13:46:35.4173 (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: iLNvTmKKVqfC5O5o3IGBqGP9S7yb/T/3Ky4GpdVBmgSaCCEyp+6IwfkmB0X0W4fVMxTItk728LzzkriVTBD4PA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5672 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: Friday, July 15, 2022 1:55 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: 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