Skip to content

Commit 006f38a

Browse files
committed
Merge branch 'exec-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
Pull execve fix from Eric Biederman: "While working on my exec cleanups I found a bug in exec that winds up miscomputing the ambient credentials during exec. Andy appears to have to been confused as to why credentials are computed for both the script and the interpreter From the original patch description: [3] Linux very confusingly processes both the script and the interpreter if applicable, for reasons that elude me. The results from thinking about a script's file capabilities and/or setuid bits are mostly discarded. The only value in struct cred that gets changed in cap_bprm_set_creds that I could find that might persist between the script and the interpreter was cap_ambient. Which is fixed with this trivial change" * 'exec-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: exec: Always set cap_ambient in cap_bprm_set_creds
2 parents 444fc5c + a4ae32c commit 006f38a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

security/commoncap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,7 @@ int cap_bprm_set_creds(struct linux_binprm *bprm)
812812
int ret;
813813
kuid_t root_uid;
814814

815+
new->cap_ambient = old->cap_ambient;
815816
if (WARN_ON(!cap_ambient_invariant_ok(old)))
816817
return -EPERM;
817818

0 commit comments

Comments
 (0)