summaryrefslogtreecommitdiffstats
path: root/src/sighook.c
Commit message (Collapse)AuthorAgeFilesLines
* sighook: Add some missing fatal signalsHEADmainTavian Barnes2 days1-5/+14
|
* sighook: Preserve the exact siginfo_t in reraise() on LinuxTavian Barnes2 days1-3/+16
| | | | Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=66dd34ad31e5963d72a700ec3f2449291d322921
* sighook: Always re-raise faults on macOSTavian Barnes4 days1-0/+7
| | | | | | | | | | macOS always fills in si_code for SIG{BUS,ILL,SEGV} as if it were a real hardware fault, so returning from the handler is not guaranteed to re- trigger the signal. Fixes: aecdabb ("sighook: Return instead of re-raising for faults") Link: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2386463/4/util/posix/signals_test.cc Link: https://github.com/chromium/crashpad/commit/e0d8a0aa01ac176804077f1f128ccc894c098f79
* sighook: New SH_ONESHOT flagTavian Barnes2024-12-021-1/+19
|
* sighook: Return instead of re-raising for faultsTavian Barnes2024-11-231-5/+11
| | | | | | | | | | | This makes the death look exactly like it would if we didn't handle the signal at all. Coredumps will point at the right instruction, segfaults will get logged in dmesg again, etc. Technically POSIX says this is undefined, but if we get a fault, we've already done something undefined anyway ;) Link: https://github.com/rust-lang/rust/issues/26458
* sighook: Check for SA_RESTART before using itTavian Barnes2024-11-231-1/+7
| | | | QNX doesn't support SA_RESTART.
* sighook: Don't forget to reset list->tail on the last sigpop()Tavian Barnes2024-10-101-0/+2
| | | | | | | This was causing a UAF if we ever unregistered the last hook for a signal and then re-registered one. Fixes: 75b7f70 ("sighook: Make sigunhook() O(1)")
* Fix includesTavian Barnes2024-08-291-0/+1
|
* build: Move feature test macros to prelude.hTavian Barnes2024-08-281-1/+0
| | | | | | This replaces the explicit CPPFLAGS list in flags.mk with just `-include src/prelude.h`, shortening our compiler command lines and allowing them to be easily documented.
* prelude: Split bfs-specific utilities into new bfs.h headerTavian Barnes2024-08-281-0/+3
|
* sighook: Fix typo in commentTavian Barnes2024-08-171-1/+1
|
* sighook: Disable semaphores on NetBSDTavian Barnes2024-08-111-1/+2
|
* bfstd: New sysoption() macro to check for POSIX option runtime supportTavian Barnes2024-08-091-7/+17
| | | | | | | | | | POSIX allows optional features to be supported at compile time but not necessarily at run time by defining _POSIX_OPTION to 0 and requiring users to check sysconf(_SC_OPTION) > 0. The new sysoption() macro simplifies the check. sighook() and bfs_spawn() now check for conditional runtime support for the relevant POSIX options.
* Update opengroup.org links to POSIX 2024Tavian Barnes2024-08-021-5/+5
|
* prelude: Simplify attributesTavian Barnes2024-07-281-1/+2
|
* sighook: Make sigunhook() O(1)Tavian Barnes2024-07-151-41/+51
|
* sighook: Replace sigtables with RCU-protected linked listsTavian Barnes2024-07-071-148/+68
| | | | | | | | This fixes an ABA problem where sigdispatch() could think no handlers are registered for a signal even when there are. Link: https://unix.stackexchange.com/a/779594/56202 Fixes: 375caac ("sighook: New utilities for hooking signals")
* sighook: Shard the signal tableTavian Barnes2024-06-071-7/+24
|
* sighook: Ignore sigaction() errors in atsigexit()Tavian Barnes2024-06-071-10/+6
| | | | This fixes bfs under Valgrind, which reserves SIGRTMAX for its own use.
* sighook: Check that atomic size_t is lock-freeTavian Barnes2024-06-031-0/+4
|
* sighook: Allow sigunhook(NULL)Tavian Barnes2024-05-251-0/+4
|
* diag: New helpers to include xstrerror(errno) automaticallyTavian Barnes2024-05-171-2/+2
|
* sighook: New utilities for hooking signalsTavian Barnes2024-05-161-0/+600
This allows multiple hooks to be installed for a single signal.