summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2008-04-29 10:02:36 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 17:06:22 +0200
commit88f458e4b91348b2e892c72977b5f665d7f374da (patch)
tree1ef9e98f74fc63193327053af079079e23aa8443
parentdrivers: use non-racy method for proc entries creation (2) (diff)
downloadlinux-88f458e4b91348b2e892c72977b5f665d7f374da.tar.xz
linux-88f458e4b91348b2e892c72977b5f665d7f374da.zip
sysctl: allow embedded targets to disable sysctl_check.c
Disable sysctl_check.c for embedded targets. This saves about about 11 kB in .text and another 11 kB in .data on a PXA255 embedded platform. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--init/Kconfig11
-rw-r--r--kernel/Makefile2
-rw-r--r--kernel/sysctl.c10
3 files changed, 20 insertions, 3 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 98fa96eac415..3e7b257fc05f 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -550,6 +550,17 @@ config SYSCTL_SYSCALL
If unsure say Y here.
+config SYSCTL_SYSCALL_CHECK
+ bool "Sysctl checks" if EMBEDDED
+ depends on SYSCTL_SYSCALL
+ default y
+ ---help---
+ sys_sysctl uses binary paths that have been found challenging
+ to properly maintain and use. This enables checks that help
+ you to keep things correct.
+
+ If unsure say Y here.
+
config KALLSYMS
bool "Load all symbols for debugging/ksymoops" if EMBEDDED
default y
diff --git a/kernel/Makefile b/kernel/Makefile
index 6c5f081132a4..188c43223f52 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -11,7 +11,7 @@ obj-y = sched.o fork.o exec_domain.o panic.o printk.o profile.o \
hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o \
notifier.o ksysfs.o pm_qos_params.o
-obj-$(CONFIG_SYSCTL) += sysctl_check.o
+obj-$(CONFIG_SYSCTL_SYSCALL_CHECK) += sysctl_check.o
obj-$(CONFIG_STACKTRACE) += stacktrace.o
obj-y += time/
obj-$(CONFIG_DEBUG_MUTEXES) += mutex-debug.o
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 0a1d2733cf41..1cdfe942d160 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1592,9 +1592,13 @@ static void sysctl_set_parent(struct ctl_table *parent, struct ctl_table *table)
static __init int sysctl_init(void)
{
- int err;
sysctl_set_parent(NULL, root_table);
- err = sysctl_check_table(current->nsproxy, root_table);
+#ifdef CONFIG_SYSCTL_SYSCALL_CHECK
+ {
+ int err;
+ err = sysctl_check_table(current->nsproxy, root_table);
+ }
+#endif
return 0;
}
@@ -1721,10 +1725,12 @@ struct ctl_table_header *__register_sysctl_paths(
header->unregistering = NULL;
header->root = root;
sysctl_set_parent(NULL, header->ctl_table);
+#ifdef CONFIG_SYSCTL_SYSCALL_CHECK
if (sysctl_check_table(namespaces, header->ctl_table)) {
kfree(header);
return NULL;
}
+#endif
spin_lock(&sysctl_lock);
header_list = lookup_header_list(root, namespaces);
list_add_tail(&header->ctl_entry, header_list);