Re: kmemleak: Protect the seq start/next/stop sequencebyrcu_read_lock()

From: Catalin Marinas
Date: Wed Aug 12 2009 - 18:16:34 EST


On Wed, 2009-08-12 at 21:52 +0100, Ingo Molnar wrote:
> * Catalin Marinas <catalin.marinas@xxxxxxx> wrote:
>
> > kmemleak: Allow rescheduling during an object scanning
>
> i tried this in -tip testing, and it crashes quickly:
>
> [ 81.900051] BUG: unable to handle kernel paging request at ffff880020000000
> [ 81.901382] IP: [<ffffffff8112ae7e>] scan_block+0xee/0x190

It looks like my check for object->flags & OBJECT_ALLOCATED in
scan_object() may not be enough.

I'm a bit confused as the config you sent says x86_32 but the fault
address above looks like a 64 bit one (and my knowledge of x86 isn't
great). Is this x86_64?

Anyway, does the virtual address above happen to be in the vmalloc
range? The kmemleak_free() callback for vfree() is run before __vunmap()
is executed and the OBJECT_ALLOCATED bit should be cleared.

If it's not vmalloc, do you know what else could be at that virtual
address which may be unmapped without first calling kmemleak_free()?

I've been testing the patch on both x86_32 and ARM and seemed fine (more
intensively on the latter, though obviously not exactly with the same
config as yours but as close as possible).

Thanks.

--
Catalin

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/