Changeset 8b922aa in rtems


Ignore:
Timestamp:
Apr 5, 2016, 4:58:16 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
9ea69dee
Parents:
3c895256
git-author:
Sebastian Huber <sebastian.huber@…> (04/05/16 04:58:16)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/06/16 07:08:21)
Message:

posix: Fix _POSIX_signals_Check_signal()

Do not save and restore the thread wait information. This is
superfluous and may overwrite thread wait information updates due to
interrupts leading to system corruption.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/src/psignal.c

    r3c895256 r8b922aa  
    114114)
    115115{
    116   siginfo_t                   siginfo_struct;
    117   sigset_t                    saved_signals_unblocked;
    118   Thread_Wait_information     stored_thread_wait_information;
    119   Thread_Control             *executing;
     116  siginfo_t siginfo_struct;
     117  sigset_t  saved_signals_unblocked;
    120118
    121119  if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
     
    143141  saved_signals_unblocked = api->signals_unblocked;
    144142  api->signals_unblocked &= ~_POSIX_signals_Vectors[ signo ].sa_mask;
    145 
    146   executing = _Thread_Get_executing();
    147 
    148   /*
    149    *  We have to save the blocking information of the current wait queue
    150    *  because the signal handler may subsequently go on and put the thread
    151    *  on a wait queue, for its own purposes.
    152    */
    153   memcpy( &stored_thread_wait_information, &executing->Wait,
    154           sizeof( stored_thread_wait_information ));
    155143
    156144  /*
     
    171159
    172160  /*
    173    *  Restore the blocking information
    174    */
    175   memcpy( &executing->Wait, &stored_thread_wait_information,
    176           sizeof( executing->Wait ));
    177 
    178   /*
    179161   *  Restore the previous set of unblocked signals
    180162   */
     
    210192  if ( !api )
    211193    return;
     194
     195  /*
     196   *  In case the executing thread is blocked or about to block on something
     197   *  that uses the thread wait information, then this is a kernel bug.
     198   */
     199  _Assert(
     200    ( _Thread_Wait_flags_get( executing )
     201      & ( THREAD_WAIT_STATE_BLOCKED | THREAD_WAIT_STATE_INTEND_TO_BLOCK ) ) == 0
     202  );
    212203
    213204  /*
Note: See TracChangeset for help on using the changeset viewer.