Page MenuHomeFreeBSD

linux: fix FreeBSD to Linux signal conversion
Needs ReviewPublic

Authored by • nprice on Tue, Oct 13, 3:44 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 14, 9:43 AM
Unknown Object (File)
Wed, Oct 14, 5:14 AM
Unknown Object (File)
Wed, Oct 14, 12:42 AM
Unknown Object (File)
Tue, Oct 13, 8:13 PM
Unknown Object (File)
Tue, Oct 13, 4:56 PM
Unknown Object (File)
Tue, Oct 13, 4:52 PM
Unknown Object (File)
Tue, Oct 13, 3:38 PM
Unknown Object (File)
Tue, Oct 13, 2:33 PM
Subscribers

Details

Reviewers
nick_spun.io
Summary

bsd_to_linux_signal() mapped every FreeBSD signal above 31 except the
SIGPWR stand-in as a real-time signal: SIGTHR became -1, 34..64
aliased Linux 1..31, and 99..126 exceeded LINUX_SIGRTMAX. Signal 0
indexed the table at -1. bsd_to_linux_sigset() shifted by these, so
linprocfs showed Linux signal 63 caught by every native threaded
process, and PR_GET_PDEATHSIG with no signal set read before the
table. Found with KUBSAN.

Return 0 for these, as the table already does for SIGEMT and SIGINFO.
A child killed by one would then read as exit status 0 in its wait
status and SIGCHLD siginfo, so report SIGKILL there.

siginfo_to_lsiginfo() also left si_status unconverted for CLD_DUMPED
and CLD_TRAPPED, so a core dump on SIGBUS reported Linux SIGUSR1.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 78113
Build 74996: arc lint + arc unit