-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] SMP signal dispatch seems racy #14807
Comments
@hujun260 please look at this issue. |
I don't think this change caused #14749,
There are two fields: affinity and flag. The tcb->flags may undergo changes, which I can further refine. During restoration, only the TCB_FLAG_CPU_LOCKED field of tcb->flags will be restored, without altering any other fields. |
i don't understand your logic. |
Regardless of whether it crosses cores, up_schedule_sigaction will be invoked, and nxsched_smp_call_single will wait until up_schedule_sigaction has been called and returns. |
a cross call releases the critical section before calling up_schedule_sigaction. thus racy. |
The vulnerability appears to be persistent, even if up_schedule_sigaction is called immediately in critical section, |
if you mean "it isn't trivial to fix", i agree. |
yes |
Description / Steps to reproduce the issue
the signal sending logic (kill) basically does:
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
The text was updated successfully, but these errors were encountered: