summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMathias Krause <minipli@googlemail.com>2013-11-03 12:36:28 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-04 10:56:11 -0800
commita12503f53b7555a639869527d47eef61ff33cd00 (patch)
tree2e951eda18a2a1c5a1c7463c633d54c11567460d /include
parent4b825b95aaa48c706d24c804f7edff228bd6af70 (diff)
ipc, msg: forbid negative values for "msg{max,mnb,mni}"
commit 9bf76ca325d5e9208eb343f7bd4cc666f703ed30 upstream. Negative message lengths make no sense -- so don't do negative queue lenghts or identifier counts. Prevent them from getting negative. Also change the underlying data types to be unsigned to avoid hairy surprises with sign extensions in cases where those variables get evaluated in unsigned expressions with bigger data types, e.g size_t. In case a user still wants to have "unlimited" sizes she could just use INT_MAX instead. Signed-off-by: Mathias Krause <minipli@googlemail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ipc_namespace.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h
index 19c19a5eee29..f6c82de12541 100644
--- a/include/linux/ipc_namespace.h
+++ b/include/linux/ipc_namespace.h
@@ -34,9 +34,9 @@ struct ipc_namespace {
int sem_ctls[4];
int used_sems;
- int msg_ctlmax;
- int msg_ctlmnb;
- int msg_ctlmni;
+ unsigned int msg_ctlmax;
+ unsigned int msg_ctlmnb;
+ unsigned int msg_ctlmni;
atomic_t msg_bytes;
atomic_t msg_hdrs;
int auto_msgmni;