Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[firefly-linux-kernel-4.4.55.git] / kernel / sys.c
index e7006eb6c1e4fdc3fa7967eaa45541609b5d499f..ba0ae8eea6fbc32fb159c6dbf8d9868bcbaa1452 100644 (file)
@@ -1908,7 +1908,7 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
                        error = prctl_get_seccomp();
                        break;
                case PR_SET_SECCOMP:
-                       error = prctl_set_seccomp(arg2);
+                       error = prctl_set_seccomp(arg2, (char __user *)arg3);
                        break;
                case PR_GET_TSC:
                        error = GET_TSC_CTL(arg2);
@@ -1979,6 +1979,16 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
                        error = put_user(me->signal->is_child_subreaper,
                                         (int __user *) arg2);
                        break;
+               case PR_SET_NO_NEW_PRIVS:
+                       if (arg2 != 1 || arg3 || arg4 || arg5)
+                               return -EINVAL;
+
+                       current->no_new_privs = 1;
+                       break;
+               case PR_GET_NO_NEW_PRIVS:
+                       if (arg2 || arg3 || arg4 || arg5)
+                               return -EINVAL;
+                       return current->no_new_privs ? 1 : 0;
                default:
                        error = -EINVAL;
                        break;