Skip to content

Commit

Permalink
ipc: Use the same namespace to modify and validate
Browse files Browse the repository at this point in the history
In the 1f5c135 ("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: 1f5c135 ("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]>
  • Loading branch information
legionus authored and ebiederm committed May 3, 2022
1 parent 1f5c135 commit def7343
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ipc/ipc_sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit def7343

Please sign in to comment.