Re: [PATCH 03/33] mm: slub: add knowledge of reserve pages

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Peter Zijlstra
Date: Wednesday, October 31, 2007 - 5:17 am

On Wed, 2007-10-31 at 21:46 +1100, Nick Piggin wrote:
tion
d.

The problem with that is that once a slab was allocated with the right
allocation context, anybody can get objects from these slabs.


low memory, and empty slab:

task A                        task B

kmem_cache_alloc() =3D NULL

                              current->flags |=3D PF_MEMALLOC
                              kmem_cache_alloc() =3D obj
                              (slab !=3D NULL)

kmem_cache_alloc() =3D obj
kmem_cache_alloc() =3D obj
kmem_cache_alloc() =3D obj


And now task A, who doesn't have the right permissions walks
away with all our reserve memory.

So we either reserve a page per object, which for 32 byte objects is a
large waste, or we stop anybody who doesn't have the right permissions
from obtaining objects. I took the latter approach.
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 03/33] mm: slub: add knowledge of reserve pages, Peter Zijlstra, (Tue Oct 30, 9:04 am)
Re: [PATCH 03/33] mm: slub: add knowledge of reserve pages, Peter Zijlstra, (Wed Oct 31, 3:42 am)
Re: [PATCH 03/33] mm: slub: add knowledge of reserve pages, Peter Zijlstra, (Wed Oct 31, 5:17 am)
Re: [PATCH 03/33] mm: slub: add knowledge of reserve pages, Peter Zijlstra, (Wed Oct 31, 5:54 am)
Re: [PATCH 03/33] mm: slub: add knowledge of reserve pages, Peter Zijlstra, (Wed Oct 31, 6:08 am)