mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 06:14:39 +01:00
pid: Fix error return value in some cases
Recent changes to alloc_pid() allow the pid number to be specified on
the command line. If set_tid_size is set, then the code scanning the
levels will hard-set retval to -EPERM, overriding it's previous -ENOMEM
value.
After the code scanning the levels, there are error returns that do not
set retval, assuming it is still set to -ENOMEM.
So set retval back to -ENOMEM after scanning the levels.
Fixes: 49cb2fc42c ("fork: extend clone3() to support setting a PID")
Signed-off-by: Corey Minyard <[email protected]>
Acked-by: Christian Brauner <[email protected]>
Cc: Andrei Vagin <[email protected]>
Cc: Dmitry Safonov <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Adrian Reber <[email protected]>
Cc: <[email protected]> # 5.5
Link: https://lore.kernel.org/r/[email protected]
[[email protected]: fixup commit message]
Signed-off-by: Christian Brauner <[email protected]>
This commit is contained in:
1 parent
98d54f81e3
commit
b26ebfe12f
1 file changed
+2
@@ -247,6 +247,8 @@ struct pid *alloc_pid(struct pid_namespace *ns, pid_t *set_tid,
|
||||
tmp = tmp->parent;
|
||||
}
|
||||
|
||||
retval = -ENOMEM;
|
||||
|
||||
if (unlikely(is_child_reaper(pid))) {
|
||||
if (pid_ns_prepare_proc(ns))
|
||||
goto out_free;
|
||||
|
||||
Reference in new issue
Block a user