mirror of git://git.musl-libc.org/musl
fix errors in sigqueue (potential information leak, wrong behavior)
1. any padding in the siginfo struct was not necessarily zero-filled, so it might have contained private data off the caller's stack. 2. the uid and pid must be filled in from userspace. the previous rsyscall fix broke rsyscalls because the values were always incorrect.
This commit is contained in:
parent
52213f7341
commit
dc54a7cbb9
|
@ -5,10 +5,12 @@
|
||||||
|
|
||||||
int sigqueue(pid_t pid, int sig, const union sigval value)
|
int sigqueue(pid_t pid, int sig, const union sigval value)
|
||||||
{
|
{
|
||||||
siginfo_t si = {
|
siginfo_t si;
|
||||||
.si_signo = sig,
|
memset(&si, 0, sizeof si);
|
||||||
.si_code = -1,
|
si.si_signo = sig;
|
||||||
.si_value = value,
|
si.si_code = SI_QUEUE;
|
||||||
};
|
si.si_value = value;
|
||||||
|
si.si_pid = getpid();
|
||||||
|
si.si_uid = getuid();
|
||||||
return syscall3(__NR_rt_sigqueueinfo, pid, sig, (long)&si);
|
return syscall3(__NR_rt_sigqueueinfo, pid, sig, (long)&si);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue