Skip to content
Snippets Groups Projects
Commit 4bf2ea77 authored by Eric Paris's avatar Eric Paris Committed by James Morris
Browse files

capabilities: do not special case exec of init


When the global init task is exec'd we have special case logic to make sure
the pE is not reduced.  There is no reason for this.  If init wants to drop
it's pE is should be allowed to do so.  Remove this special logic.

Signed-off-by: default avatarEric Paris <eparis@redhat.com>
Acked-by: default avatarSerge Hallyn <serge@hallyn.com>
Acked-by: default avatarDavid Howells <dhowells@redhat.com>
Acked-by: default avatarAndrew G. Morgan <morgan@kernel.org>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent 17f60a7d
No related branches found
No related tags found
No related merge requests found
...@@ -529,15 +529,10 @@ int cap_bprm_set_creds(struct linux_binprm *bprm) ...@@ -529,15 +529,10 @@ int cap_bprm_set_creds(struct linux_binprm *bprm)
new->suid = new->fsuid = new->euid; new->suid = new->fsuid = new->euid;
new->sgid = new->fsgid = new->egid; new->sgid = new->fsgid = new->egid;
/* For init, we want to retain the capabilities set in the initial if (effective)
* task. Thus we skip the usual capability rules new->cap_effective = new->cap_permitted;
*/ else
if (!is_global_init(current)) { cap_clear(new->cap_effective);
if (effective)
new->cap_effective = new->cap_permitted;
else
cap_clear(new->cap_effective);
}
bprm->cap_effective = effective; bprm->cap_effective = effective;
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment