Commit ab9c1a22 authored by Li Zefan's avatar Li Zefan Committed by Yi Yang
Browse files

pid_ns: Make pid_max per namespace

euler inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8TCPY



-------------------------------------------------

The adjusted pid_max on the host also takes effect in the container.
Move pid_max to pid_namespace to fix this problem.

Signed-off-by: default avatarLi Zefan <lizefan@huawei.com>
Signed-off-by: default avatarYi Yang <yiyang13@huawei.com>
parent c780cd23
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1007,6 +1007,7 @@ CONFIG_ARCH_USE_QUEUED_RWLOCKS=y
CONFIG_QUEUED_RWLOCKS=y
CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE=y
CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y
CONFIG_PID_MAX_PER_NAMESPACE=y
CONFIG_FREEZER=y

#
+1 −0
Original line number Diff line number Diff line
@@ -1022,6 +1022,7 @@ CONFIG_QUEUED_RWLOCKS=y
CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE=y
CONFIG_ARCH_HAS_SYNC_CORE_BEFORE_USERMODE=y
CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y
CONFIG_PID_MAX_PER_NAMESPACE=y
CONFIG_FREEZER=y

#
+2 −0
Original line number Diff line number Diff line
@@ -113,8 +113,10 @@ extern void transfer_pid(struct task_struct *old, struct task_struct *new,
struct pid_namespace;
extern struct pid_namespace init_pid_ns;

#ifndef CONFIG_PID_MAX_PER_NAMESPACE
extern int pid_max;
extern int pid_max_min, pid_max_max;
#endif

/*
 * look up a PID in the hash table. Must be called with the tasklist_lock
+3 −0
Original line number Diff line number Diff line
@@ -36,6 +36,9 @@ struct pid_namespace {
#endif
	struct user_namespace *user_ns;
	struct ucounts *ucounts;
#ifdef CONFIG_PID_MAX_PER_NAMESPACE
	int pid_max;
#endif
	int reboot;	/* group exit code if this pidns was rebooted */
	struct ns_common ns;
#if defined(CONFIG_SYSCTL) && defined(CONFIG_MEMFD_CREATE)
+7 −0
Original line number Diff line number Diff line
@@ -2147,3 +2147,10 @@ config ARCH_HAS_SYNC_CORE_BEFORE_USERMODE
# <asm/syscall_wrapper.h>.
config ARCH_HAS_SYSCALL_WRAPPER
	def_bool n

config PID_MAX_PER_NAMESPACE
	bool "Make pid_max per namespace"
	depends on PID_NS
	default n
	help
	  Say Y here to enable make pid_max per namespace.
Loading