[dpdk-stable] patch 'eal: fix auxv open check for ARM and PPC' has been queued to stable release 17.08.1

Yuanhan Liu yliu at fridaylinux.org
Tue Nov 21 14:15:49 CET 2017


Hi,

FYI, your patch has been queued to stable release 17.08.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 11/24/17. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From c65b83ba128f7b58fae44ebde6f2ac8326c6cfaf Mon Sep 17 00:00:00 2001
From: Lukasz Majczak <lma at semihalf.com>
Date: Thu, 28 Sep 2017 08:54:59 +0200
Subject: [PATCH] eal: fix auxv open check for ARM and PPC

[ upstream commit 1e0a17ac4c816fc41f6cf8c1fcd56149d8927263 ]

The assertion of return value from the open() function is done against
0, while it is a correct value - open() returns -1 in case of an error.
It causes problems while trying to run as a daemon, in which case, this
call to open() will return 0 as a valid descriptor.

Fixes: b94e5c9406b5 ("eal/arm: add CPU flags for ARMv7")
Fixes: 97523f822ba9 ("eal/arm: add CPU flags for ARMv8")
Fixes: 9ae155385686 ("eal/ppc: cpu flag checks for IBM Power")

Signed-off-by: Lukasz Majczak <lma at semihalf.com>
Acked-by: Jan Viktorin <viktorin at rehivetech.com>
Acked-by: Chao Zhu <chaozhu at linux.vnet.ibm.com>
---
 lib/librte_eal/common/arch/arm/rte_cpuflags.c    | 2 +-
 lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/common/arch/arm/rte_cpuflags.c b/lib/librte_eal/common/arch/arm/rte_cpuflags.c
index 5636e9c..88f1cbe 100644
--- a/lib/librte_eal/common/arch/arm/rte_cpuflags.c
+++ b/lib/librte_eal/common/arch/arm/rte_cpuflags.c
@@ -137,7 +137,7 @@ rte_cpu_get_features(hwcap_registers_t out)
 	_Elfx_auxv_t auxv;
 
 	auxv_fd = open("/proc/self/auxv", O_RDONLY);
-	assert(auxv_fd);
+	assert(auxv_fd != -1);
 	while (read(auxv_fd, &auxv, sizeof(auxv)) == sizeof(auxv)) {
 		if (auxv.a_type == AT_HWCAP) {
 			out[REG_HWCAP] = auxv.a_un.a_val;
diff --git a/lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c b/lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c
index fcf96e0..970a61c 100644
--- a/lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c
+++ b/lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c
@@ -108,7 +108,7 @@ rte_cpu_get_features(hwcap_registers_t out)
 	Elf64_auxv_t auxv;
 
 	auxv_fd = open("/proc/self/auxv", O_RDONLY);
-	assert(auxv_fd);
+	assert(auxv_fd != -1);
 	while (read(auxv_fd, &auxv,
 		sizeof(Elf64_auxv_t)) == sizeof(Elf64_auxv_t)) {
 		if (auxv.a_type == AT_HWCAP)
-- 
2.7.4



More information about the stable mailing list