diff options
Diffstat (limited to '0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch')
-rw-r--r-- | 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch b/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch index 90da9867a68a..c84f30a717ae 100644 --- a/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch +++ b/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch @@ -1,7 +1,7 @@ -From 6670bdf280ab272b71ad5928e834e9c83c92c24d Mon Sep 17 00:00:00 2001 +From 5440ebf8dc7c5fd1f97579abbc1840c631141f0a Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com> Date: Mon, 16 Sep 2019 04:53:20 +0200 -Subject: [PATCH 1/5] ZEN: Add sysctl and CONFIG to disallow unprivileged +Subject: [PATCH 1/3] ZEN: Add sysctl and CONFIG to disallow unprivileged CLONE_NEWUSER Our default behavior continues to match the vanilla kernel. @@ -36,10 +36,10 @@ index 45f09bec02c4..87b20e2ee274 100644 { return &init_user_ns; diff --git a/init/Kconfig b/init/Kconfig -index c88bb30a8b0b..32ba96d94028 100644 +index 32c24950c4ce..f17ef1360063 100644 --- a/init/Kconfig +++ b/init/Kconfig -@@ -1249,6 +1249,22 @@ config USER_NS +@@ -1225,6 +1225,22 @@ config USER_NS If unsure, say N. @@ -63,12 +63,12 @@ index c88bb30a8b0b..32ba96d94028 100644 bool "PID Namespaces" default y diff --git a/kernel/fork.c b/kernel/fork.c -index ea332319dffe..349945168239 100644 +index 41c964104b58..915ad6dae416 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -98,6 +98,10 @@ - #include <linux/bpf.h> - #include <linux/stackprotector.h> +@@ -100,6 +100,10 @@ + #include <linux/user_events.h> + #include <linux/iommu.h> +#ifdef CONFIG_USER_NS +#include <linux/user_namespace.h> @@ -77,7 +77,7 @@ index ea332319dffe..349945168239 100644 #include <asm/pgalloc.h> #include <linux/uaccess.h> #include <asm/mmu_context.h> -@@ -2032,6 +2036,10 @@ static __latent_entropy struct task_struct *copy_process( +@@ -2266,6 +2270,10 @@ __latent_entropy struct task_struct *copy_process( if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS)) return ERR_PTR(-EINVAL); @@ -88,7 +88,7 @@ index ea332319dffe..349945168239 100644 /* * Thread groups must share signals as well, and detached threads * can only be started up within the thread group. -@@ -3182,6 +3190,12 @@ int ksys_unshare(unsigned long unshare_flags) +@@ -3419,6 +3427,12 @@ int ksys_unshare(unsigned long unshare_flags) if (unshare_flags & CLONE_NEWNS) unshare_flags |= CLONE_FS; @@ -102,10 +102,10 @@ index ea332319dffe..349945168239 100644 if (err) goto bad_unshare_out; diff --git a/kernel/sysctl.c b/kernel/sysctl.c -index 1c240d2c99bc..2971581a27e2 100644 +index bfe53e835524..c64fa2b70a78 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c -@@ -81,6 +81,9 @@ +@@ -80,6 +80,9 @@ #ifdef CONFIG_RT_MUTEXES #include <linux/rtmutex.h> #endif @@ -115,7 +115,7 @@ index 1c240d2c99bc..2971581a27e2 100644 /* shared constants to be used in various sysctls */ const int sysctl_vals[] = { 0, 1, 2, 3, 4, 100, 200, 1000, 3000, INT_MAX, 65535, -1 }; -@@ -1645,6 +1648,15 @@ static struct ctl_table kern_table[] = { +@@ -1623,6 +1626,15 @@ static struct ctl_table kern_table[] = { .mode = 0644, .proc_handler = proc_dointvec, }, @@ -150,5 +150,5 @@ index 1d8e47bed3f1..fec01d016a35 100644 static DEFINE_MUTEX(userns_state_mutex); -- -2.40.1 +2.41.0 |