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

[xen stable-4.21] xen/sched: fix scheduler callback verification on init



commit 817166e73d305e5f0609888c78256d4dee42b772
Author:     Ruslan Ruslichenko <Ruslan_Ruslichenko@xxxxxxxx>
AuthorDate: Thu Oct 29 13:23:23 2026 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Oct 29 13:23:23 2026 +0100

    xen/sched: fix scheduler callback verification on init
    
    During core scheduler initialization, each registered scheduler
    is sanity tested in two steps:
    
    - it must provide required callbacks (e.g. init, do_schedule).
    - if global_init callback is present, it must succeed.
    
    If any of the steps fail, scheduler entry is cleared in global
    'schedulers' array.
    
    However, in the current implementation, if verification fails during
    the first step, the scheduler entry is cleared but verification
    sequence is not interrupted. This lead to NULL pointer dereference
    when subsequent required callbacks verified, and possible during
    the second step.
    
    The patch fixes the crashes by skipping consequent checks if one of
    the required callbacks are not present for the scheduler.
    
    Fixes: ec25b3c0261c ("xen/sched: only allow schedulers with all mandatory 
functions available")
    Signed-off-by: Ruslan Ruslichenko <Ruslan_Ruslichenko@xxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
    master commit: dd8d3dc9fab2c9fe988c682fc5de896de5c6afad
    master date: 2026-10-01 19:14:42 +0100
---
 xen/common/sched/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index f98c7411f9..714ddcc448 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -3039,6 +3039,7 @@ void __init scheduler_init(void)
             printk("scheduler %s misses .%s, dropped\n", \
                    schedulers[i]->opt_name, #f);         \
             schedulers[i] = NULL;                        \
+            continue;                                    \
         }
 
         sched_test_func(init);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21



 


Rackspace

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