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 6CCCFA034F for ; Wed, 10 Nov 2021 07:52:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 59181410E0; Wed, 10 Nov 2021 07:52:48 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2058.outbound.protection.outlook.com [40.107.244.58]) by mails.dpdk.org (Postfix) with ESMTP id B48EE40142 for ; Wed, 10 Nov 2021 07:52:46 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JgRBAn9cc54yrX7iOWNL5UWRIuoIzLJ9w6J7xElPwd6ABT1rmsbseJ8syDyVn0HKJ3vkO1jXTGJpyvCipqnltd39DJIOvrQtykPAP4D8wKp365iyQn7LI1eLDYHmiZIcRusxv7rLexevbLVQ7tuY2S+q9xhgrhP9f8HLab/Ysm+stMpeui6NvexsceTI74nmCYa3Y/hXKlQv3cKqD4QmloRjGHiFvpgOWz2bBKnqEUzJ19V18syIdz0v63tQpKBvkzTVMSPbj9tpsSTScGsMiBTB/lUUjVLHdzUwaDjZcYOuFlD78I4Lu4Eq2AAECpGkiiy8OMHSa7Weq7pnOK3QSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=S3sHK+J20nrIyBNukys890nz9Nl4VELJyT3UY9Ll/iQ=; b=oUwgWMDP/s/J1ITa7vrJ4leUrv/HpooVmilRsWT81aB+irUXU0FlUOfO88sOG/cLK4GPHutKPdeyXATaaTLxQ01diB099bb4mYH6S1UHGSQWzTwkp8BHZJFs9TfPW27XCiWWyfpMHAUdywS8JWB0FEkjtwSXSgV5TsliofAbBJLfAGNqZL69M4Iqd7FdoQZ0XKmSX3Ohp1Rz+e/VVFNS1NXNCIWStJx3Q9DW18bdvAv2pCoxdLjrl4+lF5yqT4N91LaKx1kUMO+aakATWg6DZ9nnfDiKBCn+uie/Bzgv4ZH2QNsEdLcN7chzP6dPpL+YhFVr83O0tZx9eiBvl4miNw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S3sHK+J20nrIyBNukys890nz9Nl4VELJyT3UY9Ll/iQ=; b=M9Uzn3K/Lt5ytaOAOrxTbYREIvS43FDRJtsZ2qyH8Xfr3Ccahp9b4NH51gVtO/F7Yiy0PXYIXgZaJ8IstmjeasCfxGz17ZPIJ+tP/mo8b4pbDg0Z5aYnuyBCL6Ja61pKi5Ojm4+QdxZVl0mAPaENYRgztsRBnUcJIcd2icJspP3hiJH9yPgRH0mzluOcteRRIskCX+yiJyk8lpWz/yd0d+aoko+MhGIXYYmC+VJArrMdZPrXydYq/ouAnZ9CyyBCutixd7MT6ee4WbRfURX9iPfKRNgfFND6LQm2qAxMpsKLTuB5dPFb35d03Y2HMTWEOkzeCFIovlZmFDZpwYH+ow== Received: from BN9PR03CA0808.namprd03.prod.outlook.com (2603:10b6:408:13f::33) by BL1PR12MB5191.namprd12.prod.outlook.com (2603:10b6:208:318::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.16; Wed, 10 Nov 2021 06:52:45 +0000 Received: from BN8NAM11FT016.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13f:cafe::30) by BN9PR03CA0808.outlook.office365.com (2603:10b6:408:13f::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13 via Frontend Transport; Wed, 10 Nov 2021 06:52:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT016.mail.protection.outlook.com (10.13.176.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:52:43 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:52:40 +0000 From: Xueming Li To: Li Feng CC: Luca Boccassi , Maxime Coquelin , dpdk stable Date: Wed, 10 Nov 2021 14:31:04 +0800 Message-ID: <20211110063216.2744012-181-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 99e9184a-0f43-4afe-25b0-08d9a416b2e3 X-MS-TrafficTypeDiagnostic: BL1PR12MB5191: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yYkaKWLX8aAYOCrnXd20xjyr1L+OWviqOgWorgqbG0J6yXrhKQ9CxvxUEnn4xUIwQNhvQun3JElNk32gDoFtQL+/Am9vS2Jx5w1Dz0h2KiOENBRSL/ep/URdI8X0KHOdYosScKi/HwVevTEwQvIwg22bjzlkmFthaBTh1UzZ+ivQxwPs/8ON2ahEgznozywLEIeEGc3AY9WZWIIDkknjlxjRw98F71OnwDpCQhbg5RXF9m0/Qp1BhEKGMt1pyfSolVwvM+rclOuv1ZPuJYemRFSfAPDFlgN8vPNvvHk5GLqFKilqJeGZAyAh7BMyynd8UG1KUgFdmvk7HuOlutyCJ42HQ0+bDOf44Jr/DzET5DEv4cwc83Xa1HnzZZDmlHmrNTqkbrABOC98YlGc2noslo5AujK4ufqG6BDD5gr+yIodfIOLC+F8d19SZ7GpW0ZhIHgPTw48mzoVMMSnbS+/36HGlelxQZnS1IWCEeRuA0syBfjrilFvdgB90PNoYm3047g40frRdo8CxyGW3D2nQ9ljPA2/a+GJ30mrGKjKayp5jKIrj/txELeCXGNmsR5YkUENtjdzD3Dyhp3ZPf8UGLg7QcF6i1vsVsWo+2gP+O0qSzXPSitmF43SCeh0z/PsSesTgn87Kr7lTv7pJA9lZTi+oP6gIFYk3xBpEYFqcc+u0yTJJ/tC0gkYs77+cIkgF3+EU64rkEzDIhDOL4SPt8JS4qaS1gWikXFS/+I7V2UZDxOQYSZpBuehfdVvlIFK/hPkqxEHz+RK0LdxLdAJW/Grw8Zjfuqv/sGGC5rBF0A1LcLsfO/OjuOD/5V/zyva6gEMzjXMw1HYYB74pGPSbA== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(36860700001)(1076003)(8676002)(186003)(47076005)(336012)(508600001)(6916009)(4326008)(16526019)(7636003)(2616005)(7696005)(36756003)(82310400003)(356005)(8936002)(70586007)(4001150100001)(2906002)(6286002)(966005)(54906003)(70206006)(86362001)(55016002)(26005)(36906005)(316002)(6666004)(426003)(5660300002)(53546011); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:52:43.8347 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 99e9184a-0f43-4afe-25b0-08d9a416b2e3 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT016.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5191 Subject: [dpdk-stable] patch 'vhost: add sanity check on inflight last index' has been queued to stable release 20.11.4 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 20.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 11/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/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/022ab64a482d3e7a8627446d4acd52cfd084dd7d Thanks. Xueming Li --- >From 022ab64a482d3e7a8627446d4acd52cfd084dd7d Mon Sep 17 00:00:00 2001 From: Li Feng Date: Thu, 14 Oct 2021 20:40:08 +0800 Subject: [PATCH] vhost: add sanity check on inflight last index Cc: Xueming Li [ upstream commit 5a4fbe79e6d124141bd0a820c897287b15c559c4 ] The index in rte_vhost_set_last_inflight_io_split is from the frontend driver, check if it's in the virtqueue range. Fixes: bb0c2de9602b ("vhost: add APIs to operate inflight ring") Signed-off-by: Li Feng Reviewed-by: Maxime Coquelin --- lib/librte_vhost/vhost.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index b97dcf6b69..1a7c240492 100644 --- a/lib/librte_vhost/vhost.c +++ b/lib/librte_vhost/vhost.c @@ -1191,6 +1191,9 @@ rte_vhost_set_last_inflight_io_split(int vid, uint16_t vring_idx, if (unlikely(!vq->inflight_split)) return -1; + if (unlikely(idx >= vq->size)) + return -1; + vq->inflight_split->last_inflight_io = idx; return 0; } -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:09.922847297 +0800 +++ 0180-vhost-add-sanity-check-on-inflight-last-index.patch 2021-11-10 14:17:01.990745109 +0800 @@ -1 +1 @@ -From 5a4fbe79e6d124141bd0a820c897287b15c559c4 Mon Sep 17 00:00:00 2001 +From 022ab64a482d3e7a8627446d4acd52cfd084dd7d Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 5a4fbe79e6d124141bd0a820c897287b15c559c4 ] @@ -10 +12,0 @@ -Cc: stable@dpdk.org @@ -15 +17 @@ - lib/vhost/vhost.c | 3 +++ + lib/librte_vhost/vhost.c | 3 +++ @@ -18,5 +20,5 @@ -diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c -index 9540522dac..3b674ac320 100644 ---- a/lib/vhost/vhost.c -+++ b/lib/vhost/vhost.c -@@ -1226,6 +1226,9 @@ rte_vhost_set_last_inflight_io_split(int vid, uint16_t vring_idx, +diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c +index b97dcf6b69..1a7c240492 100644 +--- a/lib/librte_vhost/vhost.c ++++ b/lib/librte_vhost/vhost.c +@@ -1191,6 +1191,9 @@ rte_vhost_set_last_inflight_io_split(int vid, uint16_t vring_idx,