Messages in this thread Patch in this message | | | From | Mathias Krause <> | Subject | [PATCH 2/2] ipc, msg: forbid negative values for "msgmax" | Date | Sat, 2 Nov 2013 22:26:39 +0100 |
| |
Negative message lengths make no sense, prevent them from being set. They do more harm than gain.
In case a user wants to have "unlimited" message sizes she should just use INT_MAX instead.
Signed-off-by: Mathias Krause <minipli@googlemail.com> Cc: Andrew Morton <akpm@linux-foundation.org> --- ipc/ipc_sysctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c index 130dfec..76823b8 100644 --- a/ipc/ipc_sysctl.c +++ b/ipc/ipc_sysctl.c @@ -158,9 +158,7 @@ static int proc_ipcauto_dointvec_minmax(ctl_table *table, int write, static int zero; static int one = 1; -#ifdef CONFIG_CHECKPOINT_RESTORE static int int_max = INT_MAX; -#endif static struct ctl_table ipc_kern_table[] = { { @@ -198,7 +196,9 @@ static struct ctl_table ipc_kern_table[] = { .data = &init_ipc_ns.msg_ctlmax, .maxlen = sizeof (init_ipc_ns.msg_ctlmax), .mode = 0644, - .proc_handler = proc_ipc_dointvec, + .proc_handler = proc_ipc_dointvec_minmax, + .extra1 = &zero, + .extra2 = &int_max, }, { .procname = "msgmni", -- 1.7.10.4
| |