summaryrefslogtreecommitdiffstats
path: root/arch/arm64/include/asm/unistd.h
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2019-01-03 18:45:07 +0100
committerWill Deacon <will.deacon@arm.com>2019-01-04 15:18:01 +0100
commit169113ece0f29ebe884a6cfcf57c1ace04d8a36a (patch)
tree6f5dfd2cb72ed264b96097768e29c2c2f341b481 /arch/arm64/include/asm/unistd.h
parentarm64/sve: Disentangle <uapi/asm/ptrace.h> from <uapi/asm/sigcontext.h> (diff)
downloadlinux-169113ece0f29ebe884a6cfcf57c1ace04d8a36a.tar.xz
linux-169113ece0f29ebe884a6cfcf57c1ace04d8a36a.zip
arm64: compat: Avoid sending SIGILL for unallocated syscall numbers
The ARM Linux kernel handles the EABI syscall numbers as follows: 0 - NR_SYSCALLS-1 : Invoke syscall via syscall table NR_SYSCALLS - 0xeffff : -ENOSYS (to be allocated in future) 0xf0000 - 0xf07ff : Private syscall or -ENOSYS if not allocated > 0xf07ff : SIGILL Our compat code gets this wrong and ends up sending SIGILL in response to all syscalls greater than NR_SYSCALLS which have a value greater than 0x7ff in the bottom 16 bits. Fix this by defining the end of the ARM private syscall region and checking the syscall number against that directly. Update the comment while we're at it. Cc: <stable@vger.kernel.org> Cc: Dave Martin <Dave.Martin@arm.com> Reported-by: Pi-Hsun Shih <pihsun@chromium.org> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/unistd.h')
-rw-r--r--arch/arm64/include/asm/unistd.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h
index b13ca091f833..85d5c1026204 100644
--- a/arch/arm64/include/asm/unistd.h
+++ b/arch/arm64/include/asm/unistd.h
@@ -40,8 +40,9 @@
* The following SVCs are ARM private.
*/
#define __ARM_NR_COMPAT_BASE 0x0f0000
-#define __ARM_NR_compat_cacheflush (__ARM_NR_COMPAT_BASE+2)
-#define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE+5)
+#define __ARM_NR_compat_cacheflush (__ARM_NR_COMPAT_BASE + 2)
+#define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE + 5)
+#define __ARM_NR_COMPAT_END (__ARM_NR_COMPAT_BASE + 0x800)
#define __NR_compat_syscalls 399
#endif