nuttx/arch/x86_64
raiden00pl dcca9a4735 arch/intel64: don't touch the outgoing stack after releasing the csection
up_switch_context() and up_exit() released the critical section and then
kept using the outgoing task's stack: a call/ret through
nxsched_switch_context() and the call into x86_64_fullcontextrestore().
Once the lock is released the outgoing task can be woken and run by
another CPU on that same stack, so those accesses race with it.

Release the critical section as the last step and enter
x86_64_fullcontextrestore() with a jmp so nothing is read from or
written to the outgoing stack after the release.

Assisted-by: Claude Code
Signed-off-by: raiden00pl <raiden00@railab.me>
2026-09-15 11:39:05 -03:00
..
include arch/atomic: remove up_testset in spinlock 2026-09-08 08:58:54 +08:00
src arch/intel64: don't touch the outgoing stack after releasing the csection 2026-09-15 11:39:05 -03:00
CMakeLists.txt arch/x86_64: migrate to SPDX identifier 2024-12-02 17:23:25 +08:00
Kconfig arch/x86_64: add support for xAPIC 2026-09-02 18:22:34 +08:00