From 2e9923b4fdce0d7d835e6a9759faecd34396212e Mon Sep 17 00:00:00 2001 From: Sebastian Sumpf Date: Fri, 11 Jan 2013 17:14:26 +0100 Subject: [PATCH] Caps: fix l4_task_cap_equal semantic. The syscall l4_task_cap_equal almost returns false although the referenced kernel-objects are equal. This patch changes the semantic of the syscall so that whenever two capabilities refering the same kernel-object are compared it will return true. Please refer to the discussion of the following mail thread: http://www.mail-archive.com/l4-hackers@os.inf.tu-dresden.de/msg05162.html Was 'foc_caps_equal.patch' --- kernel/fiasco/src/kern/task.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kernel/fiasco/src/kern/task.cpp b/kernel/fiasco/src/kern/task.cpp index f9d8c9a3..2053063b 100644 --- a/kernel/fiasco/src/kern/task.cpp +++ b/kernel/fiasco/src/kern/task.cpp @@ -488,10 +488,12 @@ Task::sys_caps_equal(Syscall_frame *, Utcb *utcb) if (obj_a.special() || obj_b.special()) return commit_result(obj_a.special_cap() == obj_b.special_cap()); - Obj_space::Capability c_a = lookup(obj_a.cap()); - Obj_space::Capability c_b = lookup(obj_b.cap()); + Kobject_iface* ki_a = lookup(obj_a.cap()).obj(); + Kobject_iface* ki_b = lookup(obj_b.cap()).obj(); + Address a_a = ki_a ? ki_a->kobject_start_addr() : 0; + Address a_b = ki_b ? ki_b->kobject_start_addr() : 0; - return commit_result(c_a == c_b); + return commit_result(a_a == a_b); } PRIVATE inline NOEXPORT