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

From: Roland Dreier
Date: Mon Mar 28 2011 - 16:27:58 EST


On Mon, Mar 28, 2011 at 10:42 AM, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> I am starting to think that "plan B" was better.
>
>        if (info.si_code >= 0 || info.si_code == SI_TKILL)
>                return -EPERM;

Indeed. Grepping further in glibc finds sysdeps/unix/sysv/linux/aio_sigqueue.c:

/* We must pass the information about the data in a siginfo_t
value. */
info.si_signo = timer->event.sigev_signo;
info.si_code = SI_TIMER;
info.si_pid = timer->creator_pid;
info.si_uid = getuid ();
info.si_value = timer->event.sigev_value;

INLINE_SYSCALL (rt_sigqueueinfo, 3, info.si_pid, info.si_signo, &info);

and sysdeps/unix/sysv/linux/gai_sigqueue.c:

/* We must pass the information about the data in a siginfo_t value. */
info.si_signo = sig;
info.si_code = SI_ASYNCNL;
info.si_pid = caller_pid;
info.si_uid = __getuid ();
info.si_value = val;

return INLINE_SYSCALL (rt_sigqueueinfo, 3, info.si_pid,
sig, __ptrvalue (&info));

where SI_ASYNCNL is -60, which the kernel doesn't know about.

Updated patch coming in a minute.

Thanks,
Roland
--
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/