Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98710
b: refs/heads/master
c: 1209726
h: refs/heads/master
v: v3
  • Loading branch information
Andrew G. Morgan authored and Linus Torvalds committed Jul 4, 2008
1 parent 598f2a3 commit 545d8db
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 086f7316f0d400806d76323beefae996bb3849b1
refs/heads/master: 1209726ce942047c9fefe7cd427dc36f8e9ded53
13 changes: 10 additions & 3 deletions trunk/security/commoncap.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,16 @@ static inline int cap_inh_is_capped(void)
return (cap_capable(current, CAP_SETPCAP) != 0);
}

static inline int cap_limit_ptraced_target(void) { return 1; }

#else /* ie., ndef CONFIG_SECURITY_FILE_CAPABILITIES */

static inline int cap_block_setpcap(struct task_struct *t) { return 0; }
static inline int cap_inh_is_capped(void) { return 1; }
static inline int cap_limit_ptraced_target(void)
{
return !capable(CAP_SETPCAP);
}

#endif /* def CONFIG_SECURITY_FILE_CAPABILITIES */

Expand Down Expand Up @@ -342,9 +348,10 @@ void cap_bprm_apply_creds (struct linux_binprm *bprm, int unsafe)
bprm->e_uid = current->uid;
bprm->e_gid = current->gid;
}
if (!capable (CAP_SETPCAP)) {
new_permitted = cap_intersect (new_permitted,
current->cap_permitted);
if (cap_limit_ptraced_target()) {
new_permitted =
cap_intersect(new_permitted,
current->cap_permitted);
}
}
}
Expand Down

0 comments on commit 545d8db

Please sign in to comment.