zyfeier opened a new pull request, #21831:
URL: https://github.com/apache/nuttx/pull/21831
## Summary
* Why: a batch of small signal fixes accumulated in our tree: an
uninitialized siginfo_t reaching sigtimedwait()/sigwaitinfo()
consumers via the kill()/tgkill() pending path, an SMP TOCTOU in
nxsig_timedwait()'s pending-set handling, POSIX compliance gaps in
siginfo_t and sigqueue(), a latent build break in the sigev_notify
macros, several Coverity implicit-conversion findings in the sleep
and poll paths, and a DEBUGASSERT that sits after the dereference
it is meant to guard.
* What: nine self-contained commits, each fixing one issue.
* How: zero the siginfo before the field assignments in the kill
paths; retry instead of assert when the pending-set snapshot is
stale under SMP; widen siginfo_t's si_signo/si_code to int and add
the const qualifier to sigqueue()'s value parameter; guard the
sigev_notify_function/attributes macros with CONFIG_SIG_EVTHREAD;
make the time conversions explicit for Coverity; move the
dispatch-argument assert ahead of its first use.
## Impact
* Is new feature added? Is existing feature changed? YES (bugfix
batch; the sigtimedwait consumer no longer observes stack garbage
in unassigned siginfo fields for kill-originated signals)
* Impact on user? NO
* Impact on build? NO (the sigev guard only fixes a latent break
for !CONFIG_SIG_EVTHREAD users of the macros; existing configs
are unaffected)
* Impact on hardware? NO
* Impact on documentation? NO
* Impact on security? NO
* Impact on compatibility? NO (the sigqueue() const and the
siginfo_t field widening are source-compatible; the syscall table
keeps the unqualified union form so stub generation is unchanged)
## Testing
I confirm that changes are verified on local setup and works as intended:
* Build Host(s): Linux x86_64, GCC; CI docker image
ghcr.io/apache/nuttx/apache-nuttx-ci-linux:latest (riscv-none-elf)
* Target(s): sim:ostest (KASAN, LOOPS=5), qemu-armv8a:nsh_smp (SMP,
ostest + smp), smartl-c906:knsh (kernel build with
CONFIG_LIB_SYSCALL=y, covering syscall stub regeneration)
Testing logs (build, smartl-c906:knsh kernel + user space):
```
IN: libs/libc/libc.a -> staging/libc.a
CC: c906_userspace.c
LD: nuttx_user.elf
```
Testing logs (build, sim:ostest):
```
SIM elf with dynamic libs archive in nuttx.tgz
```
Testing logs (runtime, qemu-armv8a:nsh_smp):
```
user_main: Exiting
ostest_main: Exiting with status 0
Main[0]: Thread 8 completed with result=0
```
Testing logs (runtime, sim:ostest with KASAN):
```
ostest_main: Exiting with status 0
```
Feature-specific verification: this is a mixed bugfix bundle with no
single new user-facing feature to demonstrate; the siginfo and TOCTOU
fixes are exercised by the full ostest signal paths and the SMP test
above.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]