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

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Nick Piggin <nickpiggin@...>
Cc: Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>, <linux-kernel@...>, <linux-mm@...>, <netdev@...>, <trond.myklebust@...>
Date: Wednesday, October 31, 2007 - 8: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, 12:04 pm)
Re: [PATCH 03/33] mm: slub: add knowledge of reserve pages, Peter Zijlstra, (Wed Oct 31, 6:42 am)
Re: [PATCH 03/33] mm: slub: add knowledge of reserve pages, Peter Zijlstra, (Wed Oct 31, 8:17 am)
Re: [PATCH 03/33] mm: slub: add knowledge of reserve pages, Peter Zijlstra, (Wed Oct 31, 8:54 am)
Re: [PATCH 03/33] mm: slub: add knowledge of reserve pages, Peter Zijlstra, (Wed Oct 31, 9:08 am)