[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#136990: libc6: sigaction has a race condition



tags 136990 confirmed fixed-upstream
thanks

> Package: libc6
> Version: 2.2.4-7
> Severity: normal
> 
> /** 
>  *  Demonstrate race condition in glibc/linuxthreads/signal.c in
>  *  sigaction handler.
>  *
>  *  compile with gcc -g -o sa sigaction.c -lpthread
>  *
>  *  Run with ./sa
>  *
>  *  Watch it crash when pthread_signalhandler_rt tries to call a
>  *  callback funtion through a function pointer that isn't set yet.
>  *
>  *  The race condition is in linuxthreads/signals.c.  The sigaction
>  *  function registers the signal handler with the kernel *BEFORE*
> *  setting the user callback function pointer.

I confirmed this bug is apparently existed in 2.3.2.ds1-20.  However
it seems this bug was already fixed in upstream cvs:

    2003-11-04  Jakub Jelinek  <jakub@redhat.com>

        * signals.c (__pthread_sigaction): Set __sighandler[sig].old before
        __libc_sigaction if it has been one of the special values before.

It'll be fixed in the next glibc major update after sarge.  

Currently this bug is still existed, so I don't close it now.  But in
future, it'll be closed when new glibc is available.  If you notice
this bug still alive at that time, please reopen and report this bug.

Regards,
-- gotom




Reply to: