Re: [RFC PATCH 5/8] KEYS: exec request-key within the requesting task's init namespace

From: David Howells
Date: Thu Feb 05 2015 - 10:14:42 EST


Ian Kent <ikent@xxxxxxxxxx> wrote:

> +#include <linux/fs.h>

Is that actually needed?

> + rki = kmalloc(sizeof(*rki), GFP_KERNEL);
> + if (!rki)
> + return -ENOMEM;
> +
> + if (use_ns) {
> + tsk = umh_get_init_pid();
> + if (IS_ERR(tsk))
> + return PTR_ERR(tsk);

Memory leak of rki.

> + /* If running within a container use the container namespace */
> + if (current->nsproxy->net_ns != &init_net)

Is that a viable check? Is it possible to have a container that shares
networking details?

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/