lkml.org 
[lkml]   [2021]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.10 026/121] xen: dont continue xenstore initialization in case of errors
    Date
    From: Stefano Stabellini <stefano.stabellini@xilinx.com>

    commit 08f6c2b09ebd4b326dbe96d13f94fee8f9814c78 upstream.

    In case of errors in xenbus_init (e.g. missing xen_store_gfn parameter),
    we goto out_error but we forget to reset xen_store_domain_type to
    XS_UNKNOWN. As a consequence xenbus_probe_initcall and other initcalls
    will still try to initialize xenstore resulting into a crash at boot.

    [ 2.479830] Call trace:
    [ 2.482314] xb_init_comms+0x18/0x150
    [ 2.486354] xs_init+0x34/0x138
    [ 2.489786] xenbus_probe+0x4c/0x70
    [ 2.498432] xenbus_probe_initcall+0x2c/0x7c
    [ 2.503944] do_one_initcall+0x54/0x1b8
    [ 2.507358] kernel_init_freeable+0x1ac/0x210
    [ 2.511617] kernel_init+0x28/0x130
    [ 2.516112] ret_from_fork+0x10/0x20

    Cc: <Stable@vger.kernel.org>
    Cc: jbeulich@suse.com
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
    Link: https://lore.kernel.org/r/20211115222719.2558207-1-sstabellini@kernel.org
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/xen/xenbus/xenbus_probe.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    --- a/drivers/xen/xenbus/xenbus_probe.c
    +++ b/drivers/xen/xenbus/xenbus_probe.c
    @@ -846,7 +846,7 @@ static struct notifier_block xenbus_resu

    static int __init xenbus_init(void)
    {
    - int err = 0;
    + int err;
    uint64_t v = 0;
    xen_store_domain_type = XS_UNKNOWN;

    @@ -920,8 +920,10 @@ static int __init xenbus_init(void)
    */
    proc_create_mount_point("xen");
    #endif
    + return 0;

    out_error:
    + xen_store_domain_type = XS_UNKNOWN;
    return err;
    }


    \
     
     \ /
      Last update: 2021-11-29 23:45    [W:4.247 / U:0.232 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site