]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 3 Nov 2013 18:53:11 +0000 (10:53 -0800)
commitc4f2aac0ee19bdde2d8007557cc66f6a739c9a1c
tree0c6e992844c24162838013caa4f4f3356d6594dd
parent2511c678f76aeb32d665fa927253ad750088fa26
ipc, msg: forbid negative values for "msg{max,mnb,mni}"

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>
include/linux/ipc_namespace.h
ipc/ipc_sysctl.c