From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 7ED1A37B3 for ; Fri, 7 Apr 2017 10:14:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491552887; x=1523088887; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=OfyNzePmuPZgaQvdxgl8LKYNLrrUeiVYrRU+r+ehA04=; b=BVMZMLjpL9BjQcH0jZmXjI2P0fwTGPOQcRklYmUpypgBukJh67ske7FH UtVo8juiIpjhzhbBZ7ZMyu2daqpGLQ==; Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Apr 2017 01:14:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,164,1488873600"; d="scan'208";a="953273255" Received: from yliu-dev.sh.intel.com ([10.239.67.162]) by orsmga003.jf.intel.com with ESMTP; 07 Apr 2017 01:14:45 -0700 From: Yuanhan Liu To: Jianfeng Tan Cc: Yuanhan Liu , Pawel Rutkowski , Sergio Gonzalez Monroy , dpdk stable Date: Fri, 7 Apr 2017 16:11:21 +0800 Message-Id: <1491552724-3034-4-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1491552724-3034-1-git-send-email-yuanhan.liu@linux.intel.com> References: <1491552724-3034-1-git-send-email-yuanhan.liu@linux.intel.com> Subject: [dpdk-stable] patch 'vfio: fix secondary process start' has been queued to LTS release 16.11.2 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: Fri, 07 Apr 2017 08:14:48 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/11/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 2a3aed76461b6903912784652e95f46459b16f7d Mon Sep 17 00:00:00 2001 From: Jianfeng Tan Date: Thu, 16 Mar 2017 16:28:44 +0000 Subject: [PATCH] vfio: fix secondary process start [ upstream commit dd18a2f0b27614841f258c567407093c3d4fd6c5 ] When binding with vfio-pci, secondary process cannot be started with an error message: cannot find TAILQ entry for PCI device. It's due to: struct rte_pci_addr is padded with 1 byte for alignment by compiler. Then below comparison in commit 2f4adfad0a69 ("vfio: add multiprocess support") will fail if the last byte is not initialized. memcmp(&vfio_res->pci_addr, &dev->addr, sizeof(dev->addr) And commit cdc242f260e7 ("eal/linux: support running as unprivileged user") just triggers this bug by using a stack un-initialized variable. The fix is to use rte_eal_compare_pci_addr() for pci addr comparison. Fixes: 2f4adfad0a69 ("vfio: add multiprocess support") Fixes: cdc242f260e7 ("eal/linux: support running as unprivileged user") Reported-by: Pawel Rutkowski Signed-off-by: Jianfeng Tan Acked-by: Sergio Gonzalez Monroy --- lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c index 5f478c5..7d8b9fb 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c @@ -355,7 +355,8 @@ pci_vfio_map_resource(struct rte_pci_device *dev) } else { /* if we're in a secondary process, just find our tailq entry */ TAILQ_FOREACH(vfio_res, vfio_res_list, next) { - if (memcmp(&vfio_res->pci_addr, &dev->addr, sizeof(dev->addr))) + if (rte_eal_compare_pci_addr(&vfio_res->pci_addr, + &dev->addr)) continue; break; } -- 1.9.0