Skip to content

Commit

Permalink
file capabilities: allow sigcont within session
Browse files Browse the repository at this point in the history
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.

[[email protected]: coding-style cleanups]
Signed-off-by: Serge E. Hallyn <[email protected]>
Acked-by: Andrew Morgan <[email protected]>
Cc: Chris Wright <[email protected]>
Tested-by: "Theodore Ts'o" <[email protected]>
Cc: Stephen Smalley <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Chris Wright <[email protected]>
Cc: James Morris <[email protected]>
Cc: Stephen Smalley <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Serge E. Hallyn authored and Linus Torvalds committed Nov 15, 2007
1 parent 20a1022 commit 91ad997
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions security/commoncap.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,10 @@ int cap_task_kill(struct task_struct *p, struct siginfo *info,
if (info != SEND_SIG_NOINFO && (is_si_special(info) || SI_FROMKERNEL(info)))
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.
Expand Down

0 comments on commit 91ad997

Please sign in to comment.