]> Git Repo - J-linux.git/commitdiff
ipc: Use the same namespace to modify and validate
authorAlexey Gladkov <[email protected]>
Tue, 3 May 2022 13:39:54 +0000 (15:39 +0200)
committerEric W. Biederman <[email protected]>
Tue, 3 May 2022 22:25:58 +0000 (17:25 -0500)
In the 1f5c135ee509 ("ipc: Store ipc sysctls in the ipc namespace") I
missed that in addition to the modification of sem_ctls[3], the change
is validated. This validation must occur in the same namespace.

Link: https://lore.kernel.org/lkml/[email protected]/
Fixes: 1f5c135ee509 ("ipc: Store ipc sysctls in the ipc namespace")
Signed-off-by: Alexey Gladkov <[email protected]>
Link: https://lkml.kernel.org/r/b3cb9a25cce6becbef77186bc1216071a08a969b.1651584847.git.legion@kernel.org
Signed-off-by: Eric W. Biederman <[email protected]>
ipc/ipc_sysctl.c

index 15210ac47e9e11e37062f11b730f4fa5f1154097..d1d5204cf589371c22cbd53eb907fbcc0e91f90a 100644 (file)
@@ -68,7 +68,7 @@ static int proc_ipc_sem_dointvec(struct ctl_table *table, int write,
        ret = proc_dointvec(table, write, buffer, lenp, ppos);
 
        if (!ret)
-               ret = sem_check_semmni(current->nsproxy->ipc_ns);
+               ret = sem_check_semmni(ns);
 
        /*
         * Reset the semmni value if an error happens.
This page took 0.049879 seconds and 4 git commands to generate.