lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 22 Sep 2015 11:45:56 +0100
From:	Andre Przywara <andre.przywara@....com>
To:	Andrea Arcangeli <aarcange@...hat.com>,
	Shuah Khan <shuahkh@....samsung.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-api@...r.kernel.org, linux-kernel@...r.kernel.org,
	Pavel Emelyanov <xemul@...allels.com>
Subject: [PATCH 2/2] selftests/userfaultfd: improve syscall number definition

At the moment the userfaultfd test program only supports x86 and an
architecture called "powewrpc" ;-)
Fix that typo and add the syscall numbers for other architectures as
well.
Also as in an ideal world a syscall number should come from the system
header file <asm/unistd.h>, include that header and guard the explicit
syscall number section below to avoid redefinitions.

Signed-off-by: Andre Przywara <andre.przywara@....com>
---
 tools/testing/selftests/vm/userfaultfd.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c
index 2c7cca6..63be27f 100644
--- a/tools/testing/selftests/vm/userfaultfd.c
+++ b/tools/testing/selftests/vm/userfaultfd.c
@@ -65,16 +65,27 @@
 #include <sys/ioctl.h>
 #include <pthread.h>
 #include "../../../../include/uapi/linux/userfaultfd.h"
+#include <asm/unistd.h>
 
+/* ideally the above user header provides that number, but ... */
+#ifndef __NR_userfaultfd
 #ifdef __x86_64__
 #define __NR_userfaultfd 323
 #elif defined(__i386__)
 #define __NR_userfaultfd 374
-#elif defined(__powewrpc__)
+#elif defined(__powerpc__)
 #define __NR_userfaultfd 364
+#elif defined(__ia64__)
+#define __NR_userfaultfd 1343
+#elif defined(__arm__)
+#define __NR_userfaultfd 388
+#elif defined(__aarch64__)
+/* this is from the generic syscall table, used also on other architectures */
+#define __NR_userfaultfd 283
 #else
 #error "missing __NR_userfaultfd definition"
 #endif
+#endif /* !__NR_userfaultfd */
 
 static unsigned long nr_cpus, nr_pages, nr_pages_per_cpu, page_size;
 
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ