Skip to content

Commit a9febbb

Browse files
Eric Dumazettorvalds
authored andcommitted
sysctl: min/max bounds are optional
sysctl check complains with a WARN() when proc_doulongvec_minmax() or proc_doulongvec_ms_jiffies_minmax() are used by a vector of longs (with more than one element), with no min or max value specified. This is unexpected, given we had a bug on this min/max handling :) Reported-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: David Miller <davem@davemloft.net> Acked-by: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 5a2b3ef commit a9febbb

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

kernel/sysctl_check.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,6 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table)
143143
if (!table->maxlen)
144144
set_fail(&fail, table, "No maxlen");
145145
}
146-
if ((table->proc_handler == proc_doulongvec_minmax) ||
147-
(table->proc_handler == proc_doulongvec_ms_jiffies_minmax)) {
148-
if (table->maxlen > sizeof (unsigned long)) {
149-
if (!table->extra1)
150-
set_fail(&fail, table, "No min");
151-
if (!table->extra2)
152-
set_fail(&fail, table, "No max");
153-
}
154-
}
155146
#ifdef CONFIG_PROC_SYSCTL
156147
if (table->procname && !table->proc_handler)
157148
set_fail(&fail, table, "No proc_handler");

0 commit comments

Comments
 (0)