Skip to content

Commit 0e358bd

Browse files
samitolvanenwildea01
authored andcommitted
arm64: use the correct function type in SYSCALL_DEFINE0
Although a syscall defined using SYSCALL_DEFINE0 doesn't accept parameters, use the correct function type to avoid indirect call type mismatches with Control-Flow Integrity checking. Signed-off-by: Sami Tolvanen <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent 8ef8f36 commit 0e358bd

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

arch/arm64/include/asm/syscall_wrapper.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
} \
3131
static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
3232

33-
#define COMPAT_SYSCALL_DEFINE0(sname) \
34-
asmlinkage long __arm64_compat_sys_##sname(void); \
35-
ALLOW_ERROR_INJECTION(__arm64_compat_sys_##sname, ERRNO); \
36-
asmlinkage long __arm64_compat_sys_##sname(void)
33+
#define COMPAT_SYSCALL_DEFINE0(sname) \
34+
asmlinkage long __arm64_compat_sys_##sname(const struct pt_regs *__unused); \
35+
ALLOW_ERROR_INJECTION(__arm64_compat_sys_##sname, ERRNO); \
36+
asmlinkage long __arm64_compat_sys_##sname(const struct pt_regs *__unused)
3737

3838
#define COND_SYSCALL_COMPAT(name) \
3939
cond_syscall(__arm64_compat_sys_##name);
@@ -62,11 +62,11 @@
6262
static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
6363

6464
#ifndef SYSCALL_DEFINE0
65-
#define SYSCALL_DEFINE0(sname) \
66-
SYSCALL_METADATA(_##sname, 0); \
67-
asmlinkage long __arm64_sys_##sname(void); \
68-
ALLOW_ERROR_INJECTION(__arm64_sys_##sname, ERRNO); \
69-
asmlinkage long __arm64_sys_##sname(void)
65+
#define SYSCALL_DEFINE0(sname) \
66+
SYSCALL_METADATA(_##sname, 0); \
67+
asmlinkage long __arm64_sys_##sname(const struct pt_regs *__unused); \
68+
ALLOW_ERROR_INJECTION(__arm64_sys_##sname, ERRNO); \
69+
asmlinkage long __arm64_sys_##sname(const struct pt_regs *__unused)
7070
#endif
7171

7272
#ifndef COND_SYSCALL

0 commit comments

Comments
 (0)