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 147FCA0093 for ; Thu, 28 May 2020 18:25:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CA6DC1DC2E; Thu, 28 May 2020 18:25:10 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 863EB1DC35 for ; Thu, 28 May 2020 18:25:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590683109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0B9ZsrPDHjX2zytQreAZt0LHKRu0tEljuqveAyAJI+M=; b=bNa+fE3IYBQW05yTl14tC8XEizbmcDVCqZ/K0oMamrsRbc1mhlbevK7i128GjaRokx1ax6 XunJNzNJLBYmkHrBX+1y+qE1ySB1cGUWEdJDuIOtYZ5FTQ1054BpYI59aQ6IT2CVJBs6ix O8AI497oBGqy2d3oF+Ap7uXkdIBEnvg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-196-N-ip9AEdMraJYezJaHeEJQ-1; Thu, 28 May 2020 12:25:04 -0400 X-MC-Unique: N-ip9AEdMraJYezJaHeEJQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 71897EC1A6; Thu, 28 May 2020 16:25:03 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6381460C05; Thu, 28 May 2020 16:25:02 +0000 (UTC) From: Kevin Traynor To: "Wei Hu (Xavier)" Cc: Chengwen Feng , Anatoly Burakov , dpdk stable Date: Thu, 28 May 2020 17:22:22 +0100 Message-Id: <20200528162322.7863-35-ktraynor@redhat.com> In-Reply-To: <20200528162322.7863-1-ktraynor@redhat.com> References: <20200528162322.7863-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'vfio: fix use after free with multiprocess' has been queued to LTS release 18.11.9 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 LTS release 18.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/03/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. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/8163def682be7bf3a26f705f413e38b2bf045015 Thanks. Kevin. --- >From 8163def682be7bf3a26f705f413e38b2bf045015 Mon Sep 17 00:00:00 2001 From: "Wei Hu (Xavier)" Date: Tue, 21 Apr 2020 11:29:57 +0800 Subject: [PATCH] vfio: fix use after free with multiprocess [ upstream commit d6298844da7e3e83034f1af196bdfddf388f979e ] This patch fixes the heap-use-after-free bug which was found by ASAN (Address-Sanitizer) in the vfio_get_default_container_fd function. Fixes: 6bcb7c95fe14 ("vfio: share default container in multi-process") Signed-off-by: Chengwen Feng Signed-off-by: Wei Hu (Xavier) Acked-by: Anatoly Burakov --- lib/librte_eal/linuxapp/eal/eal_vfio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c index 4a995e11b3..b4619c2117 100644 --- a/lib/librte_eal/linuxapp/eal/eal_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c @@ -1026,4 +1026,5 @@ vfio_get_default_container_fd(void) struct timespec ts = {.tv_sec = 5, .tv_nsec = 0}; struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param; + int container_fd; if (default_vfio_cfg->vfio_enabled) @@ -1048,6 +1049,7 @@ vfio_get_default_container_fd(void) p = (struct vfio_mp_param *)mp_rep->param; if (p->result == SOCKET_OK && mp_rep->num_fds == 1) { + container_fd = mp_rep->fds[0]; free(mp_reply.msgs); - return mp_rep->fds[0]; + return container_fd; } } -- 2.21.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-28 17:13:00.964607806 +0100 +++ 0035-vfio-fix-use-after-free-with-multiprocess.patch 2020-05-28 17:12:59.096556514 +0100 @@ -1 +1 @@ -From d6298844da7e3e83034f1af196bdfddf388f979e Mon Sep 17 00:00:00 2001 +From 8163def682be7bf3a26f705f413e38b2bf045015 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit d6298844da7e3e83034f1af196bdfddf388f979e ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -16 +17 @@ - lib/librte_eal/linux/eal_vfio.c | 4 +++- + lib/librte_eal/linuxapp/eal/eal_vfio.c | 4 +++- @@ -19,5 +20,5 @@ -diff --git a/lib/librte_eal/linux/eal_vfio.c b/lib/librte_eal/linux/eal_vfio.c -index 1979f6fdd8..d26e1649a5 100644 ---- a/lib/librte_eal/linux/eal_vfio.c -+++ b/lib/librte_eal/linux/eal_vfio.c -@@ -1093,4 +1093,5 @@ vfio_get_default_container_fd(void) +diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c +index 4a995e11b3..b4619c2117 100644 +--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c ++++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c +@@ -1026,4 +1026,5 @@ vfio_get_default_container_fd(void) @@ -29 +30 @@ -@@ -1115,6 +1116,7 @@ vfio_get_default_container_fd(void) +@@ -1048,6 +1049,7 @@ vfio_get_default_container_fd(void)