Re: [PATCH 2/3] KEYS: Don't generate user and user session keyrings unless they're accessed

From: David Howells
Date: Thu Mar 13 2008 - 22:35:50 EST


Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:

> hm, I didn't realise that the keys code had special knowlege of "root".
> How does that play alongside the containers stuff?

The containers stuff lacks a keys container. I'll have to attend to that at
some point.

The key code didn't so much have special knowledge of root, as UID 0 is
compiled into the kernel in various ways.

> would be more conventional.
>
> But better would be to teach alloc_uid() about kmem_cache_zalloc() then
> take a chainsaw to it.

Yeah, I was thinking that. That'd allow a slew of initialisations-to-zero to
be removed from that function, as indeed you have done in your attached patch.

> From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
>
> Use kmem_cache_zalloc(), remove large amounts of initialsiation code and
> ifdeffery.

"initialisation" perchance? :-)

> Note: this assumes that memset(*atomic_t, 0) correctly initialises the
> atomic_t. This is true for all present archtiectures and if it becomes false
> for a future architecture then we'll need to make large changes all over the
> place anyway.
>
>
> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>

Acked-by: David Howells <dhowells@xxxxxxxxxx>

David
--
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/