[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] xen: don't longjmp() after domain_crash() in check_wakeup_from_wait()



commit 3ef59a85411eb7391876bed6f5c7541126e2de25
Author:     Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Mon Jul 29 06:36:24 2019 +0200
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Mon Jul 29 13:31:03 2019 +0100

    xen: don't longjmp() after domain_crash() in check_wakeup_from_wait()
    
    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@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/common/wait.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/common/wait.c b/xen/common/wait.c
index 3fc5f68611..24716e7676 100644
--- a/xen/common/wait.c
+++ b/xen/common/wait.c
@@ -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();
     }
 
     /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.