]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
arm64: use the correct function type in SYSCALL_DEFINE0
authorSami Tolvanen <samitolvanen@google.com>
Fri, 24 May 2019 22:11:17 +0000 (15:11 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Jun 2019 06:15:20 +0000 (08:15 +0200)
[ Upstream commit 0e358bd7b7ebd27e491dabed938eae254c17fe3b ]

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 <samitolvanen@google.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm64/include/asm/syscall_wrapper.h

index a4477e515b798d3788c210ac184f9284e059e989..507d0ee6bc690093f84371089413eccf4560a101 100644 (file)
        }                                                                               \
        static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
 
-#define COMPAT_SYSCALL_DEFINE0(sname)                                  \
-       asmlinkage long __arm64_compat_sys_##sname(void);               \
-       ALLOW_ERROR_INJECTION(__arm64_compat_sys_##sname, ERRNO);       \
-       asmlinkage long __arm64_compat_sys_##sname(void)
+#define COMPAT_SYSCALL_DEFINE0(sname)                                                  \
+       asmlinkage long __arm64_compat_sys_##sname(const struct pt_regs *__unused);     \
+       ALLOW_ERROR_INJECTION(__arm64_compat_sys_##sname, ERRNO);                       \
+       asmlinkage long __arm64_compat_sys_##sname(const struct pt_regs *__unused)
 
 #define COND_SYSCALL_COMPAT(name) \
        cond_syscall(__arm64_compat_sys_##name);
        static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
 
 #ifndef SYSCALL_DEFINE0
-#define SYSCALL_DEFINE0(sname)                                 \
-       SYSCALL_METADATA(_##sname, 0);                          \
-       asmlinkage long __arm64_sys_##sname(void);              \
-       ALLOW_ERROR_INJECTION(__arm64_sys_##sname, ERRNO);      \
-       asmlinkage long __arm64_sys_##sname(void)
+#define SYSCALL_DEFINE0(sname)                                                 \
+       SYSCALL_METADATA(_##sname, 0);                                          \
+       asmlinkage long __arm64_sys_##sname(const struct pt_regs *__unused);    \
+       ALLOW_ERROR_INJECTION(__arm64_sys_##sname, ERRNO);                      \
+       asmlinkage long __arm64_sys_##sname(const struct pt_regs *__unused)
 #endif
 
 #ifndef COND_SYSCALL