Page MenuHomeFreeBSD

libthr: prevent setcontext() from masking SIGTHR
ClosedPublic

Authored by vangyzen on May 26 2017, 2:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 21, 2:43 AM
Unknown Object (File)
Fri, Nov 21, 2:33 AM
Unknown Object (File)
Fri, Nov 21, 2:32 AM
Unknown Object (File)
Fri, Nov 21, 2:30 AM
Unknown Object (File)
Wed, Nov 19, 6:05 AM
Unknown Object (File)
Tue, Nov 18, 2:45 PM
Unknown Object (File)
Sat, Nov 15, 11:45 PM
Unknown Object (File)
Tue, Nov 11, 8:03 AM
Subscribers

Details

Summary

__thr_setcontext() mistakenly tested for the presence of SIGCANCEL
in its local ucontext_t instead of the parameter. Therefore,
if a thread calls setcontext() with a context whose signal mask
contains SIGTHR (a.k.a. SIGCANCEL), that signal will be blocked,
preventing the thread from being cancelled or suspended.

Reported by: gcc 6.1 via RISC-V tinderbox

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 9502
Build 9951: arc lint + arc unit

Event Timeline

lib/libthr/thread/thr_sig.c
740

Fix style of the next line as well, add ().

This revision is now accepted and ready to land.May 26 2017, 3:36 PM
This revision was automatically updated to reflect the committed changes.