]> xenbits.xensource.com Git - xen.git/commit
sched: fix scheduler_disable() with core scheduling
authorSergey Dyasli <sergey.dyasli@citrix.com>
Mon, 27 Apr 2020 13:00:08 +0000 (15:00 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 27 Apr 2020 13:00:08 +0000 (15:00 +0200)
commit2169029b0e5c9a3d4dd19f9b10b10ef848881bb4
tree4ff9376c536842d320acab64f4cc9ee7bb588f91
parenta319cbb3071919935d2424b0b116b22bcf028452
sched: fix scheduler_disable() with core scheduling

In core-scheduling mode, Xen might crash when entering ACPI S5 state.
This happens in sched_slave() during is_idle_unit(next) check because
next->vcpu_list is stale and points to an already freed memory.

This situation happens shortly after scheduler_disable() is called if
some CPU is still inside sched_slave() softirq. Current logic simply
returns prev->next_task from sched_wait_rendezvous_in() which causes
the described crash because next_task->vcpu_list has become invalid.

Fix the crash by returning NULL from sched_wait_rendezvous_in() in
the case when scheduler_disable() has been called.

Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>
master commit: 82dd1a956d9b68f52e830d1dddfdfb4ab4d5a638
master date: 2020-04-17 09:28:16 +0200
xen/common/schedule.c