Re: [PATCH] Allow rt_sigqueueinfo and rt_tgsigqueueinfo to usesi_code == SI_ASYNCIO

From: Oleg Nesterov
Date: Mon Mar 28 2011 - 14:52:36 EST


On 03/28, Roland Dreier wrote:
>
> Commit da48524eb206 ("Prevent rt_sigqueueinfo and rt_tgsigqueueinfo
> from spoofing the signal code") made the check on si_code too strict:
> glibc's aio implementation wants to queue signals with SI_ASYNCIO, and
> indeed glibc's tst-aio4 fails with the patched kernel.
>
> Fix this by loosening the new check to allow SI_ASYNCIO as well.

Heh.

> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -2437,7 +2437,7 @@ SYSCALL_DEFINE3(rt_sigqueueinfo, pid_t, pid, int, sig,
> /* Not even root can pretend to send signals from the kernel.
> * Nor can they impersonate a kill()/tgkill(), which adds source info.
> */
> - if (info.si_code != SI_QUEUE) {
> + if (info.si_code != SI_QUEUE && info.si_code != SI_ASYNCIO) {

I am starting to think that "plan B" was better.

if (info.si_code >= 0 || info.si_code == SI_TKILL)
return -EPERM;

Although we should probably keep WARN_ON_ONCE() anyway.

Oleg.

--
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/