summaryrefslogtreecommitdiffstats
path: root/ipc/namespace.c
diff options
context:
space:
mode:
authorAlexey Gladkov <legion@kernel.org>2022-02-14 19:18:15 +0100
committerEric W. Biederman <ebiederm@xmission.com>2022-03-08 20:39:40 +0100
commit1f5c135ee509e89e0cc274333a65f73c62cb16e5 (patch)
tree9a3b82b103e80cf59b387c87da6b75ba75cdfc1f /ipc/namespace.c
parentipc: Store mqueue sysctls in the ipc namespace (diff)
downloadlinux-1f5c135ee509e89e0cc274333a65f73c62cb16e5.tar.xz
linux-1f5c135ee509e89e0cc274333a65f73c62cb16e5.zip
ipc: Store ipc sysctls in the ipc namespace
The ipc sysctls are not available for modification inside the user namespace. Following the mqueue sysctls, we changed the implementation to be more userns friendly. So far, the changes do not provide additional access to files. This will be done in a future patch. Signed-off-by: Alexey Gladkov <legion@kernel.org> Link: https://lkml.kernel.org/r/be6f9d014276f4dddd0c3aa05a86052856c1c555.1644862280.git.legion@kernel.org Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'ipc/namespace.c')
-rw-r--r--ipc/namespace.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ipc/namespace.c b/ipc/namespace.c
index f760243ca685..754f3237194a 100644
--- a/ipc/namespace.c
+++ b/ipc/namespace.c
@@ -63,6 +63,9 @@ static struct ipc_namespace *create_ipc_ns(struct user_namespace *user_ns,
if (!setup_mq_sysctls(ns))
goto fail_put;
+ if (!setup_ipc_sysctls(ns))
+ goto fail_put;
+
sem_init_ns(ns);
msg_init_ns(ns);
shm_init_ns(ns);
@@ -130,6 +133,7 @@ static void free_ipc_ns(struct ipc_namespace *ns)
shm_exit_ns(ns);
retire_mq_sysctls(ns);
+ retire_ipc_sysctls(ns);
dec_ipc_namespaces(ns->ucounts);
put_user_ns(ns->user_ns);