[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111117183605.GA20552@redhat.com>
Date: Thu, 17 Nov 2011 19:36:05 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Pavel Emelyanov <xemul@...allels.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Alan Cox <alan@...ux.intel.com>,
Roland McGrath <roland@...k.frob.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Tejun Heo <tj@...nel.org>,
Cyrill Gorcunov <gorcunov@...nvz.org>,
James Bottomley <jbottomley@...allels.com>
Subject: Re: [PATCH 3/3] pids: Make it possible to clone tasks with given
pids
My previous objection was wrong, I should try to find something else ;)
On 11/17, Pavel Emelyanov wrote:
>
> +static int set_pidmap(struct pid_namespace *pid_ns, int pid)
> +{
> + int offset;
> + struct pidmap *map;
> +
> + /*
> + * When creating a new pid namespace we must make its init
> + * have pid == 1 in it.
> + */
> + if (pid_ns->child_reaper == NULL)
> + return 0;
> +
> + /*
> + * Don't allow to create a task with a pid which has recently
> + * belonged to some other (dead already) task. Only init (of
> + * a freshly created namespace) and his clones can do this.
> + */
> + if (pid_ns->last_pid != 1)
> + return -EPERM;
> +
> + map = &pid_ns->pidmap[pid/BITS_PER_PAGE];
probably we should check that map < PIDMAP_ENTRIES ?
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists