[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1003241608270.16858@router.home>
Date: Wed, 24 Mar 2010 16:10:12 -0500 (CDT)
From: Christoph Lameter <cl@...ux-foundation.org>
To: Eric Dumazet <eric.dumazet@...il.com>
cc: Pekka J Enberg <penberg@...helsinki.fi>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] slub: Potential stack overflow
On Wed, 24 Mar 2010, Eric Dumazet wrote:
> @@ -3651,16 +3654,19 @@ static void process_slab(struct loc_track *t, struct kmem_cache *s,
> struct page *page, enum track_item alloc)
> {
> void *addr = page_address(page);
> - DECLARE_BITMAP(map, page->objects);
> + long *map = kzalloc(BITS_TO_LONGS(page->objects) * sizeof(long),
> + GFP_ATOMIC);
> void *p;
>
> - bitmap_zero(map, page->objects);
> + if (!map)
> + return;
> for_each_free_object(p, s, page->freelist)
> set_bit(slab_index(p, s, addr), map);
>
> for_each_object(p, s, addr, page->objects)
> if (!test_bit(slab_index(p, s, addr), map))
> add_location(t, s, get_track(s, p, alloc));
> + kfree(map);
> }
>
Hmmm... Thats another case. We should alloate the map higher up there I
guess and pass the address in so that one allocation can be used for all
slabs. validate_slab_cache() does that.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists