Added means to search for threads in other containers

Thread ids now contain their container ids in the top 2 nibbles.
Threads on other containers can be addressed by changing those
two nibbles. The addressing of inter-container threads are
subject to capabilities.
This commit is contained in:
Bahadir Balban
2009-11-04 20:56:57 +02:00
parent 516efccd99
commit d9520adb55
15 changed files with 91 additions and 37 deletions

View File

@@ -451,10 +451,11 @@ struct capability *cap_match_thread(struct capability *cap,
if (action_flags == THREAD_CREATE) {
/*
* TODO: Add cid to task_ids arg.
* NOTE: Currently we only allow creation in
* current container.
*
* Its a thread create and we have no knowledge of
* thread id, space id, or any other id.
* TODO: Add capability checking for space,
* as well.
*
* We _assume_ target is the largest group,
* e.g. same container as current. We check
@@ -462,7 +463,7 @@ struct capability *cap_match_thread(struct capability *cap,
*/
if (cap_rtype(cap) != CAP_RTYPE_CONTAINER)
return 0;
if (cap->resid != current->container->cid)
if (cap->resid != curcont->cid)
return 0;
/* Resource type and id match, success */
return cap;