diff options
Diffstat (limited to 'ipc/util.h')
-rw-r--r-- | ipc/util.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ipc/util.h b/ipc/util.h index 1ee81bce25e9..d768fdbed515 100644 --- a/ipc/util.h +++ b/ipc/util.h | |||
@@ -217,6 +217,15 @@ int ipcget(struct ipc_namespace *ns, struct ipc_ids *ids, | |||
217 | void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids, | 217 | void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids, |
218 | void (*free)(struct ipc_namespace *, struct kern_ipc_perm *)); | 218 | void (*free)(struct ipc_namespace *, struct kern_ipc_perm *)); |
219 | 219 | ||
220 | static inline int sem_check_semmni(struct ipc_namespace *ns) { | ||
221 | /* | ||
222 | * Check semmni range [0, IPCMNI] | ||
223 | * semmni is the last element of sem_ctls[4] array | ||
224 | */ | ||
225 | return ((ns->sem_ctls[3] < 0) || (ns->sem_ctls[3] > IPCMNI)) | ||
226 | ? -ERANGE : 0; | ||
227 | } | ||
228 | |||
220 | #ifdef CONFIG_COMPAT | 229 | #ifdef CONFIG_COMPAT |
221 | #include <linux/compat.h> | 230 | #include <linux/compat.h> |
222 | struct compat_ipc_perm { | 231 | struct compat_ipc_perm { |