Re: [PATCH] mm/kmemleak: skip late_init if not skip disable
From: Murphy Zhou
Date: Thu Oct 10 2019 - 01:03:22 EST
Hi,
On Wed, Oct 9, 2019 at 12:51 AM Catalin Marinas <catalin.marinas@xxxxxxx> wrote:
>
> Hi Murphy,
>
> On Sun, Sep 29, 2019 at 05:56:59PM +0800, Murphy Zhou wrote:
> > Now if DEFAULT_OFF set to y, kmemleak_init will start the cleanup_work
> > workqueue. Then late_init call will set kmemleak_initialized to 1, the
> > cleaup workqueue will try to do cleanup, triggering:
> >
> > [24.738773] ==================================================================
> > [24.742784] BUG: KASAN: global-out-of-bounds in __kmemleak_do_cleanup+0x166/0x180
>
> I don't think the invocation of kmemleak_do_cleanup() is the issue here.
> It should be safe schedule the clean-up thread in case kmemleak was
> disabled from boot. What you probably hit was a bug in
> __kmemleak_do_cleanup() itself, fixed here:
>
> http://lkml.kernel.org/r/20191004134624.46216-1-catalin.marinas@xxxxxxx
>
> With the above patch, I can no longer trigger the KASan warning.
Got it. Thanks for noticing!
>
> --
> Catalin