Skip to content
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

sys/event: fix race in event_wait_multi() #21092

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

maribu
Copy link
Member

@maribu maribu commented Dec 16, 2024

Contribution description

We need to clear event->next while IRQs are still disabled to avoid another thread from calling event_cancel() just in-between.

Testing procedure

This will be almost impossible to trigger, as the timing window to trigger than race is pretty narrow.

But the code change is rather trivial and functional regressions will be detected by the CI.

So we have to resort to reasoning about the code here.

Issues/PRs references

None

We need to clear `event->next` while IRQs are still disabled to
avoid another thread from calling `event_cancel()` just in-between.
@maribu maribu added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Dec 16, 2024
@maribu maribu requested a review from kaspar030 as a code owner December 16, 2024 19:14
@github-actions github-actions bot added the Area: sys Area: System label Dec 16, 2024
@riot-ci
Copy link

riot-ci commented Dec 16, 2024

Murdock results

✔️ PASSED

c5ff57c sys/event: fix race in event_wait_multi()

Success Failures Total Runtime
10249 0 10249 15m:33s

Artifacts

@benpicco benpicco added this pull request to the merge queue Dec 16, 2024
Merged via the queue into RIOT-OS:master with commit 679ac92 Dec 16, 2024
28 checks passed
@MrKevinWeiss MrKevinWeiss added this to the Release 2025.01 milestone Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants