Skip to content

Commit 4bf2ea7

Browse files
eparisxjamesmorris
authored andcommitted
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: Eric Paris <eparis@redhat.com> Acked-by: Serge Hallyn <serge@hallyn.com> Acked-by: David Howells <dhowells@redhat.com> Acked-by: Andrew G. Morgan <morgan@kernel.org> Signed-off-by: James Morris <jmorris@namei.org>
1 parent 17f60a7 commit 4bf2ea7

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

‎security/commoncap.c‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -529,15 +529,10 @@ int cap_bprm_set_creds(struct linux_binprm *bprm)
529529
new->suid = new->fsuid = new->euid;
530530
new->sgid = new->fsgid = new->egid;
531531

532-
/* For init, we want to retain the capabilities set in the initial
533-
* task. Thus we skip the usual capability rules
534-
*/
535-
if (!is_global_init(current)) {
536-
if (effective)
537-
new->cap_effective = new->cap_permitted;
538-
else
539-
cap_clear(new->cap_effective);
540-
}
532+
if (effective)
533+
new->cap_effective = new->cap_permitted;
534+
else
535+
cap_clear(new->cap_effective);
541536
bprm->cap_effective = effective;
542537

543538
/*

0 commit comments

Comments
 (0)