armv8: Fix idcap_identify syscall
authorAya Kayal <akayal@student.ethz.ch>
Fri, 26 Jul 2019 13:49:55 +0000 (15:49 +0200)
committerDaniel Schwyn <daniel.schwyn@inf.ethz.ch>
Wed, 31 Jul 2019 09:22:05 +0000 (11:22 +0200)
Signed-off-by: Aya Kayal <akayal@student.ethz.ch>

kernel/arch/armv8/syscall.c

index 7f58e2d..1aae2d1 100644 (file)
@@ -826,22 +826,18 @@ static struct sysret dispatcher_dump_capabilities(struct capability *cap,
     return SYSRET(err);
 }
 
-static struct sysret handle_idcap_identify(struct capability *to,
+static struct sysret handle_idcap_identify(struct capability *cap,
                                            arch_registers_state_t *context,
                                            int argc)
 {
-    assert(to->type == ObjType_ID);
-    assert(3 == argc);
-
-    struct registers_aarch64_syscall_args* sa = &context->syscall_args;
-    idcap_id_t *idp = (idcap_id_t *) sa->arg2;
+    assert(cap->type == ObjType_ID);
+    assert(2 == argc);
 
-    // Check validity of user space pointer
-    if (!access_ok(ACCESS_WRITE, (lvaddr_t) idp, sizeof(*idp)))  {
-        return SYSRET(SYS_ERR_INVALID_USER_BUFFER);
-    }
+    idcap_id_t id;
+    struct sysret sysret = sys_idcap_identify(cap, &id);
+    sysret.value = id;
 
-    return sys_idcap_identify(to, idp);
+    return sysret;
 }
 
 static struct sysret handle_cap_identify(struct capability *root,