Re: [patch 3/4 -mm] flex_array: poison free elements

From: Dave Hansen
Date: Mon Aug 24 2009 - 17:17:21 EST


On Mon, 2009-08-24 at 13:41 -0700, David Rientjes wrote:
> LEX_ARRAY_FREE (or an additional poison value to
> distinguish between use-uninitialized vs. use-after-free) must be used in
> flex_array_clear() otherwise the cgroup patchset, the only proposed user
> of this library code, could never shrink this array when pid's are free
> like the kmalloc vs. vmalloc patchset could do.

Are you saying that you expected it to never reallocate the array, but
have a permanent flex_array and that it just calls flex_array_clear() on
the elements that it doesn't want any more, and the array ends up
sparsely populated? I can see why we'd need a poison value in that
case.

Or, are we just talking about a situation where we need to truncate the
pidlist?

-- Dave

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/