pussuw opened a new pull request, #8355: URL: https://github.com/apache/nuttx/pull/8355
## Summary This moves address environments from the group structure into the TCB. The reason for doing this is that the group is destroyed too soon when a process exits and this leaves the system without valid MMU mappings until the next context switch. Additionally, the way up_addrenv_select(&newenv, &oldenv); + up_addrenv_restore(&oldenv); are used to temporarily select a different address environment for a process is prone to a system crash. How? If a context switch happens between those calls, the context restore routine (call to group_addrenv(NULL);) will restore the wrong mappings (tcb->group.tg_addrenv is restored, when newenv was in use), as the logic has not been notified of this temporary change of address environments. Using sched_lock() here is not enough, as the process can block itself and then the disaster can happen again. ## Impact Affects address environment handling for every platform (ARM/RISC-V) that supports them ## Testing icicle:knsh and sabre-6quad (qemu) -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org