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]
Message-Id: <20210529081620.164422-5-Houdek.Ryan@fex-emu.org>
Date:   Sat, 29 May 2021 01:16:20 -0700
From:   houdek.ryan@...-emu.org
To:     unlisted-recipients:; (no To-header on input)
Cc:     linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Ryan Houdek <Houdek.Ryan@...-emu.org>
Subject: [PATCH 4/4] arm64: tools: Update syscall user dispatch tests

From: Ryan Houdek <Houdek.Ryan@...-emu.org>

This is a fairly trivial change to support syscall user dispatch in
these selftests.

One of the tests is relying on the syscall to return the syscall number
in the return. Which is a byproduct from the scnum and return registers
being the same.
Since arm64 places the scnum in x8 and the return in x0 it just needs to
move the result over.

Signed-off-by: Ryan Houdek <Houdek.Ryan@...-emu.org>
---
 .../selftests/syscall_user_dispatch/sud_benchmark.c      | 2 +-
 tools/testing/selftests/syscall_user_dispatch/sud_test.c | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/syscall_user_dispatch/sud_benchmark.c b/tools/testing/selftests/syscall_user_dispatch/sud_benchmark.c
index 073a03702ff5..6059abe75cb3 100644
--- a/tools/testing/selftests/syscall_user_dispatch/sud_benchmark.c
+++ b/tools/testing/selftests/syscall_user_dispatch/sud_benchmark.c
@@ -41,7 +41,7 @@
  * out of the box, but don't enable them until they support syscall user
  * dispatch.
  */
-#if defined(__x86_64__) || defined(__i386__)
+#if defined(__x86_64__) || defined(__i386__) || defined(__aarch64__)
 #define TEST_BLOCKED_RETURN
 #endif
 
diff --git a/tools/testing/selftests/syscall_user_dispatch/sud_test.c b/tools/testing/selftests/syscall_user_dispatch/sud_test.c
index b5d592d4099e..11cf4ad6aa6e 100644
--- a/tools/testing/selftests/syscall_user_dispatch/sud_test.c
+++ b/tools/testing/selftests/syscall_user_dispatch/sud_test.c
@@ -150,6 +150,15 @@ int si_errno;
 
 static void handle_sigsys(int sig, siginfo_t *info, void *ucontext)
 {
+#ifdef __aarch64__
+	/* This test expects the syscall number will be returned in r0
+	 * Copy it over from r8 which is the scnum in the ABI
+	 */
+	ucontext_t *_context = (ucontext_t *)ucontext;
+
+	_context->uc_mcontext.regs[0] = _context->uc_mcontext.regs[8];
+#endif
+
 	si_code = info->si_code;
 	si_errno = info->si_errno;
 
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ