mirror of
https://github.com/drasko/codezero.git
synced 2026-01-16 21:03:16 +01:00
Lots of fixes, notion of pager hierarchy, fixed tgroup capability checking
Notion of pager hierarchy introduced using the existing but unused pagerid field. Thread creation now has two more flags TC_AS_PAGER and TC_SHARE_PAGER. The former sets creator as pager, the latter sets creator's pager as pager. Thread group capability sharing now correctly carries shared capabilities to the thread group leader's tgr_cap_list list, and this list is checked during capability checking.
This commit is contained in:
@@ -81,6 +81,7 @@ struct capability *capability_find_by_rtype(struct ktcb *task,
|
||||
unsigned int rtype)
|
||||
{
|
||||
struct capability *cap;
|
||||
struct ktcb *tgleader;
|
||||
|
||||
/* Search task's own list */
|
||||
list_foreach_struct(cap, &task->cap_list.caps, list)
|
||||
@@ -92,8 +93,11 @@ struct capability *capability_find_by_rtype(struct ktcb *task,
|
||||
if (cap_rtype(cap) == rtype)
|
||||
return cap;
|
||||
|
||||
/* Find group leader */
|
||||
BUG_ON(!(tgleader = tcb_find(task->tgid)));
|
||||
|
||||
/* Search thread group list */
|
||||
list_foreach_struct(cap, &task->tgr_cap_list.caps, list)
|
||||
list_foreach_struct(cap, &tgleader->tgr_cap_list.caps, list)
|
||||
if (cap_rtype(cap) == rtype)
|
||||
return cap;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user