[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20130822164703.GA19196@redhat.com>
Date: Thu, 22 Aug 2013 18:47:03 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: Andy Lutomirski <luto@...capital.net>,
Brad Spengler <spender@...ecurity.net>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Colin Walters <walters@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: PATCH? fix unshare(NEWPID) && vfork()
On 08/21, Oleg Nesterov wrote:
>
> Still. Can't we make a single check? Like the initial patch I sent, but
> this one moves the check into copy_process() and checks CLONE_* first.
> Looks a bit simpler. And more understandable to me but this is subjective.
Seriously. CLONE_NEWPID and task_active_pid_ns() != nsproxy->pid_ns are
the same thing in this respect. Let me send the patches for review, I
decided to split this change.
> --- x/kernel/fork.c
> +++ x/kernel/fork.c
> @@ -1173,12 +1173,13 @@ static struct task_struct *copy_process(
> return ERR_PTR(-EINVAL);
>
> /*
> - * If the new process will be in a different pid namespace
> - * don't allow the creation of threads.
> + * -------------- COMMENT -----------------
> */
> - if ((clone_flags & (CLONE_VM|CLONE_NEWPID)) &&
> - (task_active_pid_ns(current) != current->nsproxy->pid_ns))
> - return ERR_PTR(-EINVAL);
> + if (clone_flags & (CLONE_SIGHAND | CLONE_PARENT)) {
> + if ((clone_flags & (CLONE_NEWUSER | CLONE_NEWPID)) ||
> + (task_active_pid_ns(current) != current->nsproxy->pid_ns))
> + return -EINVAL;
^^^^^^
should be ERR_PTR(-EINVAL)
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