Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning

Christoph Lameter
2007-06-01T20:47:32Z

On Fri, 1 Jun 2007, Jeremy Fitzhardinge wrote:

> I think this is a good example of why having to special-case kmalloc(0)
> is a bad idea. The original code was straightforward and, barring
> silliness, should be completely correct with npids==0. This new code
> does nothing other than make things more complex.

Hehe we got you. The code is indexing the pidarray allocated with
kmalloc(0). So it uncovered a latent bug. It only worked because SLAB gave
him 32 bytes and it now only works because SLUB give him 8. That is enough
to illegally index the first array element.