Page MenuHomeFreeBSD

libthr: prevent setcontext() from masking SIGTHR
ClosedPublic

Authored by vangyzen on May 26 2017, 2:28 PM.
Tags
None
Referenced Files
F146002145: D10933.id.diff
Thu, Feb 26, 10:21 PM
Unknown Object (File)
Sun, Feb 1, 5:09 PM
Unknown Object (File)
Jan 16 2026, 2:46 PM
Unknown Object (File)
Jan 7 2026, 9:37 PM
Unknown Object (File)
Jan 6 2026, 10:42 AM
Unknown Object (File)
Dec 30 2025, 5:28 PM
Unknown Object (File)
Dec 11 2025, 12:45 PM
Unknown Object (File)
Dec 1 2025, 7:04 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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

lib/libthr/thread/thr_sig.c
740 ↗(On Diff #28854)

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.