aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c93
1 files changed, 83 insertions, 10 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index b2970d56fb76..58be76017fd0 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -27,6 +27,7 @@
27#include <linux/security.h> 27#include <linux/security.h>
28#include <linux/ctype.h> 28#include <linux/ctype.h>
29#include <linux/utsname.h> 29#include <linux/utsname.h>
30#include <linux/kmemcheck.h>
30#include <linux/smp_lock.h> 31#include <linux/smp_lock.h>
31#include <linux/fs.h> 32#include <linux/fs.h>
32#include <linux/init.h> 33#include <linux/init.h>
@@ -48,7 +49,9 @@
48#include <linux/acpi.h> 49#include <linux/acpi.h>
49#include <linux/reboot.h> 50#include <linux/reboot.h>
50#include <linux/ftrace.h> 51#include <linux/ftrace.h>
52#include <linux/security.h>
51#include <linux/slow-work.h> 53#include <linux/slow-work.h>
54#include <linux/perf_counter.h>
52 55
53#include <asm/uaccess.h> 56#include <asm/uaccess.h>
54#include <asm/processor.h> 57#include <asm/processor.h>
@@ -114,6 +117,7 @@ static int ngroups_max = NGROUPS_MAX;
114 117
115#ifdef CONFIG_MODULES 118#ifdef CONFIG_MODULES
116extern char modprobe_path[]; 119extern char modprobe_path[];
120extern int modules_disabled;
117#endif 121#endif
118#ifdef CONFIG_CHR_DEV_SG 122#ifdef CONFIG_CHR_DEV_SG
119extern int sg_big_buff; 123extern int sg_big_buff;
@@ -326,6 +330,17 @@ static struct ctl_table kern_table[] = {
326 .mode = 0644, 330 .mode = 0644,
327 .proc_handler = &proc_dointvec, 331 .proc_handler = &proc_dointvec,
328 }, 332 },
333 {
334 .ctl_name = CTL_UNNUMBERED,
335 .procname = "timer_migration",
336 .data = &sysctl_timer_migration,
337 .maxlen = sizeof(unsigned int),
338 .mode = 0644,
339 .proc_handler = &proc_dointvec_minmax,
340 .strategy = &sysctl_intvec,
341 .extra1 = &zero,
342 .extra2 = &one,
343 },
329#endif 344#endif
330 { 345 {
331 .ctl_name = CTL_UNNUMBERED, 346 .ctl_name = CTL_UNNUMBERED,
@@ -534,6 +549,17 @@ static struct ctl_table kern_table[] = {
534 .proc_handler = &proc_dostring, 549 .proc_handler = &proc_dostring,
535 .strategy = &sysctl_string, 550 .strategy = &sysctl_string,
536 }, 551 },
552 {
553 .ctl_name = CTL_UNNUMBERED,
554 .procname = "modules_disabled",
555 .data = &modules_disabled,
556 .maxlen = sizeof(int),
557 .mode = 0644,
558 /* only handle a transition from default "0" to "1" */
559 .proc_handler = &proc_dointvec_minmax,
560 .extra1 = &one,
561 .extra2 = &one,
562 },
537#endif 563#endif
538#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) 564#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET)
539 { 565 {
@@ -722,6 +748,14 @@ static struct ctl_table kern_table[] = {
722 .proc_handler = &proc_dointvec, 748 .proc_handler = &proc_dointvec,
723 }, 749 },
724 { 750 {
751 .ctl_name = CTL_UNNUMBERED,
752 .procname = "panic_on_io_nmi",
753 .data = &panic_on_io_nmi,
754 .maxlen = sizeof(int),
755 .mode = 0644,
756 .proc_handler = &proc_dointvec,
757 },
758 {
725 .ctl_name = KERN_BOOTLOADER_TYPE, 759 .ctl_name = KERN_BOOTLOADER_TYPE,
726 .procname = "bootloader_type", 760 .procname = "bootloader_type",
727 .data = &bootloader_type, 761 .data = &bootloader_type,
@@ -731,6 +765,14 @@ static struct ctl_table kern_table[] = {
731 }, 765 },
732 { 766 {
733 .ctl_name = CTL_UNNUMBERED, 767 .ctl_name = CTL_UNNUMBERED,
768 .procname = "bootloader_version",
769 .data = &bootloader_version,
770 .maxlen = sizeof (int),
771 .mode = 0444,
772 .proc_handler = &proc_dointvec,
773 },
774 {
775 .ctl_name = CTL_UNNUMBERED,
734 .procname = "kstack_depth_to_print", 776 .procname = "kstack_depth_to_print",
735 .data = &kstack_depth_to_print, 777 .data = &kstack_depth_to_print,
736 .maxlen = sizeof(int), 778 .maxlen = sizeof(int),
@@ -912,6 +954,43 @@ static struct ctl_table kern_table[] = {
912 .child = slow_work_sysctls, 954 .child = slow_work_sysctls,
913 }, 955 },
914#endif 956#endif
957#ifdef CONFIG_PERF_COUNTERS
958 {
959 .ctl_name = CTL_UNNUMBERED,
960 .procname = "perf_counter_paranoid",
961 .data = &sysctl_perf_counter_paranoid,
962 .maxlen = sizeof(sysctl_perf_counter_paranoid),
963 .mode = 0644,
964 .proc_handler = &proc_dointvec,
965 },
966 {
967 .ctl_name = CTL_UNNUMBERED,
968 .procname = "perf_counter_mlock_kb",
969 .data = &sysctl_perf_counter_mlock,
970 .maxlen = sizeof(sysctl_perf_counter_mlock),
971 .mode = 0644,
972 .proc_handler = &proc_dointvec,
973 },
974 {
975 .ctl_name = CTL_UNNUMBERED,
976 .procname = "perf_counter_max_sample_rate",
977 .data = &sysctl_perf_counter_sample_rate,
978 .maxlen = sizeof(sysctl_perf_counter_sample_rate),
979 .mode = 0644,
980 .proc_handler = &proc_dointvec,
981 },
982#endif
983#ifdef CONFIG_KMEMCHECK
984 {
985 .ctl_name = CTL_UNNUMBERED,
986 .procname = "kmemcheck",
987 .data = &kmemcheck_enabled,
988 .maxlen = sizeof(int),
989 .mode = 0644,
990 .proc_handler = &proc_dointvec,
991 },
992#endif
993
915/* 994/*
916 * NOTE: do not add new entries to this table unless you have read 995 * NOTE: do not add new entries to this table unless you have read
917 * Documentation/sysctl/ctl_unnumbered.txt 996 * Documentation/sysctl/ctl_unnumbered.txt
@@ -1225,16 +1304,14 @@ static struct ctl_table vm_table[] = {
1225 .strategy = &sysctl_jiffies, 1304 .strategy = &sysctl_jiffies,
1226 }, 1305 },
1227#endif 1306#endif
1228#ifdef CONFIG_SECURITY
1229 { 1307 {
1230 .ctl_name = CTL_UNNUMBERED, 1308 .ctl_name = CTL_UNNUMBERED,
1231 .procname = "mmap_min_addr", 1309 .procname = "mmap_min_addr",
1232 .data = &mmap_min_addr, 1310 .data = &dac_mmap_min_addr,
1233 .maxlen = sizeof(unsigned long), 1311 .maxlen = sizeof(unsigned long),
1234 .mode = 0644, 1312 .mode = 0644,
1235 .proc_handler = &proc_doulongvec_minmax, 1313 .proc_handler = &mmap_min_addr_handler,
1236 }, 1314 },
1237#endif
1238#ifdef CONFIG_NUMA 1315#ifdef CONFIG_NUMA
1239 { 1316 {
1240 .ctl_name = CTL_UNNUMBERED, 1317 .ctl_name = CTL_UNNUMBERED,
@@ -1272,7 +1349,6 @@ static struct ctl_table vm_table[] = {
1272 .extra2 = &one, 1349 .extra2 = &one,
1273 }, 1350 },
1274#endif 1351#endif
1275#ifdef CONFIG_UNEVICTABLE_LRU
1276 { 1352 {
1277 .ctl_name = CTL_UNNUMBERED, 1353 .ctl_name = CTL_UNNUMBERED,
1278 .procname = "scan_unevictable_pages", 1354 .procname = "scan_unevictable_pages",
@@ -1281,7 +1357,6 @@ static struct ctl_table vm_table[] = {
1281 .mode = 0644, 1357 .mode = 0644,
1282 .proc_handler = &scan_unevictable_handler, 1358 .proc_handler = &scan_unevictable_handler,
1283 }, 1359 },
1284#endif
1285/* 1360/*
1286 * NOTE: do not add new entries to this table unless you have read 1361 * NOTE: do not add new entries to this table unless you have read
1287 * Documentation/sysctl/ctl_unnumbered.txt 1362 * Documentation/sysctl/ctl_unnumbered.txt
@@ -2220,7 +2295,7 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
2220 void *data) 2295 void *data)
2221{ 2296{
2222#define TMPBUFLEN 21 2297#define TMPBUFLEN 21
2223 int *i, vleft, first=1, neg, val; 2298 int *i, vleft, first = 1, neg;
2224 unsigned long lval; 2299 unsigned long lval;
2225 size_t left, len; 2300 size_t left, len;
2226 2301
@@ -2273,8 +2348,6 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
2273 len = p-buf; 2348 len = p-buf;
2274 if ((len < left) && *p && !isspace(*p)) 2349 if ((len < left) && *p && !isspace(*p))
2275 break; 2350 break;
2276 if (neg)
2277 val = -val;
2278 s += len; 2351 s += len;
2279 left -= len; 2352 left -= len;
2280 2353