lkml.org 
[lkml]   [2007]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] capabilities: introduce per-process capability bounding set (v10)
Serge,

Please tell me the meanings of the following condition.

> diff --git a/security/commoncap.c b/security/commoncap.c
> index 3a95990..cb71bb0 100644
> --- a/security/commoncap.c
> +++ b/security/commoncap.c
> @@ -133,6 +119,12 @@ int cap_capset_check (struct task_struct *target, kernel_cap_t *effective,
> /* incapable of using this inheritable set */
> return -EPERM;
> }
> + if (!!cap_issubset(*inheritable,
> + cap_combine(target->cap_inheritable,
> + current->cap_bset))) {
> + /* no new pI capabilities outside bounding set */
> + return -EPERM;
> + }
>
> /* verify restrictions on target's new Permitted set */
> if (!cap_issubset (*permitted,

It seems to me this condition requires the new inheritable capability
set must have a capability more than bounding set, at least.
What is the purpose of this checking?

In the initial state, any process have no inheritable capability set
and full bounding set. Thus, we cannot do capset() always.

Thanks,
--
OSS Platform Development Division, NEC
KaiGai Kohei <kaigai@ak.jp.nec.com>


\
 
 \ /
  Last update: 2007-12-04 05:31    [W:0.142 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site