 diff --git a/kernel/fork.c b/kernel/fork.c
 --- a/kernel/fork.c
 +++ b/kernel/fork.c
-@@ -1716,6 +1716,13 @@ long do_fork(unsigned long clone_flags,
+@@ -1792,6 +1792,13 @@ long _do_fork(unsigned long clone_flags,
  
  		pid = get_task_pid(p, PIDTYPE_PID);
  		nr = pid_vnr(pid);

 	why = ptrace ? CLD_TRAPPED : CLD_STOPPED;
 	read_unlock(&tasklist_lock);
 	sched_annotate_sleep();
@@ -1264,6 +1285,8 @@ static int wait_task_continued(struct wait_opts *wo, struct task_struct *p)
 	spin_unlock_irq(&p->sighand->siglock);
 
 	pid = task_pid_vnr(p);

+			ns = &nsp->pid_ns_for_children->ns;
+			alt_install = pidns_install_override;
+			break;
+#ifdef CONFIG_NET
+		case CLONE_NEWNET:
+			if (!nsp->net_ns)
+				goto out;
+			ns = &nsp->net_ns->ns;
+			break;
+#endif
+		case CLONE_NEWUTS:
+			if (!nsp->uts_ns)
+				goto out;
+			ns = &nsp->uts_ns->ns;
+			break;
+#if defined(CONFIG_POSIX_MQUEUE) || defined(CONFIG_SYSVIPC)
+		case CLONE_NEWIPC:
+			if (!nsp->ipc_ns)
+				goto out;
+			ns = &nsp->ipc_ns->ns;
+			break;
+#endif
+#ifdef CONFIG_CGROUPS
+		case CLONE_NEWCGROUP:
+			if (!nsp->cgroup_ns)
+				goto out;
+			ns = &nsp->cgroup_ns->ns;
+			break;
+#endif
+		default:
+			goto out;
+		}
