[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5jL=tBcpoHx6vDetPSwB2CewwqOJNbVr=DJTbXJFXPVLDw@mail.gmail.com>
Date: Thu, 19 Jan 2017 14:03:11 -0800
From: Kees Cook <keescook@...omium.org>
To: Juerg Haefliger <juerg.haefliger@....com>,
Greg KH <gregkh@...uxfoundation.org>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] lkdtm: Fix Oops when unloading the module
On Thu, Jan 19, 2017 at 2:40 AM, Juerg Haefliger
<juerg.haefliger@....com> wrote:
> 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@....com>
Ah-ha, nice catch, thanks!
Acked-by: Kees Cook <keescook@...omium.org>
Greg, can you please add this to your tree when you get a chance?
-Kees
> ---
> drivers/misc/lkdtm_core.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/misc/lkdtm_core.c b/drivers/misc/lkdtm_core.c
> index 7eeb71a75549..4d44084071d8 100644
> --- a/drivers/misc/lkdtm_core.c
> +++ b/drivers/misc/lkdtm_core.c
> @@ -535,7 +535,9 @@ static void __exit lkdtm_module_exit(void)
> /* 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");
> }
>
> --
> 2.11.0
>
--
Kees Cook
Nexus Security
Powered by blists - more mailing lists