vsyscall_64: add missing ifdef CONFIG_SECCOMP
authorWill Drewry <wad@chromium.org>
Sat, 14 Jul 2012 15:32:52 +0000 (10:32 -0500)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 14 Jul 2012 19:01:36 +0000 (12:01 -0700)
vsyscall_seccomp introduced a dependency on __secure_computing.  On
configurations with CONFIG_SECCOMP disabled, compilation will fail.

Reported-by: feng xiangjun <fengxj325@gmail.com>
Signed-off-by: Will Drewry <wad@chromium.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/x86/kernel/vsyscall_64.c

index 08a18d0dcc5a4924be8975cbdf6bd74ad34958eb..5db36caf4289cdab3fe04bf899f4826504ced389 100644 (file)
@@ -139,6 +139,7 @@ static int addr_to_vsyscall_nr(unsigned long addr)
        return nr;
 }
 
+#ifdef CONFIG_SECCOMP
 static int vsyscall_seccomp(struct task_struct *tsk, int syscall_nr)
 {
        if (!seccomp_mode(&tsk->seccomp))
@@ -147,6 +148,9 @@ static int vsyscall_seccomp(struct task_struct *tsk, int syscall_nr)
        task_pt_regs(tsk)->ax = syscall_nr;
        return __secure_computing(syscall_nr);
 }
+#else
+#define vsyscall_seccomp(_tsk, _nr) 0
+#endif
 
 static bool write_ok_or_segv(unsigned long ptr, size_t size)
 {