aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-06-04 03:14:06 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-06-04 03:14:06 +0000
commit81d89aa35553f1890f120bb42b45c46f221e5421 (patch)
tree7332c2dc2c1488954834c763ef1ab381d036fc39
parent8a52c4937008b98dc90828ddedf7894f5b8fb46b (diff)
parent4c8ccc6b06137f9c9da3228a7e37a86544051e67 (diff)
downloadlinux-kselftest-android10-s2-release.tar.gz
Change-Id: I99d0a4f8ebbaef4e568842fdd2c6c81b6bc3cdeb
-rw-r--r--tools/testing/selftests/x86/syscall_arg_fault.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/testing/selftests/x86/syscall_arg_fault.c b/tools/testing/selftests/x86/syscall_arg_fault.c
index 7db4fc9fa09f..d2548401921f 100644
--- a/tools/testing/selftests/x86/syscall_arg_fault.c
+++ b/tools/testing/selftests/x86/syscall_arg_fault.c
@@ -43,7 +43,7 @@ static sigjmp_buf jmpbuf;
static volatile sig_atomic_t n_errs;
-static void sigsegv(int sig, siginfo_t *info, void *ctx_void)
+static void sigsegv_or_sigbus(int sig, siginfo_t *info, void *ctx_void)
{
ucontext_t *ctx = (ucontext_t*)ctx_void;
@@ -73,7 +73,13 @@ int main()
if (sigaltstack(&stack, NULL) != 0)
err(1, "sigaltstack");
- sethandler(SIGSEGV, sigsegv, SA_ONSTACK);
+ sethandler(SIGSEGV, sigsegv_or_sigbus, SA_ONSTACK);
+ /*
+ * The actual exception can vary. On Atom CPUs, we get #SS
+ * instead of #PF when the vDSO fails to access the stack when
+ * ESP is too close to 2^32, and #SS causes SIGBUS.
+ */
+ sethandler(SIGBUS, sigsegv_or_sigbus, SA_ONSTACK);
sethandler(SIGILL, sigill, SA_ONSTACK);
/*