From: "Serge E. Hallyn" There I went again having one patch do two (related) things. Remove the special check I had added to cap_task_kill() for non-matching uids. In fact it turns out the check wouldn't be safe even if I'd coded it correctly. A binary can be setuid and owned by a non-root user user1, have file capabilities, and be executed by user2. Signed-off-by: Serge E. Hallyn Cc: Andrew Morgan Cc: Stephen Smalley Cc: Chris Wright Cc: James Morris Signed-off-by: Andrew Morton --- security/commoncap.c | 5 ----- 1 file changed, 5 deletions(-) diff -puN security/commoncap.c~file-capabilities-allow-sigcont-within-session-v2-file-capabilities-remove-the-non-matching-uid-special-case-for-kill security/commoncap.c --- a/security/commoncap.c~file-capabilities-allow-sigcont-within-session-v2-file-capabilities-remove-the-non-matching-uid-special-case-for-kill +++ a/security/commoncap.c @@ -526,11 +526,6 @@ int cap_task_kill(struct task_struct *p, if (info != SEND_SIG_NOINFO && (is_si_special(info) || SI_FROMKERNEL(info))) return 0; - /* if tasks have same uid, then check_kill_permission did check */ - if (current->uid == p->uid || current->euid == p->uid || - current->uid == p->suid || current->euid == p->suid) - return 0; - /* sigcont is permitted within same session */ if (sig == SIGCONT && (task_session_nr(current) == task_session_nr(p))) return 0; _