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 C5749A0527 for ; Mon, 9 Nov 2020 19:43:45 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B642A69C8; Mon, 9 Nov 2020 19:43:44 +0100 (CET) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by dpdk.org (Postfix) with ESMTP id 866E369C8 for ; Mon, 9 Nov 2020 19:43:42 +0100 (CET) Received: by mail-wm1-f49.google.com with SMTP id h62so440150wme.3 for ; Mon, 09 Nov 2020 10:43:42 -0800 (PST) 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=ToojMlomzesWisqRBlvEqwHQT94kvcmXk9ZmY1deZ6M=; b=cqUP3FjFsu3Tj3urpzfv0tfDGhqi2QOagnGA792QV0QAMvXqaxepibll5IjgG+uUxS Oriq7Ji0KYEsT21VkOR75mb6vLvqY0Lr77qx6J0/2U8km7uIaM4n6Thd8qKopBu1Nvn9 APOGdqoaQ5XhyN0EwSus4xjgTrWV10R0tVnU7ERL0T2mRt0nC5dJUVnmxmXpScvnJr0w 3B/BKqUTBAubT1yex2pH7oYC57KX45mv7Uhw4W4hAamN/9R7ruqXWtLjmjgTQHlExW7z GZosT7ntLuWzZBR+//ynGLtxK1ee3y+lCu+x0m8ilMQVC7PtRjzWFdFM+wYYkv8qsiul Z3+w== 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=ToojMlomzesWisqRBlvEqwHQT94kvcmXk9ZmY1deZ6M=; b=mA7ANyPvVqh/M6S4G3UcF2eY4SV49VaRzLWlaIltiJuLkro4K3tYAJvelGQyP6Vp0p Un2cyFlKlCe9OOr95M0FTLBVPWjsOhmR9Ia8kaWy8zTVum/PU317KeOtAVprMZpMCxp1 SEbsgIa2vfYHL7LDH6CoigRKsURfbk9m+1hUjV6wvef+HiSettSMcd43FO1fdqNGdKAK sPV0UXBKOE60vgTiq/b13e5MVvJk1k+XQT/h0eufJlucGo+RAVj16lcjQLNwL3q15nd3 Q4pBSGGRmp9G7rYYjdpHlXZADfCZY+uXmMik4RD2+SHtBo6SjublJ1xCZhKdUnFk0oyn mJ6g== X-Gm-Message-State: AOAM531Sfx+ZYPpuZxkLEgnv1erEvcj69ZtK6pQg0TcUa3d2U+MOF2sY uv5NjxpmyFfTVbXWjH66SKA= X-Google-Smtp-Source: ABdhPJwajp7fJkb8QtXwoo98iBfMHGhxY+Wv38oO6VB0Jayg4YXVIb1ceIPFjJWt0ADlBL94xB8yww== X-Received: by 2002:a7b:c4c3:: with SMTP id g3mr534113wmk.65.1604947421314; Mon, 09 Nov 2020 10:43:41 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id b8sm7834605wrv.57.2020.11.09.10.43.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 10:43:40 -0800 (PST) From: luca.boccassi@gmail.com To: Maxime Coquelin Cc: Chenbo Xia , dpdk stable Date: Mon, 9 Nov 2020 18:40:31 +0000 Message-Id: <20201109184111.3463090-43-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201109184111.3463090-1-luca.boccassi@gmail.com> References: <20201028104606.3504127-207-luca.boccassi@gmail.com> <20201109184111.3463090-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'vhost: validate index in live-migration API' has been queued to stable release 19.11.6 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.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/11/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/215263f3e48e81ea5af88c615fb4f57c4bce5968 Thanks. Luca Boccassi --- >From 215263f3e48e81ea5af88c615fb4f57c4bce5968 Mon Sep 17 00:00:00 2001 From: Maxime Coquelin Date: Mon, 19 Oct 2020 19:34:12 +0200 Subject: [PATCH] vhost: validate index in live-migration API [ upstream commit 943daec05c596c03471e3f9432b104eaaa2edf0f ] This patch validates the queue index parameter, in order to ensure no out-of-bound accesses happen. Fixes: bd2e0c3fe5ac ("vhost: add APIs for live migration") Signed-off-by: Maxime Coquelin Reviewed-by: Chenbo Xia --- lib/librte_vhost/vhost.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index 2d23de598e..2e3dd0e0cf 100644 --- a/lib/librte_vhost/vhost.c +++ b/lib/librte_vhost/vhost.c @@ -1449,6 +1449,9 @@ int rte_vhost_get_vring_base(int vid, uint16_t queue_id, if (dev == NULL || last_avail_idx == NULL || last_used_idx == NULL) return -1; + if (queue_id >= VHOST_MAX_VRING) + return -1; + vq = dev->virtqueue[queue_id]; if (!vq) return -1; @@ -1475,6 +1478,9 @@ int rte_vhost_set_vring_base(int vid, uint16_t queue_id, if (!dev) return -1; + if (queue_id >= VHOST_MAX_VRING) + return -1; + vq = dev->virtqueue[queue_id]; if (!vq) return -1; -- 2.27.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-11-09 18:40:12.877292392 +0000 +++ 0043-vhost-validate-index-in-live-migration-API.patch 2020-11-09 18:40:11.167311842 +0000 @@ -1 +1 @@ -From 943daec05c596c03471e3f9432b104eaaa2edf0f Mon Sep 17 00:00:00 2001 +From 215263f3e48e81ea5af88c615fb4f57c4bce5968 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 943daec05c596c03471e3f9432b104eaaa2edf0f ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -19 +20 @@ -index 801a1a5098..b9afe46ca2 100644 +index 2d23de598e..2e3dd0e0cf 100644 @@ -22 +23 @@ -@@ -1467,6 +1467,9 @@ int rte_vhost_get_vring_base(int vid, uint16_t queue_id, +@@ -1449,6 +1449,9 @@ int rte_vhost_get_vring_base(int vid, uint16_t queue_id, @@ -32 +33 @@ -@@ -1493,6 +1496,9 @@ int rte_vhost_set_vring_base(int vid, uint16_t queue_id, +@@ -1475,6 +1478,9 @@ int rte_vhost_set_vring_base(int vid, uint16_t queue_id,