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

[xen stable-4.18] xen/arinc653: call xfree() with local IRQ enabled



commit 7dc271d2e6efe7252562a96149d0857538a124f3
Author:     Anderson Choi <anderson.choi@xxxxxxxxxx>
AuthorDate: Thu Mar 20 13:35:40 2025 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Mar 20 13:35:40 2025 +0100

    xen/arinc653: call xfree() with local IRQ enabled
    
    xen panic is observed with the following configuration.
    
    1. Debug xen build (CONFIG_DEBUG=y)
    2. dom1 of an ARINC653 domain
    3. shutdown dom1 with xl command
    
    $ xl shutdown <domain_name>
    
    (XEN) ****************************************
    (XEN) Panic on CPU 2:
    (XEN) Assertion '!in_irq() && (local_irq_is_enabled() || num_online_cpus() 
<= 1)' failed at common/xmalloc_tlsf.c:714
    (XEN) ****************************************
    
    panic was triggered since xfree() was called with local IRQ disabled and
    therefore assertion failed.
    
    Fix this by calling xfree() after local IRQ is enabled.
    
    Fixes: 19049f8d796a sched: fix locking in a653sched_free_vdata()
    Signed-off-by: Anderson Choi <anderson.choi@xxxxxxxxxx>
    Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
    Acked-by: Nathan Studer <nathan.studer@xxxxxxxxxxxxxxx>
    master commit: 3ee55c9543fcf0b35593f030b53f56f3222046b7
    master date: 2025-03-19 16:44:00 +0000
---
 xen/common/sched/arinc653.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index 9ebae6d7ae..930361fa5c 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -463,10 +463,11 @@ a653sched_free_udata(const struct scheduler *ops, void 
*priv)
     if ( !is_idle_unit(av->unit) )
         list_del(&av->list);
 
-    xfree(av);
     update_schedule_units(ops);
 
     spin_unlock_irqrestore(&sched_priv->lock, flags);
+
+    xfree(av);
 }
 
 /**
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18



 


Rackspace

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