[PATCH 1/1] file capabilities: allow sigcont within session (v2.6.24-rc2)

From: Serge E . Hallyn
Date: Wed Nov 14 2007 - 13:00:52 EST


Allow sigcont to be sent to a process with greater capabilities
if it is in the same session. Otherwise, a shell from which
I've started a root shell and done 'suspend' can't be restarted
by the parent shell.

(this patch against v2.6.24-rc2)

Signed-off-by: Serge E. Hallyn <serue@xxxxxxxxxx>
---
security/commoncap.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/security/commoncap.c b/security/commoncap.c
index bf67871..c9f6867 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -534,6 +534,8 @@ int cap_task_kill(struct task_struct *p, struct siginfo *info,
* Used only by usb drivers?
*/
return 0;
+ if (sig == SIGCONT && (task_session_nr(current)==task_session_nr(p)))
+ return 0;
if (cap_issubset(p->cap_permitted, current->cap_permitted))
return 0;
if (capable(CAP_KILL))
--
1.5.1.1.GIT

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/