Skip to content

Commit 06f1631

Browse files
oleg-nesterovtorvalds
authored andcommitted
signals: send_sigio: use do_send_sig_info() to avoid check_kill_permission()
group_send_sig_info()->check_kill_permission() assumes that current is the sender and uses current_cred(). This is not true in send_sigio_to_task() case. From the security pov the sender is not current, but the task which did fcntl(F_SETOWN), that is why we have sigio_perm() which uses the right creds to check. Fortunately, send_sigio() always sends either SEND_SIG_PRIV or SI_FROMKERNEL() signal, so check_kill_permission() does nothing. But still it would be tidier to avoid this bogus security check and save a couple of cycles. Signed-off-by: Oleg Nesterov <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: stephane eranian <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Roland McGrath <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 4a30deb commit 06f1631

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/fcntl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,11 +461,11 @@ static void send_sigio_to_task(struct task_struct *p,
461461
else
462462
si.si_band = band_table[reason - POLL_IN];
463463
si.si_fd = fd;
464-
if (!group_send_sig_info(signum, &si, p))
464+
if (!do_send_sig_info(signum, &si, p, true))
465465
break;
466466
/* fall-through: fall back on the old plain SIGIO signal */
467467
case 0:
468-
group_send_sig_info(SIGIO, SEND_SIG_PRIV, p);
468+
do_send_sig_info(SIGIO, SEND_SIG_PRIV, p, true);
469469
}
470470
}
471471

0 commit comments

Comments
 (0)