ipc, msg: forbid negative values for "msg{max,mnb,mni}"
authorMathias Krause <minipli@googlemail.com>
Sun, 3 Nov 2013 11:36:28 +0000 (12:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Dec 2013 18:56:11 +0000 (10:56 -0800)
commita12503f53b7555a639869527d47eef61ff33cd00
tree2e951eda18a2a1c5a1c7463c633d54c11567460d
parent4b825b95aaa48c706d24c804f7edff228bd6af70
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>
include/linux/ipc_namespace.h
ipc/ipc_sysctl.c