newrt select() implementation vulnerable to scheduler/task environment race #8347
Labels
A-concurrency
Area: Concurrency
A-runtime
Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows
I-crash
Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
As outlined in #8132.
In this case the race is around ready_index. Here is the closure:
Since we are letting any one of the ports wake the task, the access of
ready_index
has the potential to clobber arbitrary values on the task's stack.This can't be fixed just by reordering accesses, since this is in a loop, the select implementation needs to be able to write to ready_index after storing the task handle in previous ports.
The text was updated successfully, but these errors were encountered: