[tip:x86/vdso] x86-64, vdso, seccomp: Fix !CONFIG_SECCOMP build
From: tip-bot for Ingo Molnar
Date: Mon Jun 06 2011 - 04:35:55 EST
Commit-ID: 764611c8dfb5be43611296affd92272b7215daea
Gitweb: http://git.kernel.org/tip/764611c8dfb5be43611296affd92272b7215daea
Author: Ingo Molnar <mingo@xxxxxxx>
AuthorDate: Mon, 6 Jun 2011 10:00:01 +0200
Committer: Ingo Molnar <mingo@xxxxxxx>
CommitDate: Mon, 6 Jun 2011 10:00:01 +0200
x86-64, vdso, seccomp: Fix !CONFIG_SECCOMP build
Factor out seccomp->mode access into an inline function and make
it work in the !CONFIG_SECCOMP case as well.
Cc: Andy Lutomirski <luto@xxxxxxx>
Cc: Jesper Juhl <jj@xxxxxxxxxxxxx>
Cc: Borislav Petkov <bp@xxxxxxxxx>
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Cc: Arjan van de Ven <arjan@xxxxxxxxxxxxx>
Cc: Jan Beulich <JBeulich@xxxxxxxxxx>
Cc: richard -rw- weinberger <richard.weinberger@xxxxxxxxx>
Cc: Mikael Pettersson <mikpe@xxxxxxxx>
Cc: Andi Kleen <andi@xxxxxxxxxxxxxx>
Cc: Brian Gerst <brgerst@xxxxxxxxx>
Cc: Louis Rilling <Louis.Rilling@xxxxxxxxxxx>
Cc: Valdis.Kletnieks@xxxxxx
Cc: pageexec@xxxxxxxxxxx
Link: http://lkml.kernel.org/r/e64e1b3c64858820d12c48fa739efbd1485e79d5.1307292171.git.luto@xxxxxxx
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
---
arch/x86/kernel/vsyscall_64.c | 2 +-
include/linux/seccomp.h | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c
index 52ba392..285af7a 100644
--- a/arch/x86/kernel/vsyscall_64.c
+++ b/arch/x86/kernel/vsyscall_64.c
@@ -188,7 +188,7 @@ void dotraplinkage do_emulate_vsyscall(struct pt_regs *regs, long error_code)
}
tsk = current;
- if (tsk->seccomp.mode) {
+ if (seccomp_mode(&tsk->seccomp)) {
do_exit(SIGKILL);
goto out;
}
diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h
index 167c333..cc7a4e9 100644
--- a/include/linux/seccomp.h
+++ b/include/linux/seccomp.h
@@ -19,6 +19,11 @@ static inline void secure_computing(int this_syscall)
extern long prctl_get_seccomp(void);
extern long prctl_set_seccomp(unsigned long);
+static inline int seccomp_mode(seccomp_t *s)
+{
+ return s->mode;
+}
+
#else /* CONFIG_SECCOMP */
#include <linux/errno.h>
@@ -37,6 +42,11 @@ static inline long prctl_set_seccomp(unsigned long arg2)
return -EINVAL;
}
+static inline int seccomp_mode(seccomp_t *s)
+{
+ return 0;
+}
+
#endif /* CONFIG_SECCOMP */
#endif /* _LINUX_SECCOMP_H */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/