lkml.org 
[lkml]   [2019]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v10 1/2] fork: extend clone3() to support setting a PID
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?

nr = -EINVAL;
goto out_free;

Could you add a test for this case?

\
 
 \ /
  Last update: 2019-11-14 20:17    [W:0.095 / U:1.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site