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

[xen staging] arinc653: overwrite entire .dom_handle[] for Dom0 slots



commit 2a0ee29f5e6441b3c977ae8862842fd7c4da79d3
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Mar 26 10:47:08 2026 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Mar 26 10:47:08 2026 +0100

    arinc653: overwrite entire .dom_handle[] for Dom0 slots
    
    When that code still lived in a653sched_init(), it was redundant with the
    earlier memset() / xzalloc(). Once moved, the full structure field needs
    setting, as dom_handle_cmp() uses memcmp() and arinc653_sched_set() may
    have clobbered entries. Rather than implying the handle to be all zero,
    copy the handle out of the domain structure.
    
    Fixes: 9f0c658baedc ("arinc: add cpu-pool support to scheduler")
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
    Reviewed-by: Stewart Hildebrand <stewart@xxxxxxx>
---
 xen/common/sched/arinc653.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index 8a4f4259d8..bde15eb7e1 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -420,7 +420,9 @@ a653sched_alloc_udata(const struct scheduler *ops, struct 
sched_unit *unit,
 
         if ( entry < ARINC653_MAX_DOMAINS_PER_SCHEDULE )
         {
-            sched_priv->schedule[entry].dom_handle[0] = '\0';
+            memcpy(sched_priv->schedule[entry].dom_handle,
+                   unit->domain->handle,
+                   sizeof(sched_priv->schedule->dom_handle));
             sched_priv->schedule[entry].unit_id = unit->unit_id;
             sched_priv->schedule[entry].runtime = DEFAULT_TIMESLICE;
             sched_priv->schedule[entry].unit = unit;
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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