Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306007
b: refs/heads/master
c: 9e4a36e
h: refs/heads/master
i:
  306005: bddba60
  306003: 39fb951
  305999: d2e1bb2
v: v3
  • Loading branch information
Eric W. Biederman committed May 15, 2012
1 parent 2d6d0a2 commit 33d29e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a7c1938e22c02b008655524c766d185ae99d9d53
refs/heads/master: 9e4a36ece652908276bc4abb4324ec56292453e1
5 changes: 5 additions & 0 deletions trunk/fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1291,8 +1291,11 @@ int prepare_binprm(struct linux_binprm *bprm)
if (!(bprm->file->f_path.mnt->mnt_flags & MNT_NOSUID)) {
/* Set-uid? */
if (mode & S_ISUID) {
if (!kuid_has_mapping(bprm->cred->user_ns, inode->i_uid))
return -EPERM;
bprm->per_clear |= PER_CLEAR_ON_SETID;
bprm->cred->euid = inode->i_uid;

}

/* Set-gid? */
Expand All @@ -1302,6 +1305,8 @@ int prepare_binprm(struct linux_binprm *bprm)
* executable.
*/
if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) {
if (!kgid_has_mapping(bprm->cred->user_ns, inode->i_gid))
return -EPERM;
bprm->per_clear |= PER_CLEAR_ON_SETID;
bprm->cred->egid = inode->i_gid;
}
Expand Down

0 comments on commit 33d29e7

Please sign in to comment.