MIPS: seccomp: Support compat with both O32 and N32
[deliverable/linux.git] / kernel / seccomp.c
index 15a1795bbba17d1140e3220c41d48dd26ac43c95..737436ebb4fe512163890606eaa0cc2fcbb773cd 100644 (file)
@@ -395,7 +395,7 @@ seccomp_prepare_user_filter(const char __user *user_filter)
        struct seccomp_filter *filter = ERR_PTR(-EFAULT);
 
 #ifdef CONFIG_COMPAT
-       if (is_compat_task()) {
+       if (in_compat_syscall()) {
                struct compat_sock_fprog fprog32;
                if (copy_from_user(&fprog32, user_filter, sizeof(fprog32)))
                        goto out;
@@ -518,19 +518,12 @@ static int mode1_syscalls[] = {
        0, /* null terminated */
 };
 
-#ifdef CONFIG_COMPAT
-static int mode1_syscalls_32[] = {
-       __NR_seccomp_read_32, __NR_seccomp_write_32, __NR_seccomp_exit_32, __NR_seccomp_sigreturn_32,
-       0, /* null terminated */
-};
-#endif
-
 static void __secure_computing_strict(int this_syscall)
 {
        int *syscall_whitelist = mode1_syscalls;
 #ifdef CONFIG_COMPAT
-       if (is_compat_task())
-               syscall_whitelist = mode1_syscalls_32;
+       if (in_compat_syscall())
+               syscall_whitelist = get_compat_mode1_syscalls();
 #endif
        do {
                if (*syscall_whitelist == this_syscall)
This page took 0.024411 seconds and 5 git commands to generate.