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 35818A0032; Fri, 15 Jul 2022 07:54:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 852CF41140; Fri, 15 Jul 2022 07:54:46 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id B1E4040042; Fri, 15 Jul 2022 07:54:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657864485; x=1689400485; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=T1wRzYOgZ7/nTRBk9GNJXc5zzJhURbq0AzHJYQh7F8I=; b=Tskr8QcBYCqmXxgAXdkqRIsJ/B53KK/lZa6AtWJiclzw1LlGChriIY74 9t500ozyZesXjg44wbsKMAX/jQpmdUZjX9OV53bQv8vxXivVMYT9F7vkQ oePYPK3OFXYOl9/mAo8ghQVdgzvqR86NyYiF6QB092nv+wcrh5ke6E92e Zef/CfHOtexMwNIT9HRoRC6D6TLT+NaYzYh0cXw0hecalkY2u4wlRuIDy Pis3t4d4yhCNxffEyK9jWhZ7lDDX7qV6lcBRAjnvnLo62yfLeSSJhAIzN LyfWe4eijW8sI0eQSCPqFNUlCR6tlD8MjkTskDT7A5C5vYf8RLu66u3YG w==; X-IronPort-AV: E=McAfee;i="6400,9594,10408"; a="347385239" X-IronPort-AV: E=Sophos;i="5.92,272,1650956400"; d="scan'208";a="347385239" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2022 22:54:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,272,1650956400"; d="scan'208";a="623724912" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga008.jf.intel.com with ESMTP; 14 Jul 2022 22:54:43 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 14 Jul 2022 22:54:43 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) 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.2308.27; Thu, 14 Jul 2022 22:54:42 -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.2308.27 via Frontend Transport; Thu, 14 Jul 2022 22:54:42 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.46) 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.2308.27; Thu, 14 Jul 2022 22:54:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lA38I6MYdvaDoZrtJVidn7G08zuZgEjgWwcbtsowmWyKY9dy9CiJEHYqCWXVcdbQJzMicuelNjSzxjRhg7zdePSZoRmIIXPPUp/tc/8mXqOY1CcsLnhAlj8IuThrr/2EdsHO9cVLUaQz0rQMb5bUKDCKQVVjMdyF+XIlBIv0ItLVvpLDlRryxCE0MJngkrTiWIj4pSrxk/oC2alzL7PzADFO67ORo/6aU7FjrgH91MyLn0dSerwp1e74BzU7QY171c7H1iMAY+uA7FzMZGytnwSEqSjurKNmqXl6w/ky98TajYovD+gRKzcRj8q87dYESjDC6QKl7PMaqR6h52ANGQ== 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=9L6oTvOgJVqhpgZxcwb3kKgThl3OIiuh6qEG+oVnL0c=; b=hMdbQAXKcann1ejFI4P7VVWd3q2yOS5pq/STSxX4xpVk1EJYPcqLz+ybYmJWBDAkfrswW1f/UPGdgTjcSCBwTtsIA85PnzqHAJdd4jATwVk+bFZRCjb4fy/eNk/JufRFk+h+2RrY9UeuBPbL2XkG7wZSvcX6gjxKMQwobpIx752O7GkTzslOHzuqyTue8D1LfPDSG1O4++e/VVrMpzwHq9wpR73tUisXrK5bd0PXjxwyCKQP7xM5tF+CimfxWmfOTKIPyR9Trvopi9nFe7ss2jNazuUuU81v6EtPcJ98+MTYYI+hClIIT2vuoqSGpgFYaKwwqNnt9eR0G1K+7LC0ow== 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 MWHPR11MB1885.namprd11.prod.outlook.com (2603:10b6:300:111::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Fri, 15 Jul 2022 05:54:40 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::9df2:719:c1bb:7992]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::9df2:719:c1bb:7992%7]) with mapi id 15.20.5438.014; Fri, 15 Jul 2022 05:54:40 +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+779A Date: Fri, 15 Jul 2022 05:54:40 +0000 Message-ID: References: <20220714051106.1134222-1-wenwux.ma@intel.com> In-Reply-To: <20220714051106.1134222-1-wenwux.ma@intel.com> 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-office365-filtering-correlation-id: de38ab8d-e34d-4a08-17f3-08da662681f7 x-ms-traffictypediagnostic: MWHPR11MB1885:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9LCYmp9MNlszUnFlzGvYzuXrlrVjMDm+l9OzejYjJGlAP2lNcubEUuIC9Du9U1eMTQyZ6AJY7wNosxejsai10P51taH00U5hQoRBlv9bu3euDOzI3joJ+hi01vQozpQBQwLbvN4/uhD2Wckntb5i22uCHqv2ojTNRTp9HPv5cxILqFoDkiobwjmFky94TH5573cznASsZ8IDLVvaQVtU4abWDBKS65mYQwQu9HgJCUT8Cu9MpvLx3+3YLGW76pyW+D5sUkqzxNYce9VBC6QaEKYTnOD/NITgz618hqefFcvp3MeRECZBSVkeCjBb8TbVzZ0ngCwzvd8ir14+iNTMOt1yAfdiR5Hve1UU7ss8G6TvhVFKVNo2a+JmfOeIBf331Ev8bw3hSbUbznjfXsL4MfOCRhvkrYg8zJDYezrskBi3eJ37qoc2MN1XUp+sOHPPVjPzlIqwPUax18Z+PY2sXd+fn+0j1nk2cZXN0DRYbofSGt52o5zjtTwk7dk7x/V7jAchNNobwQ3mx/U/cp6Gos9klDfMMt3zz9DGoIvHT4beGHfgalXBE8l8pvZCwHQDOfuJk+gfkcYMmnd0wkOOnokUD81sRWVbtFpYM0d+cwqVMBBPvmqMeABiXkUWYYoapClbHGgV5rbMzHD/+75K9zFzljXOGOh4bxZNuaE90dLrD/gTUZf65G87Z+Hek85LUJGQwtCzSfUXlKzyQ0uSvngW8OA3r04yI1tFIdqwMu9EhSuWJGteq6v8jZvxv/n+rUd37VgrIvPGL+I9gTtnUN/wziz6lSEIs3zITayzu3vg0farmKW97wnwCt+Kp9lZ 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:(13230016)(396003)(39860400002)(136003)(376002)(346002)(366004)(54906003)(316002)(38100700002)(2906002)(82960400001)(110136005)(9686003)(6506007)(26005)(38070700005)(41300700001)(53546011)(7696005)(66446008)(76116006)(4326008)(83380400001)(33656002)(52536014)(8676002)(71200400001)(66946007)(64756008)(66476007)(86362001)(55016003)(5660300002)(4744005)(122000001)(478600001)(186003)(8936002)(66556008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?5EcdM6yUWTA99SjH4+mszmb42RTANmK0Wh0E0IdoSwIJfKkk6lYta2EQ24lu?= =?us-ascii?Q?WdJsFVlGo8mbLwzNKbOUE/k3n4dqcpHEydu+qpac5jxy+f2oO79x70m53dC9?= =?us-ascii?Q?+6ONBng8jQAcV5UOVbYP4/hOttQsOL6ehv3QgdH1OPaW8UUbLnYkzbuVDLbp?= =?us-ascii?Q?t4+I5EdPhTNqO96ly6QYOMIw9H0xxK5q71oY4frxfnfrWu7hC4Qu7wVr7899?= =?us-ascii?Q?3+tZTqohyUEEvicIby/ryHdklsBZTpNShNeNGzzffCbIJ8gFvSXrtPNmdgBK?= =?us-ascii?Q?ESbqBdrGEROd1Mm8xwdS4AdgVLRIaN7eep6BIQ6+T4sibfqFN69vswc5GCBx?= =?us-ascii?Q?CsGFZL4e3fsCJicemjCFupiOK+axbRq90ST0R07etBcLbLK0ijvammx6KXSJ?= =?us-ascii?Q?AY/4i4Z8513AX8jyi8JR3Lskc8tE5AKfxWKDDps7gxqX0LZe2/qneVk4IlMS?= =?us-ascii?Q?B+Af+VqyThqjl4tLrwRJrRpKucBLalAd4X0rIbCS0efwYLvvyJTCaYOvI8al?= =?us-ascii?Q?+N7TriJJwL4b3S178HcZlsA0ckkS9/mrg/cIlEycpkrfV9iSvs+w3W57VCFa?= =?us-ascii?Q?nNgSY7ickc+d4PxSZw3IsCkH6O0RB2QselfDkvmwFAlY8g/65CIdTPjIQHnl?= =?us-ascii?Q?W/4d/BRcJcLa3w4K024o03FET4Dt9IlVmCr0n0SYmT5bxYphyCbWa7nGHELM?= =?us-ascii?Q?4NABbOTydkSIGMzQA01PXFGVHq8wFCs26V05j63J6LUMeVI7yRINpEbm3j6s?= =?us-ascii?Q?pbpI1UCeCIXuvlRiGzR50EyaDiOFYjSsc0FI1slsZixKXyMydQEvUuImacVj?= =?us-ascii?Q?OLWx90zdjsygPZNonD0205etytIhAfPtBtBsWEu0eGYPAVXlE+k1dcxHDGQR?= =?us-ascii?Q?xGQjVB1mk5jlk0L1FXOcw6/oQY3ajtehxidgYNg7J27nkz+Ow++UL8NV1Yu2?= =?us-ascii?Q?CGIJuSDUau4BtVzCs8Ix5y0kIoMrZbGX9r1kdk71DHz+zteNbGRlRotBq+gl?= =?us-ascii?Q?BGFklcdEHv+FlYtsh7ooxGS7f8Mc9N/8IDg8jH0HbTldSwdE1d7xYgaF477y?= =?us-ascii?Q?ewNguMmcZCzyFKHidRTmoeTRwInyiMgUGVjRlz0QgJOg4ucBMGxCemYYEM8x?= =?us-ascii?Q?pfC1JJE809y5/WixCw2u6JnLlbeQoAidp53KIYDvzDsLuLdGmfv+Z7q9wHwU?= =?us-ascii?Q?1+uZR0xNseBIUJP114to5VCaDNgLyWCF81LhvGtRTXwNDIsSuDtbFiGrkR1K?= =?us-ascii?Q?1vxkT9oQ94ieNXD4weBw1mNmx52DOG/AyrItdMsLBLiqg6SBuhJciJCR8yjZ?= =?us-ascii?Q?wUdapt40Mu3fzYetWCwdWSKoNIuOh1plRURruuH/OuxRKcLi62XK1/lyZICU?= =?us-ascii?Q?dIBc093hy+b6AWBb1HF4eD8nO98n6q9zY1Uv6GUZ95oFuho17lOPk5fRELbE?= =?us-ascii?Q?apfwhpBPusgN2QtDQcU3y68sNQeAlvoZpBG8XTeRnpV9DzD6xSqFnuZQ4134?= =?us-ascii?Q?MZiInEam2L6j23sESSVoNZnuZTzxd2PIsT28fNEkoqPgNQnlNWMNAETxF4pY?= =?us-ascii?Q?v35j4cTxYf0gZuuHhMolFNxr2ZIgOW1xBdx6hHa9?= 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: de38ab8d-e34d-4a08-17f3-08da662681f7 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jul 2022 05:54:40.1435 (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: rX1sSLlfv+xj+pWbqMH91eaUX+FEpk4q+r3cxnBZZYOu8E4mbZWExbiql/0m4Ge+VXQaAOakMiJ2/SbZ2EDJvQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1885 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: 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 ; H= e, > Xingguang ; Ling, WeiX ; Wan= g, > YuanX ; Ma, WenwuX ; > stable@dpdk.org > Subject: [PATCH] examples/vhost: fix use after free >=20 > 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. >=20 > Fixes: 1907ce4baec3 ("examples/vhost: fix retry logic on Rx path") > Cc: stable@dpdk.org >=20 > Signed-off-by: Wenwu Ma > --- > examples/vhost/main.c | 19 ++++++++++++------- > 1 file changed, 12 insertions(+), 7 deletions(-) >=20 As discussed in yesterday's release meeting, this issue should have minor i= mpact, so the fix could be moved to next release. Thanks, Chenbo