46 lines
1.4 KiB
Diff
46 lines
1.4 KiB
Diff
From d07260db8b803841a739fbe85d4617398e3e5c6a Mon Sep 17 00:00:00 2001
|
|
From: Steve Muckle <smuckle@google.com>
|
|
Date: Tue, 24 Oct 2017 14:41:07 -0700
|
|
Subject: [PATCH 09/24] seccomp: detect compat mode in ARM64
|
|
|
|
Compat mode on ARM64 reports syscall numbering differently.
|
|
|
|
(cherry picked from commit ce845e0a25d77c8cf0fae539d4596b83e65e3e70)
|
|
Test: run vts-kernel -m VtsKernelLinuxKselftestStaging
|
|
Bug: 33027081
|
|
Signed-off-by: Steve Muckle <smuckle@google.com>
|
|
---
|
|
tools/testing/selftests/seccomp/seccomp_bpf.c | 5 +++--
|
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
|
|
index 9691fdd5ab790..65b81fa4aaca8 100644
|
|
--- a/tools/testing/selftests/seccomp/seccomp_bpf.c
|
|
+++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
|
|
@@ -3020,6 +3020,7 @@ TEST(syscall_restart)
|
|
};
|
|
#if defined(__arm__)
|
|
struct utsname utsbuf;
|
|
+ int arm_version;
|
|
#endif
|
|
|
|
ASSERT_EQ(0, pipe(pipefd));
|
|
@@ -3135,12 +3136,12 @@ TEST(syscall_restart)
|
|
ret = get_syscall(_metadata, child_pid);
|
|
#if defined(__arm__)
|
|
/*
|
|
- * FIXME:
|
|
* - native ARM registers do NOT expose true syscall.
|
|
* - compat ARM registers on ARM64 DO expose true syscall.
|
|
*/
|
|
ASSERT_EQ(0, uname(&utsbuf));
|
|
- if (strncmp(utsbuf.machine, "arm", 3) == 0) {
|
|
+ if (sscanf(utsbuf.machine, "armv%d", &arm_version) == 1 &&
|
|
+ arm_version < 8) {
|
|
EXPECT_EQ(__NR_nanosleep, ret);
|
|
} else
|
|
#endif
|
|
--
|
|
2.36.0.550.gb090851708-goog
|
|
|