From: "Serge E. Hallyn" Fix http://bugzilla.kernel.org/show_bug.cgi?id=9247 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. Also don't do file-capabilities signaling checks when uids for the processes don't match, since the standard check_kill_permission will have done those checks. [akpm@linux-foundation.org: coding-style cleanups] Signed-off-by: Serge E. Hallyn Acked-by: Andrew Morgan Cc: Chris Wright Tested-by: "Theodore Ts'o" Cc: Stephen Smalley Cc: "Rafael J. Wysocki" Cc: Chris Wright Cc: James Morris Cc: Stephen Smalley Signed-off-by: Andrew Morton --- security/commoncap.c | 4 ++++ 1 file changed, 4 insertions(+) diff -puN security/commoncap.c~file-capabilities-allow-sigcont-within-session-v2 security/commoncap.c --- a/security/commoncap.c~file-capabilities-allow-sigcont-within-session-v2 +++ a/security/commoncap.c @@ -530,6 +530,10 @@ int cap_task_kill(struct task_struct *p, if (sig == SIGCONT && (task_session_nr(current) == task_session_nr(p))) return 0; + /* sigcont is permitted within same session */ + if (sig == SIGCONT && (task_session_nr(current) == task_session_nr(p))) + return 0; + if (secid) /* * Signal sent as a particular user. _