[PATCH/RFC future] nptl: reinstate SIGCANCEL/SIGSETXID safeguards

Peter Mazinger ps.m at gmx.net
Sun May 8 15:19:34 UTC 2011


-------- Original-Nachricht --------
> Datum: Sat, 07 May 2011 19:12:23 -0700
> Von: Kevin Cernekee <cernekee at gmail.com>
> An: uclibc at uclibc.org
> CC: Austin Foxley <austinf at cetoncorp.com>, Rich Felker <dalias at aerifal.cx>, Jian Peng <jipeng at broadcom.com>, Peter Mazinger <ps.m at gmx.net>, Mike Frysinger <vapier at gentoo.org>, Maksim Rayskiy <maksim.rayskiy at gmail.com>
> Betreff: [PATCH/RFC future] nptl: reinstate SIGCANCEL/SIGSETXID safeguards

> Commit 8ab3145f (remove sigaction, sigprocmask, and sigfillset from
> libpthread) removed duplicated implementations of the three aforementioned
> functions from libpthread.  However, as Rich Felker pointed out, the
> libc and libpthread versions are not always 100% identical.  A closer
> examination of the pre-8ab3145f disassemblies showed the following:
> 
> libc sigfillset() returns a full set: all 128 bits are set.  libpthread
> sigfillset() sets only 126 bits: everything except SIGCANCEL/SIGSETXID.
> 
> libpthread sigprocmask() has extra code to prevent the caller from
> blocking
> SIGCANCEL/SIGSETXID.  libc sigprocmask() does not.

If you did your tests on mips, couldn't it be, that this is influenced by the change of using kernel sigset_t size for mips on all "generic" syscall implementations (see KERNEL_SIGSET_T_SIZE macro)?

Thanks, Peter
> 
> No differences were observed in __sigaction(), since the NPTL version of
> this function was always built into libc anyway.
> 
> This patch pulls in the SIGCANCEL/SIGSETXID definitions via pthreadP.h
> when NPTL is enabled, restoring the special signal exclusions needed
> by libpthread.
> 
> Signed-off-by: Kevin Cernekee <cernekee at gmail.com>
> ---
>  libc/signal/sigfillset.c                |    4 ++++
>  libc/sysdeps/linux/common/sigprocmask.c |    4 ++++
>  2 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/libc/signal/sigfillset.c b/libc/signal/sigfillset.c
> index ef60f10..e041f08 100644
> --- a/libc/signal/sigfillset.c
> +++ b/libc/signal/sigfillset.c
> @@ -23,6 +23,10 @@
>  #include <errno.h>
>  #endif
>  
> +#ifdef __UCLIBC_HAS_THREADS_NATIVE__
> +#include <pthreadP.h>
> +#endif
> +
>  /* Set all signals in SET.  */
>  int
>  sigfillset (sigset_t *set)
> diff --git a/libc/sysdeps/linux/common/sigprocmask.c
> b/libc/sysdeps/linux/common/sigprocmask.c
> index 6230033..a60fa49 100644
> --- a/libc/sysdeps/linux/common/sigprocmask.c
> +++ b/libc/sysdeps/linux/common/sigprocmask.c
> @@ -9,6 +9,10 @@
>  
>  #include <sys/syscall.h>
>  
> +#ifdef __UCLIBC_HAS_THREADS_NATIVE__
> +#include <pthreadP.h>
> +#endif
> +
>  #if defined __USE_POSIX
>  #include <signal.h>
>  
> -- 
> 1.7.5
> 

-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de


More information about the uClibc mailing list