lkml.org 
[lkml]   [2010]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.



\
 
 \ /
  Last update: 2010-03-24 22:13    [W:0.059 / U:0.880 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site