Bug 141327 - Signal masking errors when handler aborted due to bogus altstack
Signal masking errors when handler aborted due to bogus altstack
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ric Wheeler
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-11-30 09:48 EST by Ric Wheeler
Modified: 2012-06-20 09:25 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 09:25:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Test program (from Bodo Stroesser) (4.74 KB, text/plain)
2004-11-30 09:51 EST, David Woodhouse
no flags Details
Proposed fix for ppc64. (4.64 KB, patch)
2004-11-30 10:01 EST, David Woodhouse
no flags Details | Diff

  None (edit)
Description David Woodhouse 2004-11-30 09:48:58 EST
User-Agent:       
Build Identifier: 

Run attached test program. It shows that although we mask out certain signals in
preparation for running a signal handler, we don't restore the signal mask when
we find that the alternate stack for the handler isn't valid and force a SEGV:
 
Installing signal handler for SIGSEGV, sa_mask = full mask - SIGUSR1
Installing signal handler for SIGALRM, SA_ONSTACK with invalid stack, sa_mask =
full mask - SIGUSR1
 
 
===== Test 1: signal SIGALRM while waiting in sigsuspend() =====
 
Unblocking all signals
Calling alarm(2)
Calling sigsuspend( emptyset + SIGUSR1)
After return from sigsuspend(), blocked all signals, saved returned mask
OK: sigsuspend(): Interrupted system call
OK: sighandler for SIGALRM (14) didn't run (invalid stack)
ERROR: SIGSEGV is masked at end of test
ERROR: sighandler for SIGSEGV (11) didn't run
ERROR: SIGUSR1 is masked
ERROR: SIGUSR2 is masked
SIGSEGV is pending at end of test, unblocking it now ...
Signal 11 caught
... done
 
 
===== Test 2: signal SIGALRM while waiting in nanosleep() =====
 
Unblocking all signals
Calling alarm(2)
Calling nanosleep( 20s)
After return from nanosleep(), blocked all signals, saved returned mask
OK: nanosleep(): Interrupted system call
OK: sighandler for SIGALRM (14) didn't run (invalid stack)
ERROR: SIGSEGV is masked at end of test
ERROR: sighandler for SIGSEGV (11) didn't run
ERROR: SIGUSR1 is masked
ERROR: SIGUSR2 is masked
SIGSEGV is pending at end of test, unblocking it now ...
Signal 11 caught
... done
 
 
Test ended with errors


Reproducible: Always
Steps to Reproduce:
Comment 1 David Woodhouse 2004-11-30 09:51:50 EST
Created attachment 107626 [details]
Test program (from Bodo Stroesser)
Comment 2 David Woodhouse 2004-11-30 10:01:29 EST
Created attachment 107627 [details]
Proposed fix for ppc64.
Comment 3 Ernie Petrides 2004-12-02 22:39:14 EST
David Woodhouse, is this bug being reported on RHEL3 or RHEL4?
Comment 4 David Woodhouse 2004-12-03 06:34:34 EST
Against RHEL4; sorry. RHEL3 is differently broken -- it doesn't even
allow the test program to trap SEGV, so just dies thus:

===== Test 1: signal SIGALRM while waiting in sigsuspend() =====

Unblocking all signals
Calling alarm(2)
Calling sigsuspend( emptyset + SIGUSR1)
Segmentation fault
Comment 11 Jiri Pallich 2012-06-20 09:25:44 EDT
Thank you for submitting this issue for consideration in Red Hat Enterprise Linux. The release for which you requested us to review is now End of Life. 
Please See https://access.redhat.com/support/policy/updates/errata/

If you would like Red Hat to re-consider your feature request for an active release, please re-open the request via appropriate support channels and provide additional supporting details about the importance of this issue.

Note You need to log in before you can comment on or make changes to this bug.