[PATCH] sysctl: check for bogus modes

From: Alexey Dobriyan
Date: Thu May 29 2008 - 10:16:59 EST


Catch, e. g., 644/0644 typo.

Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxxxxxx>
---

kernel/sysctl_check.c | 2 ++
1 file changed, 2 insertions(+)

--- 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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/