• Oleg Nesterov's avatar
    sys_delete_module() can set MODULE_STATE_GOING after · dfdcb38a
    Oleg Nesterov authored
    search_binary_handler() does try_module_get().  In this case
    set_binfmt()->try_module_get() fails but since none of the callers
    check the returned error, the task will run with the wrong old
    ->binfmt.
    
    The proper fix should change all ->load_binary() methods, but we can
    rely on fact that the caller must hold a reference to binfmt->module
    and use __module_get() which never fails.
    Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
    Cc: Rusty Russell <rusty@rustcorp.com.au>
    Cc: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
    Cc: Roland McGrath <roland@redhat.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    dfdcb38a
exec.c 44.3 KB