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

[xen stable-4.20] xen/domain: fail vcpu_create() if init_waitqueue_vcpu() fails



commit 9edb231fe0b8f371c2142eefa8ef10790d1f9db6
Author:     Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Wed Nov 25 14:43:59 2026 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Nov 25 14:43:59 2026 +0100

    xen/domain: fail vcpu_create() if init_waitqueue_vcpu() fails
    
    init_waitqueue_vcpu() can fail in case of memory shortage. Don't let
    vcpu_create() succeed in this case.
    
    As destroy_waitqueue_vcpu() is tolerating a NULL waitqueue_vcpu, just
    reuse the existing fail_wq label.
    
    Fixes: 9b231b6bc20b ("Wait queues, allowing conditional sleep in hypervisor 
context.")
    Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    master commit: 71054bcc148741d220430b43547dc7f3b82d5122
    master date: 2026-11-25 09:44:26 +0100
---
 xen/common/domain.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index c6f52bcb8f..6839702144 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -315,7 +315,8 @@ struct vcpu *vcpu_create(struct domain *d, unsigned int 
vcpu_id)
         v->runstate.state_entry_time = NOW();
         set_bit(_VPF_down, &v->pause_flags);
         vcpu_info_reset(v);
-        init_waitqueue_vcpu(v);
+        if ( init_waitqueue_vcpu(v) != 0 )
+            goto fail_wq;
 
         if ( vmtrace_alloc_buffer(v) != 0 )
             goto fail_wq;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20



 


Rackspace

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