From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C8B67A0518 for ; Fri, 24 Jul 2020 14:11:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C1F5C1C232; Fri, 24 Jul 2020 14:11:50 +0200 (CEST) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id EE0DC1C2B2 for ; Fri, 24 Jul 2020 14:11:48 +0200 (CEST) Received: by mail-wr1-f66.google.com with SMTP id q5so8097436wru.6 for ; Fri, 24 Jul 2020 05:11:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WjLG7T+HEADwKI86uwInfDOWf/5YXTllyFTnPBRObOE=; b=bt7EwHsLbL6Lcw0cqCjor/XKSoYRm6DvhVO0HzF2sye+Vf6lj49nIO1oahgzj5NaMb Ujcrz88OdSBAkzLdM5Ip+BZEInFOSe0PnS4GyTSIKG51NR14crG9TD2uWmKsjgPOOpnE uLb4Blv3ME2TWDaqF5SRnrNfPf7sZW9Z70/GB/7IQfGjYcLQuU9kjXG36AYZqISor0hi Pf52GdeB8n7nvFkMV27yr7ANzL8H0R2T7QlvAFlcOBuUj8R8tsHF1IyFBh0gxwwIbpyQ 0riRsc9YhfPur4gM9/NM/nwuziT1cunvMK6Bz2cijdrlt4nLLsWXMxiHLdRdfu+TWJUY X0oA== 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=WjLG7T+HEADwKI86uwInfDOWf/5YXTllyFTnPBRObOE=; b=ALOai7DXQrXrJeEJ15GQuD7q4xYp/zC7SXmHMl9hGlRdueQZM9Jhj8hUaPJ497TYgk AP8dF5ELw2vqOhsJaAuwhy9ch/ji7RsSf+s/kveTwunV8v4JyAPH/VTBU7JZOrKupmY+ FXLJ0nCMWygG2AK8cIojnXviPS3HlUkhs6PvdGZeYwcGUsO6FpIF6oM5GFkgeZEl6ekB CjigTYU2h5JVhVLfLWmFy2xY7OT8/7fdLsGvzbSrwQhj73O70khtZJhKN3PLPviKRXHt 8UcIbToWVk10UI7ImmCzJ4NDDJAV1vj+CAYUK2fOyJ6G+57dVZ9nALyCviehZPJsIoJ8 T6+g== X-Gm-Message-State: AOAM5308IBd2i7yJGosaglJj7Y/tVxl73n79v5IZrhm2GlEwWffx54lx vykEmDTXR2GVSF5JCzLNpKA= X-Google-Smtp-Source: ABdhPJyqTs11h0lKV9cq12oQGQDIsK0lz7qtujYhwME2eE+lUoXqAn95gMOMCSMyqNrdajEJhW4R+w== X-Received: by 2002:a5d:42c2:: with SMTP id t2mr8338092wrr.396.1595592708737; Fri, 24 Jul 2020 05:11:48 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id p29sm7213078wmi.43.2020.07.24.05.11.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 05:11:47 -0700 (PDT) From: luca.boccassi@gmail.com To: Patrick Fu Cc: Maxime Coquelin , dpdk stable Date: Fri, 24 Jul 2020 13:00:13 +0100 Message-Id: <20200724120030.1863487-175-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724120030.1863487-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'vhost: fix double-free with zero-copy' has been queued to stable release 19.11.4 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/26/20. 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. Thanks. Luca Boccassi --- >From 4b85b20128a39c5c3b763bbd509f83eba5b0af1d Mon Sep 17 00:00:00 2001 From: Patrick Fu Date: Tue, 21 Jul 2020 12:10:57 +0000 Subject: [PATCH] vhost: fix double-free with zero-copy [ upstream commit a608436b635460c1be0d0d561838aa197cf32c87 ] zmbufs should be set to NULL when getting freed to avoid double free on the same buffer pointer Fixes: b0a985d1f340 ("vhost: add dequeue zero copy") Signed-off-by: Patrick Fu Reviewed-by: Maxime Coquelin --- 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 82270c514..4cc0ce21e 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -1872,6 +1872,7 @@ free_zmbufs(struct vhost_virtqueue *vq) drain_zmbuf_list(vq); rte_free(vq->zmbufs); + vq->zmbufs = NULL; } /* -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-07-24 12:53:55.317593757 +0100 +++ 0175-vhost-fix-double-free-with-zero-copy.patch 2020-07-24 12:53:48.599012273 +0100 @@ -1,13 +1,14 @@ -From a608436b635460c1be0d0d561838aa197cf32c87 Mon Sep 17 00:00:00 2001 +From 4b85b20128a39c5c3b763bbd509f83eba5b0af1d Mon Sep 17 00:00:00 2001 From: Patrick Fu Date: Tue, 21 Jul 2020 12:10:57 +0000 Subject: [PATCH] vhost: fix double-free with zero-copy +[ upstream commit a608436b635460c1be0d0d561838aa197cf32c87 ] + zmbufs should be set to NULL when getting freed to avoid double free on the same buffer pointer Fixes: b0a985d1f340 ("vhost: add dequeue zero copy") -Cc: stable@dpdk.org Signed-off-by: Patrick Fu Reviewed-by: Maxime Coquelin @@ -16,10 +17,10 @@ 1 file changed, 1 insertion(+) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c -index df0db8a07..9ddeae362 100644 +index 82270c514..4cc0ce21e 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c -@@ -1934,6 +1934,7 @@ free_zmbufs(struct vhost_virtqueue *vq) +@@ -1872,6 +1872,7 @@ free_zmbufs(struct vhost_virtqueue *vq) drain_zmbuf_list(vq); rte_free(vq->zmbufs);