]> Git Repo - linux.git/blobdiff - kernel/sys.c
arm64/sve: Add prctl controls for userspace vector length management
[linux.git] / kernel / sys.c
index 2855ee73acd0ef9f62699ff669659e045df84422..c541916b38c66d8763eebebad37a8293d1e4a60b 100644 (file)
 #ifndef SET_FP_MODE
 # define SET_FP_MODE(a,b)      (-EINVAL)
 #endif
+#ifndef SVE_SET_VL
+# define SVE_SET_VL(a)         (-EINVAL)
+#endif
+#ifndef SVE_GET_VL
+# define SVE_GET_VL()          (-EINVAL)
+#endif
 
 /*
  * this is where the system-wide overflow UID and GID are defined, for
@@ -1896,15 +1902,11 @@ static int validate_prctl_map(struct prctl_mm_map *prctl_map)
 
        /*
         * Finally, make sure the caller has the rights to
-        * change /proc/pid/exe link: only local root should
+        * change /proc/pid/exe link: only local sys admin should
         * be allowed to.
         */
        if (prctl_map->exe_fd != (u32)-1) {
-               struct user_namespace *ns = current_user_ns();
-               const struct cred *cred = current_cred();
-
-               if (!uid_eq(cred->uid, make_kuid(ns, 0)) ||
-                   !gid_eq(cred->gid, make_kgid(ns, 0)))
+               if (!ns_capable(current_user_ns(), CAP_SYS_ADMIN))
                        goto out;
        }
 
@@ -2389,6 +2391,12 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
        case PR_GET_FP_MODE:
                error = GET_FP_MODE(me);
                break;
+       case PR_SVE_SET_VL:
+               error = SVE_SET_VL(arg2);
+               break;
+       case PR_SVE_GET_VL:
+               error = SVE_GET_VL();
+               break;
        default:
                error = -EINVAL;
                break;
This page took 0.033267 seconds and 4 git commands to generate.