]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
xen: don't longjmp() after domain_crash() in check_wakeup_from_wait()
authorJuergen Gross <jgross@suse.com>
Mon, 29 Jul 2019 04:36:24 +0000 (06:36 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 29 Jul 2019 12:31:03 +0000 (13:31 +0100)
Continuing on the stack saved by __prepare_to_wait() on the wrong cpu
is rather dangerous.

Instead of doing so just call the scheduler again as it already is
happening in the similar case in __prepare_to_wait() when doing the
setjmp() would be wrong.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/common/wait.c

index 3fc5f68611eb14d9a2f05ee718c6fa00d06c21eb..24716e76768b7e434705d8bca8db7a723360087f 100644 (file)
@@ -196,6 +196,11 @@ void check_wakeup_from_wait(void)
     {
         gdprintk(XENLOG_ERR, "vcpu affinity lost\n");
         domain_crash(curr->domain);
+
+        /* Re-initiate scheduler and don't longjmp(). */
+        raise_softirq(SCHEDULE_SOFTIRQ);
+        for ( ; ; )
+            do_softirq();
     }
 
     /*