Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/126824/?format=api
http://patchwork.dpdk.org/api/patches/126824/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230511145957.33904-1-suntianyuan@baidu.com/", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20230511145957.33904-1-suntianyuan@baidu.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230511145957.33904-1-suntianyuan@baidu.com", "date": "2023-05-11T14:59:57", "name": "[v2] vhost: fix crash on vhost-user client port deletion", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "fdb8e5c0431ac054134550a3976d72472bee1610", "submitter": { "id": 3008, "url": "http://patchwork.dpdk.org/api/people/3008/?format=api", "name": "suntianyuan", "email": "suntianyuan@baidu.com" }, "delegate": { "id": 2642, "url": "http://patchwork.dpdk.org/api/users/2642/?format=api", "username": "mcoquelin", "first_name": "Maxime", "last_name": "Coquelin", "email": "maxime.coquelin@redhat.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230511145957.33904-1-suntianyuan@baidu.com/mbox/", "series": [ { "id": 27979, "url": "http://patchwork.dpdk.org/api/series/27979/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=27979", "date": "2023-05-11T14:59:57", "name": "[v2] vhost: fix crash on vhost-user client port deletion", "version": 2, "mbox": "http://patchwork.dpdk.org/series/27979/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/126824/comments/", "check": "fail", "checks": "http://patchwork.dpdk.org/api/patches/126824/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 952E942AD6;\n\tThu, 11 May 2023 17:00:10 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6F3E842D9C;\n\tThu, 11 May 2023 17:00:10 +0200 (CEST)", "from baidu.com (mx20.baidu.com [111.202.115.85])\n by mails.dpdk.org (Postfix) with ESMTP id 6C504406B6\n for <dev@dpdk.org>; Thu, 11 May 2023 17:00:08 +0200 (CEST)" ], "From": "suntianyuan <suntianyuan@baidu.com>", "To": "<chenbo.xia@intel.com>", "CC": "<dev@dpdk.org>, <maxime.coquelin@redhat.com>, <suntianyuan@baidu.com>", "Subject": "[PATCH v2] vhost: fix crash on vhost-user client port deletion", "Date": "Thu, 11 May 2023 22:59:57 +0800", "Message-ID": "<20230511145957.33904-1-suntianyuan@baidu.com>", "X-Mailer": "git-send-email 2.32.0 (Apple Git-132)", "In-Reply-To": "\n <SN6PR11MB35042FDAA797B9969AE05AF99C749@SN6PR11MB3504.namprd11.prod.outlook.com>", "References": "\n <SN6PR11MB35042FDAA797B9969AE05AF99C749@SN6PR11MB3504.namprd11.prod.outlook.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Originating-IP": "[172.31.62.13]", "X-ClientProxiedBy": "BC-Mail-EX04.internal.baidu.com (172.31.51.44) To\n BJHW-Mail-Ex07.internal.baidu.com (10.127.64.17)", "X-FEAS-Client-IP": "10.127.64.17", "X-FE-Policy-ID": "15:10:21:SYSTEM", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "The rte_vhost_driver_unregister() and vhost_user_read_cb() can be\ncalled at the same time by 2 threads. reconn may be added back to\nreconn_list by vhost_user_read_cb() after rte_vhost_driver_unregister()\nremoved from reconn_list. Then rte_vhost_driver_unregister free vsocket,\ncause vhost_user_client_reconnect access invalid vsocket memory.\n\nTimeline is as below:\nrte_vhost_driver_unregister thread execute vhost_user_remove_reconnect\nvhost_user_read_cb thread execute vhost_user_start_client add reconn to\nreconn_list\nvhost_user_read_cb thread free conn\nrte_vhost_driver_unregister thread cannot find conn, then execute\nvhost_user_socket_mem_free\nvhost_user_client_reconnect access invalid mem, crash\n\nSigned-off-by: suntianyuan <suntianyuan@baidu.com>\n---\nv2:\n* Fixed coding style issues.\n\n lib/vhost/socket.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)", "diff": "diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c\nindex 669c322e12..72c776d15c 100644\n--- a/lib/vhost/socket.c\n+++ b/lib/vhost/socket.c\n@@ -1046,8 +1046,6 @@ rte_vhost_driver_unregister(const char *path)\n \t\t\t\tpthread_mutex_unlock(&vhost_user.mutex);\n \t\t\t\tgoto again;\n \t\t\t}\n-\t\t} else if (vsocket->reconnect) {\n-\t\t\tvhost_user_remove_reconnect(vsocket);\n \t\t}\n \n \t\tpthread_mutex_lock(&vsocket->conn_mutex);\n@@ -1080,6 +1078,8 @@ rte_vhost_driver_unregister(const char *path)\n \t\tif (vsocket->is_server) {\n \t\t\tclose(vsocket->socket_fd);\n \t\t\tunlink(path);\n+\t\t} else if (vsocket->reconnect) {\n+\t\t\tvhost_user_remove_reconnect(vsocket);\n \t\t}\n \n \t\tpthread_mutex_destroy(&vsocket->conn_mutex);\n", "prefixes": [ "v2" ] }{ "id": 126824, "url": "