[BUG] SMP signal dispatch seems racy
- Dominant language
- C
- Stars
- 4k
- Forks
- 1.7k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 237
Description
### Description / Steps to reproduce the issue
the signal sending logic (kill) basically does:
1. enter_critical_section
2. decide the target thread
3. check signal mask of the thread
4. make a cross call to the target cpu (nxsched_smp_call_single)
as nxsched_smp_call_single drops the critical section, there seems to be nothing to prevent the signal mask from changing in the meantime. it can end up with a signal delivered while being blocked.
similarly, the need_restore logic in sig_handler seems dangerous as it can revert unrelated changes to those fields.
### On which OS does this issue occur?
[OS: Mac]
### What is the version of your OS?
macOS 14.7
### NuttX Version
master
### Issue Architecture
[Arch: all]
### Issue Area
[Area: Kernel]
### Verification
- [X] I have verified before submitting the report.
Contributor guide
Assessment
This issue has not been assessed yet.