]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.19.54/arm64-use-the-correct-function-type-in-syscall_defin.patch
Linux 5.1.13
[thirdparty/kernel/stable-queue.git] / releases / 4.19.54 / arm64-use-the-correct-function-type-in-syscall_defin.patch
1 From 5692faa4dca102777ab937a0233d00ea8fb7ea1e Mon Sep 17 00:00:00 2001
2 From: Sami Tolvanen <samitolvanen@google.com>
3 Date: Fri, 24 May 2019 15:11:17 -0700
4 Subject: arm64: use the correct function type in SYSCALL_DEFINE0
5
6 [ Upstream commit 0e358bd7b7ebd27e491dabed938eae254c17fe3b ]
7
8 Although a syscall defined using SYSCALL_DEFINE0 doesn't accept
9 parameters, use the correct function type to avoid indirect call
10 type mismatches with Control-Flow Integrity checking.
11
12 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
13 Signed-off-by: Will Deacon <will.deacon@arm.com>
14 Signed-off-by: Sasha Levin <sashal@kernel.org>
15 ---
16 arch/arm64/include/asm/syscall_wrapper.h | 18 +++++++++---------
17 1 file changed, 9 insertions(+), 9 deletions(-)
18
19 diff --git a/arch/arm64/include/asm/syscall_wrapper.h b/arch/arm64/include/asm/syscall_wrapper.h
20 index a4477e515b79..507d0ee6bc69 100644
21 --- a/arch/arm64/include/asm/syscall_wrapper.h
22 +++ b/arch/arm64/include/asm/syscall_wrapper.h
23 @@ -30,10 +30,10 @@
24 } \
25 static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
26
27 -#define COMPAT_SYSCALL_DEFINE0(sname) \
28 - asmlinkage long __arm64_compat_sys_##sname(void); \
29 - ALLOW_ERROR_INJECTION(__arm64_compat_sys_##sname, ERRNO); \
30 - asmlinkage long __arm64_compat_sys_##sname(void)
31 +#define COMPAT_SYSCALL_DEFINE0(sname) \
32 + asmlinkage long __arm64_compat_sys_##sname(const struct pt_regs *__unused); \
33 + ALLOW_ERROR_INJECTION(__arm64_compat_sys_##sname, ERRNO); \
34 + asmlinkage long __arm64_compat_sys_##sname(const struct pt_regs *__unused)
35
36 #define COND_SYSCALL_COMPAT(name) \
37 cond_syscall(__arm64_compat_sys_##name);
38 @@ -62,11 +62,11 @@
39 static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
40
41 #ifndef SYSCALL_DEFINE0
42 -#define SYSCALL_DEFINE0(sname) \
43 - SYSCALL_METADATA(_##sname, 0); \
44 - asmlinkage long __arm64_sys_##sname(void); \
45 - ALLOW_ERROR_INJECTION(__arm64_sys_##sname, ERRNO); \
46 - asmlinkage long __arm64_sys_##sname(void)
47 +#define SYSCALL_DEFINE0(sname) \
48 + SYSCALL_METADATA(_##sname, 0); \
49 + asmlinkage long __arm64_sys_##sname(const struct pt_regs *__unused); \
50 + ALLOW_ERROR_INJECTION(__arm64_sys_##sname, ERRNO); \
51 + asmlinkage long __arm64_sys_##sname(const struct pt_regs *__unused)
52 #endif
53
54 #ifndef COND_SYSCALL
55 --
56 2.20.1
57