From: Alexey Dobriyan Date: Fri, 25 Jul 2008 08:48:31 +0000 (-0700) Subject: sysctl: check for bogus modes X-Git-Tag: v2.6.27-rc1~276 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=99541c23cd32bacf1a591ca537a7c0cb9053ad7e;p=linux-2.6-omap-h63xx.git sysctl: check for bogus modes Catch, e. g., 644/0644 typo. Signed-off-by: Alexey Dobriyan Acked-by: "Eric W. Biederman" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/sysctl_check.c b/kernel/sysctl_check.c index c09350d564f..c35da23ab8f 100644 --- a/kernel/sysctl_check.c +++ b/kernel/sysctl_check.c @@ -1532,6 +1532,8 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table) sysctl_check_leaf(namespaces, table, &fail); } sysctl_check_bin_path(table, &fail); + if (table->mode > 0777) + set_fail(&fail, table, "bogus .mode"); if (fail) { set_fail(&fail, table, NULL); error = -EINVAL;