Messages in this thread | | | Date | Wed, 24 Mar 2010 16:10:12 -0500 (CDT) | From | Christoph Lameter <> | 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.
| |