]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
compat: Fix RT signal mask corruption via sigprocmask
authorJan Kiszka <jan.kiszka@siemens.com>
Thu, 10 May 2012 13:04:36 +0000 (10:04 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 May 2012 17:46:23 +0000 (10:46 -0700)
commit1eb1d7fb4ff9b25dd152167d05d44f1e442f8d48
treee0bc7cf7d6f45784bb5b4fc47e13f6465191ed6d
parent4c7a674cc364f699fa5b6a6176c6cff4f586e607
compat: Fix RT signal mask corruption via sigprocmask

commit b7dafa0ef3145c31d7753be0a08b3cbda51f0209 upstream.

compat_sys_sigprocmask reads a smaller signal mask from userspace than
sigprogmask accepts for setting.  So the high word of blocked.sig[0]
will be cleared, releasing any potentially blocked RT signal.

This was discovered via userspace code that relies on get/setcontext.
glibc's i386 versions of those functions use sigprogmask instead of
rt_sigprogmask to save/restore signal mask and caused RT signal
unblocking this way.

As suggested by Linus, this replaces the sys_sigprocmask based compat
version with one that open-codes the required logic, including the merge
of the existing blocked set with the new one provided on SIG_SETMASK.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/compat.c