[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191115093419.GA25528@redhat.com>
Date: Fri, 15 Nov 2019 10:34:20 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Andrei Vagin <avagin@...il.com>
Cc: Adrian Reber <areber@...hat.com>,
Christian Brauner <christian.brauner@...ntu.com>,
Eric Biederman <ebiederm@...ssion.com>,
Pavel Emelyanov <ovzxemul@...il.com>,
Jann Horn <jannh@...gle.com>,
Dmitry Safonov <0x7f454c46@...il.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
linux-kernel@...r.kernel.org, Mike Rapoport <rppt@...ux.ibm.com>,
Radostin Stoyanov <rstoyanov1@...il.com>
Subject: Re: [PATCH v10 1/2] fork: extend clone3() to support setting a PID
On 11/14, Andrei Vagin wrote:
>
> On Thu, Nov 14, 2019 at 03:27:06PM +0100, Adrian Reber wrote:
> ...
> > diff --git a/include/uapi/linux/sched.h b/include/uapi/linux/sched.h
> > index 1d500ed03c63..2e649cfa07f4 100644
> > --- a/include/uapi/linux/sched.h
> > +++ b/include/uapi/linux/sched.h
> ...
> > @@ -174,24 +186,51 @@ struct pid *alloc_pid(struct pid_namespace *ns)
> > pid->level = ns->level;
> >
> > for (i = ns->level; i >= 0; i--) {
> > - int pid_min = 1;
> > + int tid = 0;
> > +
> > + if (set_tid_size) {
> > + tid = set_tid[ns->level - i];
> > + if (tid < 1 || tid >= pid_max)
> > + return ERR_PTR(-EINVAL);
>
> do we need to release pids what have been allocated on previous levels?
Heh ;) it is really amazing that nobody noticed this! Thanks Andrei.
> nr = -EINVAL;
retval = -EINVAL;
> goto out_free;
Oleg.
Powered by blists - more mailing lists