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 1D67AA0C47 for ; Tue, 10 Aug 2021 17:45:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 13DF54014F; Tue, 10 Aug 2021 17:45:15 +0200 (CEST) Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) by mails.dpdk.org (Postfix) with ESMTP id E09A74114F for ; Tue, 10 Aug 2021 17:45:13 +0200 (CEST) Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPS id C9CEC3F107 for ; Tue, 10 Aug 2021 15:45:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1628610313; bh=UOLhg7JMlBzbh/jC/PiNZ5di3Tne1f3eyugb4VKHBkI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=c0lfANRb1YF71kEkyBWaPReZanRJE49PMno4S9jSBMlXab7nBX2HVUbbfwxd4eK/z KEkSgfmooCRaOIwDSlYUjUoKF2LRM2p6KrCzwftiQZB93vzF48nGsTmMOPC9wUHVyt 4aASnRoiDiMZhIPa5PXkLnZtN+FqsTs3pAY8effIQHWySoxgm9fdV8hp9r01d1sTP/ C1G7t/PPkX2io0LNfXVWd3rTTxjGy6nAMY+07mETwWcVe/zmWvB1cErkIXPBWnvR28 RrFXRuZ28PIoPzjYsUaiZabgrLlaDMo+45uY3BEbu45khkDDkiftvQE8NQnuJpJcLd m++1v8qwUfABw== Received: by mail-ej1-f72.google.com with SMTP id v3-20020a1709063383b02905b4d1d1e27cso1124444eja.19 for ; Tue, 10 Aug 2021 08:45:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UOLhg7JMlBzbh/jC/PiNZ5di3Tne1f3eyugb4VKHBkI=; b=CDNd2ZHSG1E9XXAMaaOFnHAPML+uxHhJMWV7Ol6p+ywjcNBVPviOxl3RDbaj7PN6di LXjffvByDYOh0aKcIzoOBGjBxA/5oJspf8BnqQl6fiDgDzKHWr5WC31PGjt613yQ7e6H MfG48tR3fWPT3PaJcsrIvG3UN8stjywJ6rv3fjDO3Xm+HrChUTbAzx4MHBF1VBsnPC00 CedcTVDiHG1EZD7fFIgJNS26q+eFGTan8gH20+YpF9L9AespdqDm1WuD2L/EatxIxju/ rzRhP9WHW+lA38hEhGVUdjU+i8B0GEU5W9TWiZHV2tEMrHrgHE+NN9UeEJaxa+FXGl9C xzGw== X-Gm-Message-State: AOAM532nSwZYwg5urnJs37QuuSjd82LErsUHFun6XJXGafraAHNTuy2F 4CWlVMnIP0T2wH9cRgyPzfS8nGfJ5ActMetsuKxZgBGvVwKvu14DxP1MJk+z5/LWRIe7VBMSA2G 5QivZDb19jvb7EGtuATmpQfv1 X-Received: by 2002:a17:906:95ce:: with SMTP id n14mr26764375ejy.130.1628610313518; Tue, 10 Aug 2021 08:45:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCd66zHL+0VWC+9hP9yOFWTlHIIf+xt39Tg5zCqXzEduMKizvm8BIGCr/s5Fxb24JTpHQ7Aw== X-Received: by 2002:a17:906:95ce:: with SMTP id n14mr26764352ejy.130.1628610313299; Tue, 10 Aug 2021 08:45:13 -0700 (PDT) Received: from Keschdeichel.fritz.box ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id cb4sm7008642ejb.72.2021.08.10.08.45.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 08:45:12 -0700 (PDT) From: christian.ehrhardt@canonical.com To: Maxime Coquelin Cc: Yinan Wang , Chenbo Xia , dpdk stable Date: Tue, 10 Aug 2021 17:40:13 +0200 Message-Id: <20210810154022.749358-93-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810154022.749358-1-christian.ehrhardt@canonical.com> References: <20210810154022.749358-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'vhost: fix crash on reconnect' has been queued to stable release 19.11.10 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" Hi, FYI, your patch has been queued to stable release 19.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/12/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/96dcc5fe48b32721b1d5e883dace6977a4052f94 Thanks. Christian Ehrhardt --- >From 96dcc5fe48b32721b1d5e883dace6977a4052f94 Mon Sep 17 00:00:00 2001 From: Maxime Coquelin Date: Mon, 26 Jul 2021 09:58:14 +0200 Subject: [PATCH] vhost: fix crash on reconnect [ upstream commit 3c929a0bb3e7addc5103227bff126b8b9dd952ef ] When the vhost-user frontend like Virtio-user tries to reconnect to the restarted Vhost backend, the Vhost backend segfaults when multiqueue is enabled. 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. This patch adds the VHOST_USER_GET_VRING_BASE requests to the list of requests that trigger queue pair allocations. Fixes: 160cbc815b41 ("vhost: remove a hack on queue allocation") Reported-by: Yinan Wang Signed-off-by: Maxime Coquelin Tested-by: Yinan Wang Reviewed-by: Chenbo Xia --- lib/librte_vhost/vhost_user.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index c016114e75..b1c0bef7b6 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -2606,6 +2606,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 = msg->payload.state.index; break; -- 2.32.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-08-10 15:11:16.599562799 +0200 +++ 0093-vhost-fix-crash-on-reconnect.patch 2021-08-10 15:11:13.126638878 +0200 @@ -1 +1 @@ -From 3c929a0bb3e7addc5103227bff126b8b9dd952ef Mon Sep 17 00:00:00 2001 +From 96dcc5fe48b32721b1d5e883dace6977a4052f94 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 3c929a0bb3e7addc5103227bff126b8b9dd952ef ] + @@ -18 +19,0 @@ -Cc: stable@dpdk.org @@ -25 +26 @@ - lib/vhost/vhost_user.c | 1 + + lib/librte_vhost/vhost_user.c | 1 + @@ -28,5 +29,5 @@ -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, +diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c +index c016114e75..b1c0bef7b6 100644 +--- a/lib/librte_vhost/vhost_user.c ++++ b/lib/librte_vhost/vhost_user.c +@@ -2606,6 +2606,7 @@ vhost_user_check_and_alloc_queue_pair(struct virtio_net *dev,