lkml.org 
[lkml]   [2017]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.9 057/104] lkdtm: Fix Oops when unloading the module
    Date
    4.9-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Juerg Haefliger <juerg.haefliger@hpe.com>


    [ Upstream commit 9ba60573638e2006170ebcc5489fb1e068afbc8f ]

    No jprobe is registered when the module is loaded without specifying a
    crashpoint that uses a jprobe. At the moment, we unconditionally try to
    unregister the jprobe on module unload which results in an Oops. Add a
    check to fix this.

    Signed-off-by: Juerg Haefliger <juerg.haefliger@hpe.com>
    Acked-by: Kees Cook <keescook@chromium.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/misc/lkdtm_core.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    --- a/drivers/misc/lkdtm_core.c
    +++ b/drivers/misc/lkdtm_core.c
    @@ -533,7 +533,9 @@ static void __exit lkdtm_module_exit(voi
    /* Handle test-specific clean-up. */
    lkdtm_usercopy_exit();

    - unregister_jprobe(lkdtm_jprobe);
    + if (lkdtm_jprobe != NULL)
    + unregister_jprobe(lkdtm_jprobe);
    +
    pr_info("Crash point unregistered\n");
    }


    \
     
     \ /
      Last update: 2017-10-06 10:55    [W:4.466 / U:0.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site