nucleus: Fix migration race in schedule_linux_call
PATCH 1/1 nucleus: Fix migration race in schedule_linux_call
schedule_linux_call may also be invoked over preemptible, thus migratable Linux contexts. Therefore we must not read the CPU number outside the splhigh/splexit section.
Signed-off-by Jan Kiszka <[email protected]>
--- ksrc/nucleus/shadow.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
ksrc/nucleus/shadow.c +2 -1
@@ -820,7 +820,7 @@ static void lostage_handler(void *cookie)static void schedule_linux_call (int type,struct task_struct *p,int arg) { -int cpu =rthal_processor_id (), reqnum; +int cpu, reqnum;struct __lostagerq *rq;spl_t s;
@@ -832,6 +832,7 @@ static void schedule_linux_call(int type, struct task_struct *p, int arg)splhigh (s); + cpu =rthal_processor_id (); rq = &lostagerq[cpu]; reqnum = rq->in; rq->in = (reqnum +1 ) & (LO_MAX_REQUESTS -1 );
Signature · 1 line
1.7.3.4