pid_namespace.c (ecb41832bd2a7a3f8ac93527cec5e51e3827daed) pid_namespace.c (eec4844fae7c033a0c1fc1eb3b8517aeb8b6cc49)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Pid namespaces
4 *
5 * Authors:
6 * (C) 2007 Pavel Emelyanov <xemul@openvz.org>, OpenVZ, SWsoft Inc.
7 * (C) 2007 Sukadev Bhattiprolu <sukadev@us.ibm.com>, IBM
8 * Many thanks to Oleg Nesterov for comments and help

--- 277 unchanged lines hidden (view full) ---

286 ret = proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos);
287 if (!ret && write)
288 idr_set_cursor(&pid_ns->idr, next + 1);
289
290 return ret;
291}
292
293extern int pid_max;
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Pid namespaces
4 *
5 * Authors:
6 * (C) 2007 Pavel Emelyanov <xemul@openvz.org>, OpenVZ, SWsoft Inc.
7 * (C) 2007 Sukadev Bhattiprolu <sukadev@us.ibm.com>, IBM
8 * Many thanks to Oleg Nesterov for comments and help

--- 277 unchanged lines hidden (view full) ---

286 ret = proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos);
287 if (!ret && write)
288 idr_set_cursor(&pid_ns->idr, next + 1);
289
290 return ret;
291}
292
293extern int pid_max;
294static int zero = 0;
295static struct ctl_table pid_ns_ctl_table[] = {
296 {
297 .procname = "ns_last_pid",
298 .maxlen = sizeof(int),
299 .mode = 0666, /* permissions are checked in the handler */
300 .proc_handler = pid_ns_ctl_handler,
294static struct ctl_table pid_ns_ctl_table[] = {
295 {
296 .procname = "ns_last_pid",
297 .maxlen = sizeof(int),
298 .mode = 0666, /* permissions are checked in the handler */
299 .proc_handler = pid_ns_ctl_handler,
301 .extra1 = &zero,
300 .extra1 = SYSCTL_ZERO,
302 .extra2 = &pid_max,
303 },
304 { }
305};
306static struct ctl_path kern_path[] = { { .procname = "kernel", }, { } };
307#endif /* CONFIG_CHECKPOINT_RESTORE */
308
309int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd)

--- 11 unchanged lines hidden (view full) ---

321 case LINUX_REBOOT_CMD_HALT:
322 pid_ns->reboot = SIGINT;
323 break;
324 default:
325 return -EINVAL;
326 }
327
328 read_lock(&tasklist_lock);
301 .extra2 = &pid_max,
302 },
303 { }
304};
305static struct ctl_path kern_path[] = { { .procname = "kernel", }, { } };
306#endif /* CONFIG_CHECKPOINT_RESTORE */
307
308int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd)

--- 11 unchanged lines hidden (view full) ---

320 case LINUX_REBOOT_CMD_HALT:
321 pid_ns->reboot = SIGINT;
322 break;
323 default:
324 return -EINVAL;
325 }
326
327 read_lock(&tasklist_lock);
329 force_sig(SIGKILL, pid_ns->child_reaper);
328 send_sig(SIGKILL, pid_ns->child_reaper, 1);
330 read_unlock(&tasklist_lock);
331
332 do_exit(0);
333
334 /* Not reached */
335 return 0;
336}
337

--- 132 unchanged lines hidden ---
329 read_unlock(&tasklist_lock);
330
331 do_exit(0);
332
333 /* Not reached */
334 return 0;
335}
336

--- 132 unchanged lines hidden ---