From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f65.google.com (mail-pg0-f65.google.com [74.125.83.65]) by dpdk.org (Postfix) with ESMTP id ED26B2C8 for ; Tue, 20 Jun 2017 13:36:31 +0200 (CEST) Received: by mail-pg0-f65.google.com with SMTP id e187so11920431pgc.3 for ; Tue, 20 Jun 2017 04:36:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fGZjOTlikn3XiOSJoQSVTZppacdBlD5YND6d7j2iMeA=; b=bLYdZauM8fSWjyXsX1GKYAeu7yni47kQO6QCL7Rc0bLramlTHL+8qLzUCiIoV0GJpO HFReFuFafScYXr36NECdiEkTA3u8JS+7TbAPf7j//4XRR26wS/Pixceq4sat4YeldCCo xt8jVQSeZFx1ov56cFpGd1kZKFKH04I+Nt8dUaEGc/WHZ5VSWzzmHRm83jv6KP4HtEUO 49BJXKvEnR+KhWqa3+LR32g8zxPnZ5JOgYEMM6OQKQQwMNEFr459VfWeses5g/sFw0A6 DP1jhxF879DHQu4oy37AYq2ugGi34Azm8a7iDkZ8VMIH8LBtZNsxdMxoQCvJSY2/hXfD LXrw== 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; bh=fGZjOTlikn3XiOSJoQSVTZppacdBlD5YND6d7j2iMeA=; b=s3QU/0AYcsbU6lW0LZiiN9+BeSUVQWZlhzcmdd8KsYoAf/Aa58wDOAIteNEW+uslij /lvqcltpLnDiyDnNMY4SbC2paotaHFAmG/2qGMxbLGQYM43/TW1V89phcyKZL07sK0M+ VXCNz7m8x4N+QZcQCGqNKGWtE3rBoHDiguORY14F3rK4A0uLFzV3S4Cw6eksey7dYv0E +M9CUEynQbNB1U1kxnmu6ir/sLogf+yVFQxvEG55/fS3nw0/Hh04O9ZLgrvCCfj+6qRT h+4MVMWVtG9UAA8z/HoGia9n/lzjBnzdUy9S28Q9DkF71qTlYY5OqEdwc64JRi02NcoH kY+A== X-Gm-Message-State: AKS2vOyCeu8VyiFIVJDbhuCJC+0HHz5mlXzmPMYRnpSbRWJn0q9t48hD Zb66QimXYEC/QvXsyaYKXA== X-Received: by 10.99.120.11 with SMTP id t11mr30736647pgc.35.1497958591266; Tue, 20 Jun 2017 04:36:31 -0700 (PDT) Received: from yliu-home.localdomain ([45.63.61.64]) by smtp.gmail.com with ESMTPSA id 25sm6104783pfj.59.2017.06.20.04.36.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 04:36:30 -0700 (PDT) From: Yuanhan Liu To: Alejandro Lucero Cc: Anatoly Burakov , dpdk stable Date: Tue, 20 Jun 2017 19:35:16 +0800 Message-Id: <1497958550-13600-4-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497958550-13600-1-git-send-email-yliu@fridaylinux.org> References: <1497958550-13600-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'vfio: fix array bounds check' has been queued to stable release 17.05.1 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: , X-List-Received-Date: Tue, 20 Jun 2017 11:36:32 -0000 Hi, FYI, your patch has been queued to stable release 17.05.1 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/22/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 7b6546c7fd42c24a569ffdc4dfc7fe5b7d706a11 Mon Sep 17 00:00:00 2001 From: Alejandro Lucero Date: Fri, 12 May 2017 11:18:25 +0100 Subject: [PATCH] vfio: fix array bounds check [ upstream commit 4af00fb1a2449f23a7c0fc32159207ae68b0fbbb ] Checking against VFIO_MAX_GROUPS goes beyond the maximum array index which should be (VFIO_MAX_GROUPS - 1). Coverity issue: 144555, 144556, 144557 Fixes: 94c0776b1bad ("support hotplug") Signed-off-by: Alejandro Lucero Acked-by: Anatoly Burakov --- lib/librte_eal/linuxapp/eal/eal_vfio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c index 53ac725..946df7e 100644 --- a/lib/librte_eal/linuxapp/eal/eal_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c @@ -189,7 +189,7 @@ vfio_group_device_get(int vfio_group_fd) int i; i = get_vfio_group_idx(vfio_group_fd); - if (i < 0 || i > VFIO_MAX_GROUPS) + if (i < 0 || i > (VFIO_MAX_GROUPS - 1)) RTE_LOG(ERR, EAL, " wrong vfio_group index (%d)\n", i); else vfio_cfg.vfio_groups[i].devices++; @@ -201,7 +201,7 @@ vfio_group_device_put(int vfio_group_fd) int i; i = get_vfio_group_idx(vfio_group_fd); - if (i < 0 || i > VFIO_MAX_GROUPS) + if (i < 0 || i > (VFIO_MAX_GROUPS - 1)) RTE_LOG(ERR, EAL, " wrong vfio_group index (%d)\n", i); else vfio_cfg.vfio_groups[i].devices--; @@ -213,7 +213,7 @@ vfio_group_device_count(int vfio_group_fd) int i; i = get_vfio_group_idx(vfio_group_fd); - if (i < 0 || i > VFIO_MAX_GROUPS) { + if (i < 0 || i > (VFIO_MAX_GROUPS - 1)) { RTE_LOG(ERR, EAL, " wrong vfio_group index (%d)\n", i); return -1; } -- 2.7.4