public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nptl/14147] New: Async cancellation left active after longjmp out of signal handler
@ 2012-05-23 19:50 bugdal at aerifal dot cx
  2014-01-10 20:25 ` [Bug nptl/14147] " carlos at redhat dot com
  2014-06-25 10:56 ` fweimer at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: bugdal at aerifal dot cx @ 2012-05-23 19:50 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=14147

             Bug #: 14147
           Summary: Async cancellation left active after longjmp out of
                    signal handler
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nptl
        AssignedTo: unassigned@sourceware.org
        ReportedBy: bugdal@aerifal.cx
                CC: drepper.fsp@gmail.com
    Classification: Unclassified


If a signal handler interrupts a function which is async-signal-safe, it's
valid to exit the signal handler with longjmp. Suppose the interrupted function
is also a cancellation point. Due to NPTL's implementation of cancellation
points (switch to async cancellation mode, invoke the syscall, switch back),
the cancellation mode will get left as asynchronous, contrary to the
expectations of a conforming application, and subsequent code that is not
async-cancellation-safe will get run with async cancellation, possibly causing
severe memory corruption when a cancellation request arrives.

This bug is related to bug #12683 (also reported by me), but I'm reporting it
separately because it's not a rare race condition but breakage in a specific
usage case that will occur without any race.

Fixing all of these issues requires abandoning the naive approach of wrapping
syscalls in switches to/from async cancellation mode, and instead having the
cancellation signal handler check (via program counter comparison, either
directly or using whatever fancy DWARF stuff is popular) to determine whether
the interrupted thread was blocked at a cancellation point, and thus whether to
act on cancellation.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug nptl/14147] Async cancellation left active after longjmp out of signal handler
  2012-05-23 19:50 [Bug nptl/14147] New: Async cancellation left active after longjmp out of signal handler bugdal at aerifal dot cx
@ 2014-01-10 20:25 ` carlos at redhat dot com
  2014-06-25 10:56 ` fweimer at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: carlos at redhat dot com @ 2014-01-10 20:25 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=14147

Carlos O'Donell <carlos at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |carlos at redhat dot com
         Depends on|                            |12683

--- Comment #1 from Carlos O'Donell <carlos at redhat dot com> ---
I'm marking this as dependent on 12683 since a solution for 12683 should
consider this bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug nptl/14147] Async cancellation left active after longjmp out of signal handler
  2012-05-23 19:50 [Bug nptl/14147] New: Async cancellation left active after longjmp out of signal handler bugdal at aerifal dot cx
  2014-01-10 20:25 ` [Bug nptl/14147] " carlos at redhat dot com
@ 2014-06-25 10:56 ` fweimer at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: fweimer at redhat dot com @ 2014-06-25 10:56 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=14147

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-25 10:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-23 19:50 [Bug nptl/14147] New: Async cancellation left active after longjmp out of signal handler bugdal at aerifal dot cx
2014-01-10 20:25 ` [Bug nptl/14147] " carlos at redhat dot com
2014-06-25 10:56 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).