[rsbac] bug in rsbac_kmalloc() ?

Amon Ott ao at rsbac.org
Mon May 24 12:48:55 CEST 2004

On Montag, 10. Mai 2004 14:18, Michal Purzynski wrote:
> looking at rsbac_kmalloc() implementation, i see that memory in case of 
2.6 kernel is allocated like this:
> kmem_cache_alloc(csizep->cs_cachep, 0)
> so flags are `0`. i think it is bad - with preempt turned on flags should 
be GFP_ATOMIC. now with `0` flags rsbac_kmalloc() is allowed to sleep, 
what can lead to `bad: scheduling while atomic` errors in case of 
allocating memory between spinlocks.
> i am going to test it with GFP_ATOMIC, and will tell about results.

Any results yet? I will also test with GFP_ATOMIC, but I think I remember 
that ATOMIC also checks for locks held. Nasty changes in 2.6.

The 0 was meant to avoid the check and the sleeping, but I might have 

http://www.rsbac.org - GnuPG: 2048g/5DEAAA30 2002-10-22

More information about the rsbac mailing list