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 740D3A0C4B for ; Mon, 26 Jul 2021 10:13:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 642B4410EC; Mon, 26 Jul 2021 10:13:33 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id ED97340DDA; Mon, 26 Jul 2021 10:13:29 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10056"; a="212226022" X-IronPort-AV: E=Sophos;i="5.84,270,1620716400"; d="scan'208";a="212226022" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2021 01:13:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,270,1620716400"; d="scan'208";a="473602508" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga008.fm.intel.com with ESMTP; 26 Jul 2021 01:13:23 -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.2242.10; Mon, 26 Jul 2021 01:13:23 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) 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.2242.10; Mon, 26 Jul 2021 01:13:22 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Mon, 26 Jul 2021 01:13:22 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.177) 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.2242.10; Mon, 26 Jul 2021 01:13:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gwKPf4TUdUyIIcAIkYFGtTeVCFW5h4wTmA2hHyr/8wRoXkr4QT1GA9xPiXgTe0KJ5lmAo2bR/AKGM1+M4RusjIyA1Kdi06AHw2m6B3rehY9DLHnIgbx5BzYonMFle/yuqOys04wL1E4g7GH3Pz/GzaQPDYhMPJIOH4/epqCtP0TnOokf0/UZ1nOy2jD+o6Ijm6qogEx9K7lrv343NhZKfpJz0pHewErbpBCK2/N2i9rJZYdeRRNTJTaT0HMOOSCqIBsYsD5eZKDgGQ4Qd+1uTpqwJzjbLgCDZYms+piaV8cRJfWmmD9nQexzSRdKajRhZ9IoXlEZTK/5i8bdxmGqSg== 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-SenderADCheck; bh=+G6IwzmkYBr27dBDzjehlFJrvTExhgkU7budtPcGg28=; b=Db/hkoKFEqnxpqFiczQet314YLfoR1cyHDjAZhnkY4naqsXQsIRorNUs4tJbNswzDvXrzkXVNoloTo3VKWJU5XWaYFPPohNSbu0MzfS1uV0XCK30r/AJIrAyV6RvFpiKk8tVPYRxV/kahIeTpJCCzc95wiPPiSvOc7rd3l4XXVCa/oNtWYHVgoSfGknpnexwmpoGEsvMWIv4GcJQXYM9bEU8BnuYpuxWw/lEUQ3XNfPS4cyXg8E2PXKWeGaJ3RhdZy5AW8G+E3LNfRXtxspnerjWVKPCEbP3JHPRxebr2LzAXnjZEwLH8o8HddZ0eAScRTjYKjCR8xB+mVBqfrHZhQ== 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=+G6IwzmkYBr27dBDzjehlFJrvTExhgkU7budtPcGg28=; b=ie6sXZevU3r4z9ckbHRbXcgcvtKTc1veqth+FRwiu11+23YTotYXlWepuvXToOarAakduvcNWPerLFJZ7s5CcfMFnnPrJHlr5lHxiEyWtfkk40wxrUt5xdZcxHcqY7no5/Wd4k/EzAawHB5xjWFdc28OkYxXIZOuC4dFtUEz6IU= Received: from BYAPR11MB2648.namprd11.prod.outlook.com (2603:10b6:a02:c7::10) by BY5PR11MB4451.namprd11.prod.outlook.com (2603:10b6:a03:1cb::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.29; Mon, 26 Jul 2021 08:13:17 +0000 Received: from BYAPR11MB2648.namprd11.prod.outlook.com ([fe80::f8e4:c512:756d:b265]) by BYAPR11MB2648.namprd11.prod.outlook.com ([fe80::f8e4:c512:756d:b265%7]) with mapi id 15.20.4352.031; Mon, 26 Jul 2021 08:13:17 +0000 From: "Wang, Yinan" To: Maxime Coquelin , "dev@dpdk.org" , "Xia, Chenbo" , "Ling, WeiX" CC: "stable@dpdk.org" Thread-Topic: [PATCH] vhost: fix crash on reconnect Thread-Index: AQHXgfQIpYUolSEofEK04e5oX1WaRatU6CwA Date: Mon, 26 Jul 2021 08:13:17 +0000 Message-ID: References: <20210726075814.287469-1-maxime.coquelin@redhat.com> In-Reply-To: <20210726075814.287469-1-maxime.coquelin@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0b995cc4-8da1-4599-05b2-08d9500d3903 x-ms-traffictypediagnostic: BY5PR11MB4451: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4502; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jthW5Esc8O6KHUt5kzmQM1ufZVsh3fQiVpz2pdMtTCU26XK6wtIX3cPtQuXB6MicENhUHaVYQCUDi7HUmio3inF/54fnXsmU2Xl3LHsD8rVCLAlsIJVkev6u6pJYIGmDfEjjnh+fEUGiMSOLsKMqA7LwZ9SlrGislhy6jihA2gaTRiXcUYgN2EkGBVKouSyOGuf2Mgz3wf73ygnVLB03ETGwkDbvC89AiZz53W+yq3KVwHXwOUX8oYu5PVSC+xePwQ0kYzaToo49CsKSp5EhODmAY0GeE9RI6M8jFDVHAhRUGENISm0LFuGy0RWXdlcwVNDAi6qFxk0KBLJBMsc3P/dTC9C39f7aTy8WxKAho6ABscErzu0vPrnHTa8514tvXYpbN9k0wsqQsfwO6+eEzzXwDqsN4Z4lrfWvpW9IrEk3ndS7o7PScI3frIOLGwA3Os1hN4qixh3qTuHuXlv3gRSi5fI10ApsN21SnpwQczsLWW/vR21LNrR1hjDivpnfKWYc0GNjr+aRq4ErdAHJ4yYMoiuONpbTDyohwZE1P6YyKODEiddONdWVkcV6oqsXR3mahqJyg+0rBcCfm63K8oU/DGnQHrM7qREyYzbwZ7CMLG3T6ULNpmiGP2yDJK5Mf2LVvQ+tPofH6aJPk44r+cHD/GsjDxSJ4H7x47Ecfwe9HTwbWsY4qTu4ZSjMLOkTnpCJM9ezXgqYfxcs3Zc/hw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB2648.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(136003)(346002)(366004)(39860400002)(6636002)(66446008)(55016002)(6506007)(4326008)(64756008)(478600001)(9686003)(53546011)(8936002)(8676002)(86362001)(66556008)(7696005)(316002)(83380400001)(110136005)(66476007)(71200400001)(66946007)(122000001)(76116006)(38100700002)(26005)(2906002)(33656002)(52536014)(186003)(5660300002)(38070700004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?OEtnX/0XPerR/jaTGjI2T9hCPXwwPFQtsYTRMjEdXRA4gyChB5ZoLVix?= =?Windows-1252?Q?srpBNbtKj04tlUdyIZM3ZDCqnjSBZ8/RwHThcN1OeHInPa1e0Pi+Lwzz?= =?Windows-1252?Q?L7u9/yXUs9mBb296W7FgzEaVPFCzRVGUulPiOwQypuOlJfbm01tGrZYe?= =?Windows-1252?Q?2MR0UmHE1j3jSyB+BhkNbUH1bDWODZI8uMw2esyV1u+ljDggS56JoAII?= =?Windows-1252?Q?gd61y93M/1nFX3LmAp12Fnf9Ardo42nZl7VYNFCAVXjo/Kc612Z1u404?= =?Windows-1252?Q?5sAxQqurJbmkQGrc5MGIvumidgc9OhEwva3IcNvufejQNnKnwUSgHSmD?= =?Windows-1252?Q?swxVemy/ORJpgF8lEVnzIwSMsS+mkloBKMbWQRkrZsNJb90N55BPXtMX?= =?Windows-1252?Q?v0WOFF3qlE+Xpz+wn6Oupsnnw7Bn2FewqxqfXFAl1k43NtEpO/c+XI1c?= =?Windows-1252?Q?64zCStAw2oB86uRZVmYdY43NOZYn3HzuWZtGVSsNoNXo4RY2plNZAiIN?= =?Windows-1252?Q?4y5dyHup/HF5vj3c8g+JvRvrL0YfSQwjz0IeEf5/7Zl0/wC2YikR3gDV?= =?Windows-1252?Q?E4Rhc6MY6wFdVpNttLZeAOUTSSE4RGJKjpy+kYgjALQlalnW4OAOjMel?= =?Windows-1252?Q?wtyR353gMEewhA+HvRTyA7cIYs0R3olrs83kYegg0PF62BbuGzajnZ0U?= =?Windows-1252?Q?HdfVwEricOGMHECaaO++3hDdnN0n3qgeZnJwLR1hz7dVYKOsA7k4iX96?= =?Windows-1252?Q?fllmiRpY0dl6sS0rbPhwaVpVImllmasx4WyJQx7YbuKtRzc827uE7m44?= =?Windows-1252?Q?73Oc2svy9C7rwJgjo6PnuXCyHUURJ6NB62iFLG15bVrFJnlIveQ8iiND?= =?Windows-1252?Q?5OGyzjjw4Z4s+t53yIW1mKN0e61ICsavos+8wSIxrnFCgMf2woPn+GkQ?= =?Windows-1252?Q?sCwj2nuHYBJy7AL6Hyml4ShEMgOqpyjW/h6FP5Mval5bn6rROoUT1itI?= =?Windows-1252?Q?gFxPm3+eEINNVBjyByAjRREUFnwpHLOodKKoTbe5UA18IT12awg3tnON?= =?Windows-1252?Q?cHyWL2H/G6tXs1JAYsRX57T6Q6RmMUWJqzKNwES65C/UMXH3cfp1WSMH?= =?Windows-1252?Q?f/1C4iAlz7Mc56/Cl1gCqy6XpXVugRQ1UVXZCqcB4H5JAkYI6wQ3Av4u?= =?Windows-1252?Q?VsWoIuXq9Q6xHpb8zBh5HaHWMo5p/CPCp+V5gXT3KVI//b42n8l8LgZO?= =?Windows-1252?Q?OAsnq3xTQlpfdQCDFzr1SQ0eQIerVmTwxN4xP3bbNaygDun0ZD4aXJun?= =?Windows-1252?Q?9i/oVW4Ps7H0oyTHXmazPYIPQ+fmowg/yhDGsG8B5jCIO4hhMlY0BFS1?= =?Windows-1252?Q?Hh3q+2Gr3/yY5K3jOqEzZCBDIiwHYhRLgXOKZhODQ8fqSvbGzL9/W4qn?= Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB2648.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b995cc4-8da1-4599-05b2-08d9500d3903 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jul 2021 08:13:17.0292 (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: fad/UXRZOfx8XfnR/Mi4+YvHEQbbCV98RbvBbb19QQpb0RgqTPi/cAQpqQO8kk5Zjf4iEBJggT0IqTirjlsrHw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4451 X-OriginatorOrg: intel.com Subject: Re: [dpdk-stable] [PATCH] vhost: fix crash on reconnect 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" Tested-by: Yinan Wang > -----Original Message----- > From: Maxime Coquelin > Sent: 2021?7?26? 15:58 > To: dev@dpdk.org; Xia, Chenbo ; Wang, Yinan > ; Ling, WeiX > Cc: Maxime Coquelin ; stable@dpdk.org > Subject: [PATCH] vhost: fix crash on reconnect >=20 > When the vhost-user frontend like Virtio-user tries to > reconnect to the restarted Vhost backend, the Vhost backend > segfaults when multiqueue is enabled. >=20 > This is caused by VHOST_USER_GET_VRING_BASE being called for > a virtqueue that has not been created before, causing a NULL > pointer dereferencing. >=20 > This patch adds the VHOST_USER_GET_VRING_BASE requests to > the list of requests that trigger queue pair allocations. >=20 > Fixes: 160cbc815b41 ("vhost: remove a hack on queue allocation") > Cc: stable@dpdk.org >=20 > Reported-by: Yinan Wang > Signed-off-by: Maxime Coquelin > --- > lib/vhost/vhost_user.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c > index 433f412fa8..29a4c9af60 100644 > --- a/lib/vhost/vhost_user.c > +++ b/lib/vhost/vhost_user.c > @@ -2796,6 +2796,7 @@ vhost_user_check_and_alloc_queue_pair(struct > virtio_net *dev, > break; > case VHOST_USER_SET_VRING_NUM: > case VHOST_USER_SET_VRING_BASE: > + case VHOST_USER_GET_VRING_BASE: > case VHOST_USER_SET_VRING_ENABLE: > vring_idx =3D msg->payload.state.index; > break; > -- > 2.31.1