Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * sysctl.c: General linux system control interface | |
3 | * | |
4 | * Begun 24 March 1995, Stephen Tweedie | |
5 | * Added /proc support, Dec 1995 | |
6 | * Added bdflush entry and intvec min/max checking, 2/23/96, Tom Dyas. | |
7 | * Added hooks for /proc/sys/net (minor, minor patch), 96/4/1, Mike Shaver. | |
8 | * Added kernel/java-{interpreter,appletviewer}, 96/5/10, Mike Shaver. | |
9 | * Dynamic registration fixes, Stephen Tweedie. | |
10 | * Added kswapd-interval, ctrl-alt-del, printk stuff, 1/8/97, Chris Horn. | |
11 | * Made sysctl support optional via CONFIG_SYSCTL, 1/10/97, Chris | |
12 | * Horn. | |
13 | * Added proc_doulongvec_ms_jiffies_minmax, 09/08/99, Carlos H. Bauer. | |
14 | * Added proc_doulongvec_minmax, 09/08/99, Carlos H. Bauer. | |
15 | * Changed linked lists to use list.h instead of lists.h, 02/24/00, Bill | |
16 | * Wendling. | |
17 | * The list_for_each() macro wasn't appropriate for the sysctl loop. | |
18 | * Removed it and replaced it with older style, 03/23/00, Bill Wendling | |
19 | */ | |
20 | ||
1da177e4 LT |
21 | #include <linux/module.h> |
22 | #include <linux/mm.h> | |
23 | #include <linux/swap.h> | |
24 | #include <linux/slab.h> | |
25 | #include <linux/sysctl.h> | |
5a04cca6 | 26 | #include <linux/bitmap.h> |
d33ed52d | 27 | #include <linux/signal.h> |
455cd5ab | 28 | #include <linux/printk.h> |
1da177e4 | 29 | #include <linux/proc_fs.h> |
72c2d582 | 30 | #include <linux/security.h> |
1da177e4 | 31 | #include <linux/ctype.h> |
dfec072e | 32 | #include <linux/kmemcheck.h> |
fd4b616b | 33 | #include <linux/kmemleak.h> |
62239ac2 | 34 | #include <linux/fs.h> |
1da177e4 LT |
35 | #include <linux/init.h> |
36 | #include <linux/kernel.h> | |
0296b228 | 37 | #include <linux/kobject.h> |
20380731 | 38 | #include <linux/net.h> |
1da177e4 LT |
39 | #include <linux/sysrq.h> |
40 | #include <linux/highuid.h> | |
41 | #include <linux/writeback.h> | |
3fff4c42 | 42 | #include <linux/ratelimit.h> |
76ab0f53 | 43 | #include <linux/compaction.h> |
1da177e4 | 44 | #include <linux/hugetlb.h> |
1da177e4 | 45 | #include <linux/initrd.h> |
0b77f5bf | 46 | #include <linux/key.h> |
1da177e4 LT |
47 | #include <linux/times.h> |
48 | #include <linux/limits.h> | |
49 | #include <linux/dcache.h> | |
6e006701 | 50 | #include <linux/dnotify.h> |
1da177e4 | 51 | #include <linux/syscalls.h> |
c748e134 | 52 | #include <linux/vmstat.h> |
c255d844 PM |
53 | #include <linux/nfs_fs.h> |
54 | #include <linux/acpi.h> | |
10a0a8d4 | 55 | #include <linux/reboot.h> |
b0fc494f | 56 | #include <linux/ftrace.h> |
cdd6c482 | 57 | #include <linux/perf_event.h> |
b2be84df | 58 | #include <linux/kprobes.h> |
b492e95b | 59 | #include <linux/pipe_fs_i.h> |
8e4228e1 | 60 | #include <linux/oom.h> |
17f60a7d | 61 | #include <linux/kmod.h> |
73efc039 | 62 | #include <linux/capability.h> |
40401530 | 63 | #include <linux/binfmts.h> |
1da177e4 LT |
64 | |
65 | #include <asm/uaccess.h> | |
66 | #include <asm/processor.h> | |
67 | ||
29cbc78b AK |
68 | #ifdef CONFIG_X86 |
69 | #include <asm/nmi.h> | |
0741f4d2 | 70 | #include <asm/stacktrace.h> |
6e7c4025 | 71 | #include <asm/io.h> |
29cbc78b | 72 | #endif |
d550bbd4 DH |
73 | #ifdef CONFIG_SPARC |
74 | #include <asm/setup.h> | |
75 | #endif | |
c55b7c3e DY |
76 | #ifdef CONFIG_BSD_PROCESS_ACCT |
77 | #include <linux/acct.h> | |
78 | #endif | |
4f0e056f DY |
79 | #ifdef CONFIG_RT_MUTEXES |
80 | #include <linux/rtmutex.h> | |
81 | #endif | |
2edf5e49 DY |
82 | #if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_LOCK_STAT) |
83 | #include <linux/lockdep.h> | |
84 | #endif | |
15485a46 DY |
85 | #ifdef CONFIG_CHR_DEV_SG |
86 | #include <scsi/sg.h> | |
87 | #endif | |
29cbc78b | 88 | |
58687acb | 89 | #ifdef CONFIG_LOCKUP_DETECTOR |
504d7cf1 DZ |
90 | #include <linux/nmi.h> |
91 | #endif | |
92 | ||
7058cb02 | 93 | |
1da177e4 LT |
94 | #if defined(CONFIG_SYSCTL) |
95 | ||
96 | /* External variables not in a header file. */ | |
1da177e4 LT |
97 | extern int sysctl_overcommit_memory; |
98 | extern int sysctl_overcommit_ratio; | |
99 | extern int max_threads; | |
1da177e4 | 100 | extern int core_uses_pid; |
d6e71144 | 101 | extern int suid_dumpable; |
1da177e4 | 102 | extern char core_pattern[]; |
a293980c | 103 | extern unsigned int core_pipe_limit; |
1da177e4 LT |
104 | extern int pid_max; |
105 | extern int min_free_kbytes; | |
1da177e4 | 106 | extern int pid_max_min, pid_max_max; |
9d0243bc | 107 | extern int sysctl_drop_caches; |
8ad4b1fb | 108 | extern int percpu_pagelist_fraction; |
bebfa101 | 109 | extern int compat_log; |
9745512c | 110 | extern int latencytop_enabled; |
eceea0b3 | 111 | extern int sysctl_nr_open_min, sysctl_nr_open_max; |
dd8632a1 PM |
112 | #ifndef CONFIG_MMU |
113 | extern int sysctl_nr_trim_pages; | |
114 | #endif | |
cb684b5b | 115 | #ifdef CONFIG_BLOCK |
5e605b64 | 116 | extern int blk_iopoll_enabled; |
cb684b5b | 117 | #endif |
1da177e4 | 118 | |
c4f3b63f | 119 | /* Constants used for minimum and maximum */ |
2508ce18 | 120 | #ifdef CONFIG_LOCKUP_DETECTOR |
c4f3b63f | 121 | static int sixty = 60; |
9383d967 | 122 | static int neg_one = -1; |
c4f3b63f RT |
123 | #endif |
124 | ||
c4f3b63f | 125 | static int zero; |
cd5f9a4c LT |
126 | static int __maybe_unused one = 1; |
127 | static int __maybe_unused two = 2; | |
cb16e95f | 128 | static int __maybe_unused three = 3; |
fc3501d4 | 129 | static unsigned long one_ul = 1; |
c4f3b63f | 130 | static int one_hundred = 100; |
af91322e DY |
131 | #ifdef CONFIG_PRINTK |
132 | static int ten_thousand = 10000; | |
133 | #endif | |
c4f3b63f | 134 | |
9e4a5bda AR |
135 | /* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */ |
136 | static unsigned long dirty_bytes_min = 2 * PAGE_SIZE; | |
137 | ||
1da177e4 LT |
138 | /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */ |
139 | static int maxolduid = 65535; | |
140 | static int minolduid; | |
8ad4b1fb | 141 | static int min_percpu_pagelist_fract = 8; |
1da177e4 LT |
142 | |
143 | static int ngroups_max = NGROUPS_MAX; | |
73efc039 | 144 | static const int cap_last_cap = CAP_LAST_CAP; |
1da177e4 | 145 | |
d14f1729 DY |
146 | #ifdef CONFIG_INOTIFY_USER |
147 | #include <linux/inotify.h> | |
148 | #endif | |
72c57ed5 | 149 | #ifdef CONFIG_SPARC |
1da177e4 LT |
150 | #endif |
151 | ||
0871420f DM |
152 | #ifdef CONFIG_SPARC64 |
153 | extern int sysctl_tsb_ratio; | |
154 | #endif | |
155 | ||
1da177e4 LT |
156 | #ifdef __hppa__ |
157 | extern int pwrsw_enabled; | |
158 | extern int unaligned_enabled; | |
159 | #endif | |
1da177e4 | 160 | |
d2b176ed JS |
161 | #ifdef CONFIG_IA64 |
162 | extern int no_unaligned_warning; | |
88fc241f | 163 | extern int unaligned_dump_stack; |
d2b176ed JS |
164 | #endif |
165 | ||
d6f8ff73 | 166 | #ifdef CONFIG_PROC_SYSCTL |
8d65af78 | 167 | static int proc_do_cad_pid(struct ctl_table *table, int write, |
9ec52099 | 168 | void __user *buffer, size_t *lenp, loff_t *ppos); |
8d65af78 | 169 | static int proc_taint(struct ctl_table *table, int write, |
34f5a398 | 170 | void __user *buffer, size_t *lenp, loff_t *ppos); |
d6f8ff73 | 171 | #endif |
9ec52099 | 172 | |
bfdc0b49 | 173 | #ifdef CONFIG_PRINTK |
620f6e8e | 174 | static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write, |
bfdc0b49 RW |
175 | void __user *buffer, size_t *lenp, loff_t *ppos); |
176 | #endif | |
177 | ||
54b50199 KC |
178 | static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write, |
179 | void __user *buffer, size_t *lenp, loff_t *ppos); | |
180 | static int proc_dostring_coredump(struct ctl_table *table, int write, | |
181 | void __user *buffer, size_t *lenp, loff_t *ppos); | |
182 | ||
97f5f0cd | 183 | #ifdef CONFIG_MAGIC_SYSRQ |
8c6a98b2 AW |
184 | /* Note: sysrq code uses it's own private copy */ |
185 | static int __sysrq_enabled = SYSRQ_DEFAULT_ENABLE; | |
97f5f0cd DT |
186 | |
187 | static int sysrq_sysctl_handler(ctl_table *table, int write, | |
188 | void __user *buffer, size_t *lenp, | |
189 | loff_t *ppos) | |
190 | { | |
191 | int error; | |
192 | ||
193 | error = proc_dointvec(table, write, buffer, lenp, ppos); | |
194 | if (error) | |
195 | return error; | |
196 | ||
197 | if (write) | |
198 | sysrq_toggle_support(__sysrq_enabled); | |
199 | ||
200 | return 0; | |
201 | } | |
202 | ||
203 | #endif | |
204 | ||
d8217f07 EB |
205 | static struct ctl_table kern_table[]; |
206 | static struct ctl_table vm_table[]; | |
207 | static struct ctl_table fs_table[]; | |
208 | static struct ctl_table debug_table[]; | |
209 | static struct ctl_table dev_table[]; | |
210 | extern struct ctl_table random_table[]; | |
7ef9964e DL |
211 | #ifdef CONFIG_EPOLL |
212 | extern struct ctl_table epoll_table[]; | |
213 | #endif | |
1da177e4 LT |
214 | |
215 | #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT | |
216 | int sysctl_legacy_va_layout; | |
217 | #endif | |
218 | ||
1da177e4 LT |
219 | /* The default sysctl tables: */ |
220 | ||
de4e83bd | 221 | static struct ctl_table sysctl_base_table[] = { |
1da177e4 | 222 | { |
1da177e4 LT |
223 | .procname = "kernel", |
224 | .mode = 0555, | |
225 | .child = kern_table, | |
226 | }, | |
227 | { | |
1da177e4 LT |
228 | .procname = "vm", |
229 | .mode = 0555, | |
230 | .child = vm_table, | |
231 | }, | |
1da177e4 | 232 | { |
1da177e4 LT |
233 | .procname = "fs", |
234 | .mode = 0555, | |
235 | .child = fs_table, | |
236 | }, | |
237 | { | |
1da177e4 LT |
238 | .procname = "debug", |
239 | .mode = 0555, | |
240 | .child = debug_table, | |
241 | }, | |
242 | { | |
1da177e4 LT |
243 | .procname = "dev", |
244 | .mode = 0555, | |
245 | .child = dev_table, | |
246 | }, | |
6fce56ec | 247 | { } |
1da177e4 LT |
248 | }; |
249 | ||
77e54a1f | 250 | #ifdef CONFIG_SCHED_DEBUG |
73c4efd2 ED |
251 | static int min_sched_granularity_ns = 100000; /* 100 usecs */ |
252 | static int max_sched_granularity_ns = NSEC_PER_SEC; /* 1 second */ | |
253 | static int min_wakeup_granularity_ns; /* 0 usecs */ | |
254 | static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ | |
1983a922 CE |
255 | static int min_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE; |
256 | static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1; | |
77e54a1f IM |
257 | #endif |
258 | ||
5e771905 MG |
259 | #ifdef CONFIG_COMPACTION |
260 | static int min_extfrag_threshold; | |
261 | static int max_extfrag_threshold = 1000; | |
262 | #endif | |
263 | ||
d8217f07 | 264 | static struct ctl_table kern_table[] = { |
2bba22c5 | 265 | { |
2bba22c5 MG |
266 | .procname = "sched_child_runs_first", |
267 | .data = &sysctl_sched_child_runs_first, | |
268 | .maxlen = sizeof(unsigned int), | |
269 | .mode = 0644, | |
6d456111 | 270 | .proc_handler = proc_dointvec, |
2bba22c5 | 271 | }, |
77e54a1f IM |
272 | #ifdef CONFIG_SCHED_DEBUG |
273 | { | |
b2be5e96 PZ |
274 | .procname = "sched_min_granularity_ns", |
275 | .data = &sysctl_sched_min_granularity, | |
77e54a1f IM |
276 | .maxlen = sizeof(unsigned int), |
277 | .mode = 0644, | |
702a7c76 | 278 | .proc_handler = sched_proc_update_handler, |
b2be5e96 PZ |
279 | .extra1 = &min_sched_granularity_ns, |
280 | .extra2 = &max_sched_granularity_ns, | |
77e54a1f | 281 | }, |
21805085 | 282 | { |
21805085 PZ |
283 | .procname = "sched_latency_ns", |
284 | .data = &sysctl_sched_latency, | |
285 | .maxlen = sizeof(unsigned int), | |
286 | .mode = 0644, | |
702a7c76 | 287 | .proc_handler = sched_proc_update_handler, |
21805085 PZ |
288 | .extra1 = &min_sched_granularity_ns, |
289 | .extra2 = &max_sched_granularity_ns, | |
290 | }, | |
77e54a1f | 291 | { |
77e54a1f IM |
292 | .procname = "sched_wakeup_granularity_ns", |
293 | .data = &sysctl_sched_wakeup_granularity, | |
294 | .maxlen = sizeof(unsigned int), | |
295 | .mode = 0644, | |
702a7c76 | 296 | .proc_handler = sched_proc_update_handler, |
77e54a1f IM |
297 | .extra1 = &min_wakeup_granularity_ns, |
298 | .extra2 = &max_wakeup_granularity_ns, | |
299 | }, | |
1983a922 | 300 | { |
1983a922 CE |
301 | .procname = "sched_tunable_scaling", |
302 | .data = &sysctl_sched_tunable_scaling, | |
303 | .maxlen = sizeof(enum sched_tunable_scaling), | |
304 | .mode = 0644, | |
702a7c76 | 305 | .proc_handler = sched_proc_update_handler, |
1983a922 CE |
306 | .extra1 = &min_sched_tunable_scaling, |
307 | .extra2 = &max_sched_tunable_scaling, | |
2398f2c6 | 308 | }, |
da84d961 | 309 | { |
da84d961 IM |
310 | .procname = "sched_migration_cost", |
311 | .data = &sysctl_sched_migration_cost, | |
312 | .maxlen = sizeof(unsigned int), | |
313 | .mode = 0644, | |
6d456111 | 314 | .proc_handler = proc_dointvec, |
da84d961 | 315 | }, |
b82d9fdd | 316 | { |
b82d9fdd PZ |
317 | .procname = "sched_nr_migrate", |
318 | .data = &sysctl_sched_nr_migrate, | |
319 | .maxlen = sizeof(unsigned int), | |
fa85ae24 | 320 | .mode = 0644, |
6d456111 | 321 | .proc_handler = proc_dointvec, |
fa85ae24 | 322 | }, |
e9e9250b | 323 | { |
e9e9250b PZ |
324 | .procname = "sched_time_avg", |
325 | .data = &sysctl_sched_time_avg, | |
326 | .maxlen = sizeof(unsigned int), | |
327 | .mode = 0644, | |
6d456111 | 328 | .proc_handler = proc_dointvec, |
e9e9250b | 329 | }, |
a7a4f8a7 PT |
330 | { |
331 | .procname = "sched_shares_window", | |
332 | .data = &sysctl_sched_shares_window, | |
333 | .maxlen = sizeof(unsigned int), | |
334 | .mode = 0644, | |
335 | .proc_handler = proc_dointvec, | |
336 | }, | |
cd1bb94b | 337 | { |
cd1bb94b AB |
338 | .procname = "timer_migration", |
339 | .data = &sysctl_timer_migration, | |
340 | .maxlen = sizeof(unsigned int), | |
341 | .mode = 0644, | |
6d456111 | 342 | .proc_handler = proc_dointvec_minmax, |
bfdb4d9f AB |
343 | .extra1 = &zero, |
344 | .extra2 = &one, | |
fa85ae24 | 345 | }, |
1fc84aaa | 346 | #endif |
9f0c1e56 | 347 | { |
9f0c1e56 PZ |
348 | .procname = "sched_rt_period_us", |
349 | .data = &sysctl_sched_rt_period, | |
350 | .maxlen = sizeof(unsigned int), | |
351 | .mode = 0644, | |
6d456111 | 352 | .proc_handler = sched_rt_handler, |
9f0c1e56 PZ |
353 | }, |
354 | { | |
9f0c1e56 PZ |
355 | .procname = "sched_rt_runtime_us", |
356 | .data = &sysctl_sched_rt_runtime, | |
357 | .maxlen = sizeof(int), | |
358 | .mode = 0644, | |
6d456111 | 359 | .proc_handler = sched_rt_handler, |
9f0c1e56 | 360 | }, |
5091faa4 MG |
361 | #ifdef CONFIG_SCHED_AUTOGROUP |
362 | { | |
363 | .procname = "sched_autogroup_enabled", | |
364 | .data = &sysctl_sched_autogroup_enabled, | |
365 | .maxlen = sizeof(unsigned int), | |
366 | .mode = 0644, | |
1747b21f | 367 | .proc_handler = proc_dointvec_minmax, |
5091faa4 MG |
368 | .extra1 = &zero, |
369 | .extra2 = &one, | |
370 | }, | |
371 | #endif | |
ec12cb7f PT |
372 | #ifdef CONFIG_CFS_BANDWIDTH |
373 | { | |
374 | .procname = "sched_cfs_bandwidth_slice_us", | |
375 | .data = &sysctl_sched_cfs_bandwidth_slice, | |
376 | .maxlen = sizeof(unsigned int), | |
377 | .mode = 0644, | |
378 | .proc_handler = proc_dointvec_minmax, | |
379 | .extra1 = &one, | |
380 | }, | |
381 | #endif | |
f20786ff PZ |
382 | #ifdef CONFIG_PROVE_LOCKING |
383 | { | |
f20786ff PZ |
384 | .procname = "prove_locking", |
385 | .data = &prove_locking, | |
386 | .maxlen = sizeof(int), | |
387 | .mode = 0644, | |
6d456111 | 388 | .proc_handler = proc_dointvec, |
f20786ff PZ |
389 | }, |
390 | #endif | |
391 | #ifdef CONFIG_LOCK_STAT | |
392 | { | |
f20786ff PZ |
393 | .procname = "lock_stat", |
394 | .data = &lock_stat, | |
395 | .maxlen = sizeof(int), | |
396 | .mode = 0644, | |
6d456111 | 397 | .proc_handler = proc_dointvec, |
f20786ff | 398 | }, |
77e54a1f | 399 | #endif |
1da177e4 | 400 | { |
1da177e4 LT |
401 | .procname = "panic", |
402 | .data = &panic_timeout, | |
403 | .maxlen = sizeof(int), | |
404 | .mode = 0644, | |
6d456111 | 405 | .proc_handler = proc_dointvec, |
1da177e4 LT |
406 | }, |
407 | { | |
1da177e4 LT |
408 | .procname = "core_uses_pid", |
409 | .data = &core_uses_pid, | |
410 | .maxlen = sizeof(int), | |
411 | .mode = 0644, | |
6d456111 | 412 | .proc_handler = proc_dointvec, |
1da177e4 LT |
413 | }, |
414 | { | |
1da177e4 LT |
415 | .procname = "core_pattern", |
416 | .data = core_pattern, | |
71ce92f3 | 417 | .maxlen = CORENAME_MAX_SIZE, |
1da177e4 | 418 | .mode = 0644, |
54b50199 | 419 | .proc_handler = proc_dostring_coredump, |
1da177e4 | 420 | }, |
a293980c | 421 | { |
a293980c NH |
422 | .procname = "core_pipe_limit", |
423 | .data = &core_pipe_limit, | |
424 | .maxlen = sizeof(unsigned int), | |
425 | .mode = 0644, | |
6d456111 | 426 | .proc_handler = proc_dointvec, |
a293980c | 427 | }, |
34f5a398 | 428 | #ifdef CONFIG_PROC_SYSCTL |
1da177e4 | 429 | { |
1da177e4 | 430 | .procname = "tainted", |
25ddbb18 | 431 | .maxlen = sizeof(long), |
34f5a398 | 432 | .mode = 0644, |
6d456111 | 433 | .proc_handler = proc_taint, |
1da177e4 | 434 | }, |
34f5a398 | 435 | #endif |
9745512c AV |
436 | #ifdef CONFIG_LATENCYTOP |
437 | { | |
438 | .procname = "latencytop", | |
439 | .data = &latencytop_enabled, | |
440 | .maxlen = sizeof(int), | |
441 | .mode = 0644, | |
6d456111 | 442 | .proc_handler = proc_dointvec, |
9745512c AV |
443 | }, |
444 | #endif | |
1da177e4 LT |
445 | #ifdef CONFIG_BLK_DEV_INITRD |
446 | { | |
1da177e4 LT |
447 | .procname = "real-root-dev", |
448 | .data = &real_root_dev, | |
449 | .maxlen = sizeof(int), | |
450 | .mode = 0644, | |
6d456111 | 451 | .proc_handler = proc_dointvec, |
1da177e4 LT |
452 | }, |
453 | #endif | |
45807a1d | 454 | { |
45807a1d IM |
455 | .procname = "print-fatal-signals", |
456 | .data = &print_fatal_signals, | |
457 | .maxlen = sizeof(int), | |
458 | .mode = 0644, | |
6d456111 | 459 | .proc_handler = proc_dointvec, |
45807a1d | 460 | }, |
72c57ed5 | 461 | #ifdef CONFIG_SPARC |
1da177e4 | 462 | { |
1da177e4 LT |
463 | .procname = "reboot-cmd", |
464 | .data = reboot_command, | |
465 | .maxlen = 256, | |
466 | .mode = 0644, | |
6d456111 | 467 | .proc_handler = proc_dostring, |
1da177e4 LT |
468 | }, |
469 | { | |
1da177e4 LT |
470 | .procname = "stop-a", |
471 | .data = &stop_a_enabled, | |
472 | .maxlen = sizeof (int), | |
473 | .mode = 0644, | |
6d456111 | 474 | .proc_handler = proc_dointvec, |
1da177e4 LT |
475 | }, |
476 | { | |
1da177e4 LT |
477 | .procname = "scons-poweroff", |
478 | .data = &scons_pwroff, | |
479 | .maxlen = sizeof (int), | |
480 | .mode = 0644, | |
6d456111 | 481 | .proc_handler = proc_dointvec, |
1da177e4 LT |
482 | }, |
483 | #endif | |
0871420f DM |
484 | #ifdef CONFIG_SPARC64 |
485 | { | |
0871420f DM |
486 | .procname = "tsb-ratio", |
487 | .data = &sysctl_tsb_ratio, | |
488 | .maxlen = sizeof (int), | |
489 | .mode = 0644, | |
6d456111 | 490 | .proc_handler = proc_dointvec, |
0871420f DM |
491 | }, |
492 | #endif | |
1da177e4 LT |
493 | #ifdef __hppa__ |
494 | { | |
1da177e4 LT |
495 | .procname = "soft-power", |
496 | .data = &pwrsw_enabled, | |
497 | .maxlen = sizeof (int), | |
498 | .mode = 0644, | |
6d456111 | 499 | .proc_handler = proc_dointvec, |
1da177e4 LT |
500 | }, |
501 | { | |
1da177e4 LT |
502 | .procname = "unaligned-trap", |
503 | .data = &unaligned_enabled, | |
504 | .maxlen = sizeof (int), | |
505 | .mode = 0644, | |
6d456111 | 506 | .proc_handler = proc_dointvec, |
1da177e4 LT |
507 | }, |
508 | #endif | |
509 | { | |
1da177e4 LT |
510 | .procname = "ctrl-alt-del", |
511 | .data = &C_A_D, | |
512 | .maxlen = sizeof(int), | |
513 | .mode = 0644, | |
6d456111 | 514 | .proc_handler = proc_dointvec, |
1da177e4 | 515 | }, |
606576ce | 516 | #ifdef CONFIG_FUNCTION_TRACER |
b0fc494f | 517 | { |
b0fc494f SR |
518 | .procname = "ftrace_enabled", |
519 | .data = &ftrace_enabled, | |
520 | .maxlen = sizeof(int), | |
521 | .mode = 0644, | |
6d456111 | 522 | .proc_handler = ftrace_enable_sysctl, |
b0fc494f SR |
523 | }, |
524 | #endif | |
f38f1d2a SR |
525 | #ifdef CONFIG_STACK_TRACER |
526 | { | |
f38f1d2a SR |
527 | .procname = "stack_tracer_enabled", |
528 | .data = &stack_tracer_enabled, | |
529 | .maxlen = sizeof(int), | |
530 | .mode = 0644, | |
6d456111 | 531 | .proc_handler = stack_trace_sysctl, |
f38f1d2a SR |
532 | }, |
533 | #endif | |
944ac425 SR |
534 | #ifdef CONFIG_TRACING |
535 | { | |
3299b4dd | 536 | .procname = "ftrace_dump_on_oops", |
944ac425 SR |
537 | .data = &ftrace_dump_on_oops, |
538 | .maxlen = sizeof(int), | |
539 | .mode = 0644, | |
6d456111 | 540 | .proc_handler = proc_dointvec, |
944ac425 SR |
541 | }, |
542 | #endif | |
a1ef5adb | 543 | #ifdef CONFIG_MODULES |
1da177e4 | 544 | { |
1da177e4 LT |
545 | .procname = "modprobe", |
546 | .data = &modprobe_path, | |
547 | .maxlen = KMOD_PATH_LEN, | |
548 | .mode = 0644, | |
6d456111 | 549 | .proc_handler = proc_dostring, |
1da177e4 | 550 | }, |
3d43321b | 551 | { |
3d43321b KC |
552 | .procname = "modules_disabled", |
553 | .data = &modules_disabled, | |
554 | .maxlen = sizeof(int), | |
555 | .mode = 0644, | |
556 | /* only handle a transition from default "0" to "1" */ | |
6d456111 | 557 | .proc_handler = proc_dointvec_minmax, |
3d43321b KC |
558 | .extra1 = &one, |
559 | .extra2 = &one, | |
560 | }, | |
1da177e4 | 561 | #endif |
94f17cd7 | 562 | #ifdef CONFIG_HOTPLUG |
1da177e4 | 563 | { |
1da177e4 | 564 | .procname = "hotplug", |
312c004d KS |
565 | .data = &uevent_helper, |
566 | .maxlen = UEVENT_HELPER_PATH_LEN, | |
1da177e4 | 567 | .mode = 0644, |
6d456111 | 568 | .proc_handler = proc_dostring, |
1da177e4 LT |
569 | }, |
570 | #endif | |
571 | #ifdef CONFIG_CHR_DEV_SG | |
572 | { | |
1da177e4 LT |
573 | .procname = "sg-big-buff", |
574 | .data = &sg_big_buff, | |
575 | .maxlen = sizeof (int), | |
576 | .mode = 0444, | |
6d456111 | 577 | .proc_handler = proc_dointvec, |
1da177e4 LT |
578 | }, |
579 | #endif | |
580 | #ifdef CONFIG_BSD_PROCESS_ACCT | |
581 | { | |
1da177e4 LT |
582 | .procname = "acct", |
583 | .data = &acct_parm, | |
584 | .maxlen = 3*sizeof(int), | |
585 | .mode = 0644, | |
6d456111 | 586 | .proc_handler = proc_dointvec, |
1da177e4 LT |
587 | }, |
588 | #endif | |
1da177e4 LT |
589 | #ifdef CONFIG_MAGIC_SYSRQ |
590 | { | |
1da177e4 | 591 | .procname = "sysrq", |
5d6f647f | 592 | .data = &__sysrq_enabled, |
1da177e4 LT |
593 | .maxlen = sizeof (int), |
594 | .mode = 0644, | |
97f5f0cd | 595 | .proc_handler = sysrq_sysctl_handler, |
1da177e4 LT |
596 | }, |
597 | #endif | |
d6f8ff73 | 598 | #ifdef CONFIG_PROC_SYSCTL |
1da177e4 | 599 | { |
1da177e4 | 600 | .procname = "cad_pid", |
9ec52099 | 601 | .data = NULL, |
1da177e4 LT |
602 | .maxlen = sizeof (int), |
603 | .mode = 0600, | |
6d456111 | 604 | .proc_handler = proc_do_cad_pid, |
1da177e4 | 605 | }, |
d6f8ff73 | 606 | #endif |
1da177e4 | 607 | { |
1da177e4 LT |
608 | .procname = "threads-max", |
609 | .data = &max_threads, | |
610 | .maxlen = sizeof(int), | |
611 | .mode = 0644, | |
6d456111 | 612 | .proc_handler = proc_dointvec, |
1da177e4 LT |
613 | }, |
614 | { | |
1da177e4 LT |
615 | .procname = "random", |
616 | .mode = 0555, | |
617 | .child = random_table, | |
618 | }, | |
17f60a7d EP |
619 | { |
620 | .procname = "usermodehelper", | |
621 | .mode = 0555, | |
622 | .child = usermodehelper_table, | |
623 | }, | |
1da177e4 | 624 | { |
1da177e4 LT |
625 | .procname = "overflowuid", |
626 | .data = &overflowuid, | |
627 | .maxlen = sizeof(int), | |
628 | .mode = 0644, | |
6d456111 | 629 | .proc_handler = proc_dointvec_minmax, |
1da177e4 LT |
630 | .extra1 = &minolduid, |
631 | .extra2 = &maxolduid, | |
632 | }, | |
633 | { | |
1da177e4 LT |
634 | .procname = "overflowgid", |
635 | .data = &overflowgid, | |
636 | .maxlen = sizeof(int), | |
637 | .mode = 0644, | |
6d456111 | 638 | .proc_handler = proc_dointvec_minmax, |
1da177e4 LT |
639 | .extra1 = &minolduid, |
640 | .extra2 = &maxolduid, | |
641 | }, | |
347a8dc3 | 642 | #ifdef CONFIG_S390 |
1da177e4 LT |
643 | #ifdef CONFIG_MATHEMU |
644 | { | |
1da177e4 LT |
645 | .procname = "ieee_emulation_warnings", |
646 | .data = &sysctl_ieee_emulation_warnings, | |
647 | .maxlen = sizeof(int), | |
648 | .mode = 0644, | |
6d456111 | 649 | .proc_handler = proc_dointvec, |
1da177e4 | 650 | }, |
1da177e4 LT |
651 | #endif |
652 | { | |
1da177e4 | 653 | .procname = "userprocess_debug", |
ab3c68ee | 654 | .data = &show_unhandled_signals, |
1da177e4 LT |
655 | .maxlen = sizeof(int), |
656 | .mode = 0644, | |
6d456111 | 657 | .proc_handler = proc_dointvec, |
1da177e4 LT |
658 | }, |
659 | #endif | |
660 | { | |
1da177e4 LT |
661 | .procname = "pid_max", |
662 | .data = &pid_max, | |
663 | .maxlen = sizeof (int), | |
664 | .mode = 0644, | |
6d456111 | 665 | .proc_handler = proc_dointvec_minmax, |
1da177e4 LT |
666 | .extra1 = &pid_max_min, |
667 | .extra2 = &pid_max_max, | |
668 | }, | |
669 | { | |
1da177e4 LT |
670 | .procname = "panic_on_oops", |
671 | .data = &panic_on_oops, | |
672 | .maxlen = sizeof(int), | |
673 | .mode = 0644, | |
6d456111 | 674 | .proc_handler = proc_dointvec, |
1da177e4 | 675 | }, |
7ef3d2fd JP |
676 | #if defined CONFIG_PRINTK |
677 | { | |
7ef3d2fd JP |
678 | .procname = "printk", |
679 | .data = &console_loglevel, | |
680 | .maxlen = 4*sizeof(int), | |
681 | .mode = 0644, | |
6d456111 | 682 | .proc_handler = proc_dointvec, |
7ef3d2fd | 683 | }, |
1da177e4 | 684 | { |
1da177e4 | 685 | .procname = "printk_ratelimit", |
717115e1 | 686 | .data = &printk_ratelimit_state.interval, |
1da177e4 LT |
687 | .maxlen = sizeof(int), |
688 | .mode = 0644, | |
6d456111 | 689 | .proc_handler = proc_dointvec_jiffies, |
1da177e4 LT |
690 | }, |
691 | { | |
1da177e4 | 692 | .procname = "printk_ratelimit_burst", |
717115e1 | 693 | .data = &printk_ratelimit_state.burst, |
1da177e4 LT |
694 | .maxlen = sizeof(int), |
695 | .mode = 0644, | |
6d456111 | 696 | .proc_handler = proc_dointvec, |
1da177e4 | 697 | }, |
af91322e | 698 | { |
af91322e DY |
699 | .procname = "printk_delay", |
700 | .data = &printk_delay_msec, | |
701 | .maxlen = sizeof(int), | |
702 | .mode = 0644, | |
6d456111 | 703 | .proc_handler = proc_dointvec_minmax, |
af91322e DY |
704 | .extra1 = &zero, |
705 | .extra2 = &ten_thousand, | |
706 | }, | |
eaf06b24 DR |
707 | { |
708 | .procname = "dmesg_restrict", | |
709 | .data = &dmesg_restrict, | |
710 | .maxlen = sizeof(int), | |
711 | .mode = 0644, | |
620f6e8e | 712 | .proc_handler = proc_dointvec_minmax_sysadmin, |
eaf06b24 DR |
713 | .extra1 = &zero, |
714 | .extra2 = &one, | |
715 | }, | |
455cd5ab DR |
716 | { |
717 | .procname = "kptr_restrict", | |
718 | .data = &kptr_restrict, | |
719 | .maxlen = sizeof(int), | |
720 | .mode = 0644, | |
620f6e8e | 721 | .proc_handler = proc_dointvec_minmax_sysadmin, |
455cd5ab DR |
722 | .extra1 = &zero, |
723 | .extra2 = &two, | |
724 | }, | |
df6e61d4 | 725 | #endif |
1da177e4 | 726 | { |
1da177e4 LT |
727 | .procname = "ngroups_max", |
728 | .data = &ngroups_max, | |
729 | .maxlen = sizeof (int), | |
730 | .mode = 0444, | |
6d456111 | 731 | .proc_handler = proc_dointvec, |
1da177e4 | 732 | }, |
73efc039 DB |
733 | { |
734 | .procname = "cap_last_cap", | |
735 | .data = (void *)&cap_last_cap, | |
736 | .maxlen = sizeof(int), | |
737 | .mode = 0444, | |
738 | .proc_handler = proc_dointvec, | |
739 | }, | |
58687acb | 740 | #if defined(CONFIG_LOCKUP_DETECTOR) |
504d7cf1 | 741 | { |
58687acb DZ |
742 | .procname = "watchdog", |
743 | .data = &watchdog_enabled, | |
504d7cf1 DZ |
744 | .maxlen = sizeof (int), |
745 | .mode = 0644, | |
586692a5 MSB |
746 | .proc_handler = proc_dowatchdog, |
747 | .extra1 = &zero, | |
748 | .extra2 = &one, | |
58687acb DZ |
749 | }, |
750 | { | |
751 | .procname = "watchdog_thresh", | |
586692a5 | 752 | .data = &watchdog_thresh, |
58687acb DZ |
753 | .maxlen = sizeof(int), |
754 | .mode = 0644, | |
586692a5 | 755 | .proc_handler = proc_dowatchdog, |
58687acb DZ |
756 | .extra1 = &neg_one, |
757 | .extra2 = &sixty, | |
504d7cf1 | 758 | }, |
2508ce18 DZ |
759 | { |
760 | .procname = "softlockup_panic", | |
761 | .data = &softlockup_panic, | |
762 | .maxlen = sizeof(int), | |
763 | .mode = 0644, | |
764 | .proc_handler = proc_dointvec_minmax, | |
765 | .extra1 = &zero, | |
766 | .extra2 = &one, | |
767 | }, | |
5dc30558 DZ |
768 | { |
769 | .procname = "nmi_watchdog", | |
770 | .data = &watchdog_enabled, | |
771 | .maxlen = sizeof (int), | |
772 | .mode = 0644, | |
586692a5 MSB |
773 | .proc_handler = proc_dowatchdog, |
774 | .extra1 = &zero, | |
775 | .extra2 = &one, | |
5dc30558 DZ |
776 | }, |
777 | #endif | |
778 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) | |
779 | { | |
780 | .procname = "unknown_nmi_panic", | |
781 | .data = &unknown_nmi_panic, | |
782 | .maxlen = sizeof (int), | |
783 | .mode = 0644, | |
784 | .proc_handler = proc_dointvec, | |
785 | }, | |
504d7cf1 | 786 | #endif |
1da177e4 | 787 | #if defined(CONFIG_X86) |
8da5adda | 788 | { |
8da5adda DZ |
789 | .procname = "panic_on_unrecovered_nmi", |
790 | .data = &panic_on_unrecovered_nmi, | |
791 | .maxlen = sizeof(int), | |
792 | .mode = 0644, | |
6d456111 | 793 | .proc_handler = proc_dointvec, |
8da5adda | 794 | }, |
5211a242 | 795 | { |
5211a242 KG |
796 | .procname = "panic_on_io_nmi", |
797 | .data = &panic_on_io_nmi, | |
798 | .maxlen = sizeof(int), | |
799 | .mode = 0644, | |
6d456111 | 800 | .proc_handler = proc_dointvec, |
5211a242 | 801 | }, |
55af7796 MH |
802 | #ifdef CONFIG_DEBUG_STACKOVERFLOW |
803 | { | |
804 | .procname = "panic_on_stackoverflow", | |
805 | .data = &sysctl_panic_on_stackoverflow, | |
806 | .maxlen = sizeof(int), | |
807 | .mode = 0644, | |
808 | .proc_handler = proc_dointvec, | |
809 | }, | |
810 | #endif | |
1da177e4 | 811 | { |
1da177e4 LT |
812 | .procname = "bootloader_type", |
813 | .data = &bootloader_type, | |
814 | .maxlen = sizeof (int), | |
815 | .mode = 0444, | |
6d456111 | 816 | .proc_handler = proc_dointvec, |
1da177e4 | 817 | }, |
5031296c | 818 | { |
5031296c PA |
819 | .procname = "bootloader_version", |
820 | .data = &bootloader_version, | |
821 | .maxlen = sizeof (int), | |
822 | .mode = 0444, | |
6d456111 | 823 | .proc_handler = proc_dointvec, |
5031296c | 824 | }, |
0741f4d2 | 825 | { |
0741f4d2 CE |
826 | .procname = "kstack_depth_to_print", |
827 | .data = &kstack_depth_to_print, | |
828 | .maxlen = sizeof(int), | |
829 | .mode = 0644, | |
6d456111 | 830 | .proc_handler = proc_dointvec, |
0741f4d2 | 831 | }, |
6e7c4025 | 832 | { |
6e7c4025 IM |
833 | .procname = "io_delay_type", |
834 | .data = &io_delay_type, | |
835 | .maxlen = sizeof(int), | |
836 | .mode = 0644, | |
6d456111 | 837 | .proc_handler = proc_dointvec, |
6e7c4025 | 838 | }, |
1da177e4 | 839 | #endif |
7a9166e3 | 840 | #if defined(CONFIG_MMU) |
1da177e4 | 841 | { |
1da177e4 LT |
842 | .procname = "randomize_va_space", |
843 | .data = &randomize_va_space, | |
844 | .maxlen = sizeof(int), | |
845 | .mode = 0644, | |
6d456111 | 846 | .proc_handler = proc_dointvec, |
1da177e4 | 847 | }, |
7a9166e3 | 848 | #endif |
0152fb37 | 849 | #if defined(CONFIG_S390) && defined(CONFIG_SMP) |
951f22d5 | 850 | { |
951f22d5 MS |
851 | .procname = "spin_retry", |
852 | .data = &spin_retry, | |
853 | .maxlen = sizeof (int), | |
854 | .mode = 0644, | |
6d456111 | 855 | .proc_handler = proc_dointvec, |
951f22d5 | 856 | }, |
c255d844 | 857 | #endif |
673d5b43 | 858 | #if defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86) |
c255d844 | 859 | { |
c255d844 | 860 | .procname = "acpi_video_flags", |
77afcf78 | 861 | .data = &acpi_realmode_flags, |
c255d844 PM |
862 | .maxlen = sizeof (unsigned long), |
863 | .mode = 0644, | |
6d456111 | 864 | .proc_handler = proc_doulongvec_minmax, |
c255d844 | 865 | }, |
d2b176ed JS |
866 | #endif |
867 | #ifdef CONFIG_IA64 | |
868 | { | |
d2b176ed JS |
869 | .procname = "ignore-unaligned-usertrap", |
870 | .data = &no_unaligned_warning, | |
871 | .maxlen = sizeof (int), | |
872 | .mode = 0644, | |
6d456111 | 873 | .proc_handler = proc_dointvec, |
d2b176ed | 874 | }, |
88fc241f | 875 | { |
88fc241f DC |
876 | .procname = "unaligned-dump-stack", |
877 | .data = &unaligned_dump_stack, | |
878 | .maxlen = sizeof (int), | |
879 | .mode = 0644, | |
6d456111 | 880 | .proc_handler = proc_dointvec, |
88fc241f | 881 | }, |
bebfa101 | 882 | #endif |
e162b39a MSB |
883 | #ifdef CONFIG_DETECT_HUNG_TASK |
884 | { | |
e162b39a MSB |
885 | .procname = "hung_task_panic", |
886 | .data = &sysctl_hung_task_panic, | |
887 | .maxlen = sizeof(int), | |
888 | .mode = 0644, | |
6d456111 | 889 | .proc_handler = proc_dointvec_minmax, |
e162b39a MSB |
890 | .extra1 = &zero, |
891 | .extra2 = &one, | |
892 | }, | |
82a1fcb9 | 893 | { |
82a1fcb9 IM |
894 | .procname = "hung_task_check_count", |
895 | .data = &sysctl_hung_task_check_count, | |
90739081 | 896 | .maxlen = sizeof(unsigned long), |
82a1fcb9 | 897 | .mode = 0644, |
6d456111 | 898 | .proc_handler = proc_doulongvec_minmax, |
82a1fcb9 IM |
899 | }, |
900 | { | |
82a1fcb9 IM |
901 | .procname = "hung_task_timeout_secs", |
902 | .data = &sysctl_hung_task_timeout_secs, | |
90739081 | 903 | .maxlen = sizeof(unsigned long), |
82a1fcb9 | 904 | .mode = 0644, |
6d456111 | 905 | .proc_handler = proc_dohung_task_timeout_secs, |
82a1fcb9 IM |
906 | }, |
907 | { | |
82a1fcb9 IM |
908 | .procname = "hung_task_warnings", |
909 | .data = &sysctl_hung_task_warnings, | |
90739081 | 910 | .maxlen = sizeof(unsigned long), |
82a1fcb9 | 911 | .mode = 0644, |
6d456111 | 912 | .proc_handler = proc_doulongvec_minmax, |
82a1fcb9 | 913 | }, |
c4f3b63f | 914 | #endif |
bebfa101 AK |
915 | #ifdef CONFIG_COMPAT |
916 | { | |
bebfa101 AK |
917 | .procname = "compat-log", |
918 | .data = &compat_log, | |
919 | .maxlen = sizeof (int), | |
920 | .mode = 0644, | |
6d456111 | 921 | .proc_handler = proc_dointvec, |
bebfa101 | 922 | }, |
951f22d5 | 923 | #endif |
23f78d4a IM |
924 | #ifdef CONFIG_RT_MUTEXES |
925 | { | |
23f78d4a IM |
926 | .procname = "max_lock_depth", |
927 | .data = &max_lock_depth, | |
928 | .maxlen = sizeof(int), | |
929 | .mode = 0644, | |
6d456111 | 930 | .proc_handler = proc_dointvec, |
23f78d4a | 931 | }, |
5096add8 | 932 | #endif |
10a0a8d4 | 933 | { |
10a0a8d4 JF |
934 | .procname = "poweroff_cmd", |
935 | .data = &poweroff_cmd, | |
936 | .maxlen = POWEROFF_CMD_PATH_LEN, | |
937 | .mode = 0644, | |
6d456111 | 938 | .proc_handler = proc_dostring, |
10a0a8d4 | 939 | }, |
0b77f5bf DH |
940 | #ifdef CONFIG_KEYS |
941 | { | |
0b77f5bf DH |
942 | .procname = "keys", |
943 | .mode = 0555, | |
944 | .child = key_sysctls, | |
945 | }, | |
946 | #endif | |
31a72bce PM |
947 | #ifdef CONFIG_RCU_TORTURE_TEST |
948 | { | |
31a72bce PM |
949 | .procname = "rcutorture_runnable", |
950 | .data = &rcutorture_runnable, | |
951 | .maxlen = sizeof(int), | |
952 | .mode = 0644, | |
6d456111 | 953 | .proc_handler = proc_dointvec, |
31a72bce PM |
954 | }, |
955 | #endif | |
cdd6c482 | 956 | #ifdef CONFIG_PERF_EVENTS |
aa4a2218 VW |
957 | /* |
958 | * User-space scripts rely on the existence of this file | |
959 | * as a feature check for perf_events being enabled. | |
960 | * | |
961 | * So it's an ABI, do not remove! | |
962 | */ | |
1ccd1549 | 963 | { |
cdd6c482 IM |
964 | .procname = "perf_event_paranoid", |
965 | .data = &sysctl_perf_event_paranoid, | |
966 | .maxlen = sizeof(sysctl_perf_event_paranoid), | |
1ccd1549 | 967 | .mode = 0644, |
6d456111 | 968 | .proc_handler = proc_dointvec, |
1ccd1549 | 969 | }, |
c5078f78 | 970 | { |
cdd6c482 IM |
971 | .procname = "perf_event_mlock_kb", |
972 | .data = &sysctl_perf_event_mlock, | |
973 | .maxlen = sizeof(sysctl_perf_event_mlock), | |
c5078f78 | 974 | .mode = 0644, |
6d456111 | 975 | .proc_handler = proc_dointvec, |
c5078f78 | 976 | }, |
a78ac325 | 977 | { |
cdd6c482 IM |
978 | .procname = "perf_event_max_sample_rate", |
979 | .data = &sysctl_perf_event_sample_rate, | |
980 | .maxlen = sizeof(sysctl_perf_event_sample_rate), | |
a78ac325 | 981 | .mode = 0644, |
163ec435 | 982 | .proc_handler = perf_proc_update_handler, |
a78ac325 | 983 | }, |
1ccd1549 | 984 | #endif |
dfec072e VN |
985 | #ifdef CONFIG_KMEMCHECK |
986 | { | |
dfec072e VN |
987 | .procname = "kmemcheck", |
988 | .data = &kmemcheck_enabled, | |
989 | .maxlen = sizeof(int), | |
990 | .mode = 0644, | |
6d456111 | 991 | .proc_handler = proc_dointvec, |
dfec072e VN |
992 | }, |
993 | #endif | |
cb684b5b | 994 | #ifdef CONFIG_BLOCK |
5e605b64 | 995 | { |
5e605b64 JA |
996 | .procname = "blk_iopoll", |
997 | .data = &blk_iopoll_enabled, | |
998 | .maxlen = sizeof(int), | |
999 | .mode = 0644, | |
6d456111 | 1000 | .proc_handler = proc_dointvec, |
5e605b64 | 1001 | }, |
cb684b5b | 1002 | #endif |
6fce56ec | 1003 | { } |
1da177e4 LT |
1004 | }; |
1005 | ||
d8217f07 | 1006 | static struct ctl_table vm_table[] = { |
1da177e4 | 1007 | { |
1da177e4 LT |
1008 | .procname = "overcommit_memory", |
1009 | .data = &sysctl_overcommit_memory, | |
1010 | .maxlen = sizeof(sysctl_overcommit_memory), | |
1011 | .mode = 0644, | |
cb16e95f PH |
1012 | .proc_handler = proc_dointvec_minmax, |
1013 | .extra1 = &zero, | |
1014 | .extra2 = &two, | |
1da177e4 | 1015 | }, |
fadd8fbd | 1016 | { |
fadd8fbd KH |
1017 | .procname = "panic_on_oom", |
1018 | .data = &sysctl_panic_on_oom, | |
1019 | .maxlen = sizeof(sysctl_panic_on_oom), | |
1020 | .mode = 0644, | |
cb16e95f PH |
1021 | .proc_handler = proc_dointvec_minmax, |
1022 | .extra1 = &zero, | |
1023 | .extra2 = &two, | |
fadd8fbd | 1024 | }, |
fe071d7e | 1025 | { |
fe071d7e DR |
1026 | .procname = "oom_kill_allocating_task", |
1027 | .data = &sysctl_oom_kill_allocating_task, | |
1028 | .maxlen = sizeof(sysctl_oom_kill_allocating_task), | |
1029 | .mode = 0644, | |
6d456111 | 1030 | .proc_handler = proc_dointvec, |
fe071d7e | 1031 | }, |
fef1bdd6 | 1032 | { |
fef1bdd6 DR |
1033 | .procname = "oom_dump_tasks", |
1034 | .data = &sysctl_oom_dump_tasks, | |
1035 | .maxlen = sizeof(sysctl_oom_dump_tasks), | |
1036 | .mode = 0644, | |
6d456111 | 1037 | .proc_handler = proc_dointvec, |
fef1bdd6 | 1038 | }, |
1da177e4 | 1039 | { |
1da177e4 LT |
1040 | .procname = "overcommit_ratio", |
1041 | .data = &sysctl_overcommit_ratio, | |
1042 | .maxlen = sizeof(sysctl_overcommit_ratio), | |
1043 | .mode = 0644, | |
6d456111 | 1044 | .proc_handler = proc_dointvec, |
1da177e4 LT |
1045 | }, |
1046 | { | |
1da177e4 LT |
1047 | .procname = "page-cluster", |
1048 | .data = &page_cluster, | |
1049 | .maxlen = sizeof(int), | |
1050 | .mode = 0644, | |
cb16e95f PH |
1051 | .proc_handler = proc_dointvec_minmax, |
1052 | .extra1 = &zero, | |
1da177e4 LT |
1053 | }, |
1054 | { | |
1da177e4 LT |
1055 | .procname = "dirty_background_ratio", |
1056 | .data = &dirty_background_ratio, | |
1057 | .maxlen = sizeof(dirty_background_ratio), | |
1058 | .mode = 0644, | |
6d456111 | 1059 | .proc_handler = dirty_background_ratio_handler, |
1da177e4 LT |
1060 | .extra1 = &zero, |
1061 | .extra2 = &one_hundred, | |
1062 | }, | |
2da02997 | 1063 | { |
2da02997 DR |
1064 | .procname = "dirty_background_bytes", |
1065 | .data = &dirty_background_bytes, | |
1066 | .maxlen = sizeof(dirty_background_bytes), | |
1067 | .mode = 0644, | |
6d456111 | 1068 | .proc_handler = dirty_background_bytes_handler, |
fc3501d4 | 1069 | .extra1 = &one_ul, |
2da02997 | 1070 | }, |
1da177e4 | 1071 | { |
1da177e4 LT |
1072 | .procname = "dirty_ratio", |
1073 | .data = &vm_dirty_ratio, | |
1074 | .maxlen = sizeof(vm_dirty_ratio), | |
1075 | .mode = 0644, | |
6d456111 | 1076 | .proc_handler = dirty_ratio_handler, |
1da177e4 LT |
1077 | .extra1 = &zero, |
1078 | .extra2 = &one_hundred, | |
1079 | }, | |
2da02997 | 1080 | { |
2da02997 DR |
1081 | .procname = "dirty_bytes", |
1082 | .data = &vm_dirty_bytes, | |
1083 | .maxlen = sizeof(vm_dirty_bytes), | |
1084 | .mode = 0644, | |
6d456111 | 1085 | .proc_handler = dirty_bytes_handler, |
9e4a5bda | 1086 | .extra1 = &dirty_bytes_min, |
2da02997 | 1087 | }, |
1da177e4 | 1088 | { |
1da177e4 | 1089 | .procname = "dirty_writeback_centisecs", |
f6ef9438 BS |
1090 | .data = &dirty_writeback_interval, |
1091 | .maxlen = sizeof(dirty_writeback_interval), | |
1da177e4 | 1092 | .mode = 0644, |
6d456111 | 1093 | .proc_handler = dirty_writeback_centisecs_handler, |
1da177e4 LT |
1094 | }, |
1095 | { | |
1da177e4 | 1096 | .procname = "dirty_expire_centisecs", |
f6ef9438 BS |
1097 | .data = &dirty_expire_interval, |
1098 | .maxlen = sizeof(dirty_expire_interval), | |
1da177e4 | 1099 | .mode = 0644, |
cb16e95f PH |
1100 | .proc_handler = proc_dointvec_minmax, |
1101 | .extra1 = &zero, | |
1da177e4 LT |
1102 | }, |
1103 | { | |
3965c9ae WL |
1104 | .procname = "nr_pdflush_threads", |
1105 | .mode = 0444 /* read-only */, | |
1106 | .proc_handler = pdflush_proc_obsolete, | |
1da177e4 LT |
1107 | }, |
1108 | { | |
1da177e4 LT |
1109 | .procname = "swappiness", |
1110 | .data = &vm_swappiness, | |
1111 | .maxlen = sizeof(vm_swappiness), | |
1112 | .mode = 0644, | |
6d456111 | 1113 | .proc_handler = proc_dointvec_minmax, |
1da177e4 LT |
1114 | .extra1 = &zero, |
1115 | .extra2 = &one_hundred, | |
1116 | }, | |
1117 | #ifdef CONFIG_HUGETLB_PAGE | |
06808b08 | 1118 | { |
1da177e4 | 1119 | .procname = "nr_hugepages", |
e5ff2159 | 1120 | .data = NULL, |
1da177e4 LT |
1121 | .maxlen = sizeof(unsigned long), |
1122 | .mode = 0644, | |
6d456111 | 1123 | .proc_handler = hugetlb_sysctl_handler, |
1da177e4 LT |
1124 | .extra1 = (void *)&hugetlb_zero, |
1125 | .extra2 = (void *)&hugetlb_infinity, | |
06808b08 LS |
1126 | }, |
1127 | #ifdef CONFIG_NUMA | |
1128 | { | |
1129 | .procname = "nr_hugepages_mempolicy", | |
1130 | .data = NULL, | |
1131 | .maxlen = sizeof(unsigned long), | |
1132 | .mode = 0644, | |
1133 | .proc_handler = &hugetlb_mempolicy_sysctl_handler, | |
1134 | .extra1 = (void *)&hugetlb_zero, | |
1135 | .extra2 = (void *)&hugetlb_infinity, | |
1136 | }, | |
1137 | #endif | |
1da177e4 | 1138 | { |
1da177e4 LT |
1139 | .procname = "hugetlb_shm_group", |
1140 | .data = &sysctl_hugetlb_shm_group, | |
1141 | .maxlen = sizeof(gid_t), | |
1142 | .mode = 0644, | |
6d456111 | 1143 | .proc_handler = proc_dointvec, |
1da177e4 | 1144 | }, |
396faf03 | 1145 | { |
396faf03 MG |
1146 | .procname = "hugepages_treat_as_movable", |
1147 | .data = &hugepages_treat_as_movable, | |
1148 | .maxlen = sizeof(int), | |
1149 | .mode = 0644, | |
6d456111 | 1150 | .proc_handler = hugetlb_treat_movable_handler, |
396faf03 | 1151 | }, |
d1c3fb1f | 1152 | { |
d1c3fb1f | 1153 | .procname = "nr_overcommit_hugepages", |
e5ff2159 AK |
1154 | .data = NULL, |
1155 | .maxlen = sizeof(unsigned long), | |
d1c3fb1f | 1156 | .mode = 0644, |
6d456111 | 1157 | .proc_handler = hugetlb_overcommit_handler, |
e5ff2159 AK |
1158 | .extra1 = (void *)&hugetlb_zero, |
1159 | .extra2 = (void *)&hugetlb_infinity, | |
d1c3fb1f | 1160 | }, |
1da177e4 LT |
1161 | #endif |
1162 | { | |
1da177e4 LT |
1163 | .procname = "lowmem_reserve_ratio", |
1164 | .data = &sysctl_lowmem_reserve_ratio, | |
1165 | .maxlen = sizeof(sysctl_lowmem_reserve_ratio), | |
1166 | .mode = 0644, | |
6d456111 | 1167 | .proc_handler = lowmem_reserve_ratio_sysctl_handler, |
1da177e4 | 1168 | }, |
9d0243bc | 1169 | { |
9d0243bc AM |
1170 | .procname = "drop_caches", |
1171 | .data = &sysctl_drop_caches, | |
1172 | .maxlen = sizeof(int), | |
1173 | .mode = 0644, | |
1174 | .proc_handler = drop_caches_sysctl_handler, | |
cb16e95f PH |
1175 | .extra1 = &one, |
1176 | .extra2 = &three, | |
9d0243bc | 1177 | }, |
76ab0f53 MG |
1178 | #ifdef CONFIG_COMPACTION |
1179 | { | |
1180 | .procname = "compact_memory", | |
1181 | .data = &sysctl_compact_memory, | |
1182 | .maxlen = sizeof(int), | |
1183 | .mode = 0200, | |
1184 | .proc_handler = sysctl_compaction_handler, | |
1185 | }, | |
5e771905 MG |
1186 | { |
1187 | .procname = "extfrag_threshold", | |
1188 | .data = &sysctl_extfrag_threshold, | |
1189 | .maxlen = sizeof(int), | |
1190 | .mode = 0644, | |
1191 | .proc_handler = sysctl_extfrag_handler, | |
1192 | .extra1 = &min_extfrag_threshold, | |
1193 | .extra2 = &max_extfrag_threshold, | |
1194 | }, | |
1195 | ||
76ab0f53 | 1196 | #endif /* CONFIG_COMPACTION */ |
1da177e4 | 1197 | { |
1da177e4 LT |
1198 | .procname = "min_free_kbytes", |
1199 | .data = &min_free_kbytes, | |
1200 | .maxlen = sizeof(min_free_kbytes), | |
1201 | .mode = 0644, | |
6d456111 | 1202 | .proc_handler = min_free_kbytes_sysctl_handler, |
1da177e4 LT |
1203 | .extra1 = &zero, |
1204 | }, | |
8ad4b1fb | 1205 | { |
8ad4b1fb RS |
1206 | .procname = "percpu_pagelist_fraction", |
1207 | .data = &percpu_pagelist_fraction, | |
1208 | .maxlen = sizeof(percpu_pagelist_fraction), | |
1209 | .mode = 0644, | |
6d456111 | 1210 | .proc_handler = percpu_pagelist_fraction_sysctl_handler, |
8ad4b1fb RS |
1211 | .extra1 = &min_percpu_pagelist_fract, |
1212 | }, | |
1da177e4 LT |
1213 | #ifdef CONFIG_MMU |
1214 | { | |
1da177e4 LT |
1215 | .procname = "max_map_count", |
1216 | .data = &sysctl_max_map_count, | |
1217 | .maxlen = sizeof(sysctl_max_map_count), | |
1218 | .mode = 0644, | |
3e26120c | 1219 | .proc_handler = proc_dointvec_minmax, |
70da2340 | 1220 | .extra1 = &zero, |
1da177e4 | 1221 | }, |
dd8632a1 PM |
1222 | #else |
1223 | { | |
dd8632a1 PM |
1224 | .procname = "nr_trim_pages", |
1225 | .data = &sysctl_nr_trim_pages, | |
1226 | .maxlen = sizeof(sysctl_nr_trim_pages), | |
1227 | .mode = 0644, | |
6d456111 | 1228 | .proc_handler = proc_dointvec_minmax, |
dd8632a1 PM |
1229 | .extra1 = &zero, |
1230 | }, | |
1da177e4 LT |
1231 | #endif |
1232 | { | |
1da177e4 LT |
1233 | .procname = "laptop_mode", |
1234 | .data = &laptop_mode, | |
1235 | .maxlen = sizeof(laptop_mode), | |
1236 | .mode = 0644, | |
6d456111 | 1237 | .proc_handler = proc_dointvec_jiffies, |
1da177e4 LT |
1238 | }, |
1239 | { | |
1da177e4 LT |
1240 | .procname = "block_dump", |
1241 | .data = &block_dump, | |
1242 | .maxlen = sizeof(block_dump), | |
1243 | .mode = 0644, | |
6d456111 | 1244 | .proc_handler = proc_dointvec, |
1da177e4 LT |
1245 | .extra1 = &zero, |
1246 | }, | |
1247 | { | |
1da177e4 LT |
1248 | .procname = "vfs_cache_pressure", |
1249 | .data = &sysctl_vfs_cache_pressure, | |
1250 | .maxlen = sizeof(sysctl_vfs_cache_pressure), | |
1251 | .mode = 0644, | |
6d456111 | 1252 | .proc_handler = proc_dointvec, |
1da177e4 LT |
1253 | .extra1 = &zero, |
1254 | }, | |
1255 | #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT | |
1256 | { | |
1da177e4 LT |
1257 | .procname = "legacy_va_layout", |
1258 | .data = &sysctl_legacy_va_layout, | |
1259 | .maxlen = sizeof(sysctl_legacy_va_layout), | |
1260 | .mode = 0644, | |
6d456111 | 1261 | .proc_handler = proc_dointvec, |
1da177e4 LT |
1262 | .extra1 = &zero, |
1263 | }, | |
1264 | #endif | |
1743660b CL |
1265 | #ifdef CONFIG_NUMA |
1266 | { | |
1743660b CL |
1267 | .procname = "zone_reclaim_mode", |
1268 | .data = &zone_reclaim_mode, | |
1269 | .maxlen = sizeof(zone_reclaim_mode), | |
1270 | .mode = 0644, | |
6d456111 | 1271 | .proc_handler = proc_dointvec, |
c84db23c | 1272 | .extra1 = &zero, |
1743660b | 1273 | }, |
9614634f | 1274 | { |
9614634f CL |
1275 | .procname = "min_unmapped_ratio", |
1276 | .data = &sysctl_min_unmapped_ratio, | |
1277 | .maxlen = sizeof(sysctl_min_unmapped_ratio), | |
1278 | .mode = 0644, | |
6d456111 | 1279 | .proc_handler = sysctl_min_unmapped_ratio_sysctl_handler, |
9614634f CL |
1280 | .extra1 = &zero, |
1281 | .extra2 = &one_hundred, | |
1282 | }, | |
0ff38490 | 1283 | { |
0ff38490 CL |
1284 | .procname = "min_slab_ratio", |
1285 | .data = &sysctl_min_slab_ratio, | |
1286 | .maxlen = sizeof(sysctl_min_slab_ratio), | |
1287 | .mode = 0644, | |
6d456111 | 1288 | .proc_handler = sysctl_min_slab_ratio_sysctl_handler, |
0ff38490 CL |
1289 | .extra1 = &zero, |
1290 | .extra2 = &one_hundred, | |
1291 | }, | |
e6e5494c | 1292 | #endif |
77461ab3 CL |
1293 | #ifdef CONFIG_SMP |
1294 | { | |
77461ab3 CL |
1295 | .procname = "stat_interval", |
1296 | .data = &sysctl_stat_interval, | |
1297 | .maxlen = sizeof(sysctl_stat_interval), | |
1298 | .mode = 0644, | |
6d456111 | 1299 | .proc_handler = proc_dointvec_jiffies, |
77461ab3 CL |
1300 | }, |
1301 | #endif | |
6e141546 | 1302 | #ifdef CONFIG_MMU |
ed032189 | 1303 | { |
ed032189 | 1304 | .procname = "mmap_min_addr", |
788084ab EP |
1305 | .data = &dac_mmap_min_addr, |
1306 | .maxlen = sizeof(unsigned long), | |
ed032189 | 1307 | .mode = 0644, |
6d456111 | 1308 | .proc_handler = mmap_min_addr_handler, |
ed032189 | 1309 | }, |
6e141546 | 1310 | #endif |
f0c0b2b8 KH |
1311 | #ifdef CONFIG_NUMA |
1312 | { | |
f0c0b2b8 KH |
1313 | .procname = "numa_zonelist_order", |
1314 | .data = &numa_zonelist_order, | |
1315 | .maxlen = NUMA_ZONELIST_ORDER_LEN, | |
1316 | .mode = 0644, | |
6d456111 | 1317 | .proc_handler = numa_zonelist_order_handler, |
f0c0b2b8 KH |
1318 | }, |
1319 | #endif | |
2b8232ce | 1320 | #if (defined(CONFIG_X86_32) && !defined(CONFIG_UML))|| \ |
5c36e657 | 1321 | (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL)) |
e6e5494c | 1322 | { |
e6e5494c IM |
1323 | .procname = "vdso_enabled", |
1324 | .data = &vdso_enabled, | |
1325 | .maxlen = sizeof(vdso_enabled), | |
1326 | .mode = 0644, | |
6d456111 | 1327 | .proc_handler = proc_dointvec, |
e6e5494c IM |
1328 | .extra1 = &zero, |
1329 | }, | |
1da177e4 | 1330 | #endif |
195cf453 BG |
1331 | #ifdef CONFIG_HIGHMEM |
1332 | { | |
195cf453 BG |
1333 | .procname = "highmem_is_dirtyable", |
1334 | .data = &vm_highmem_is_dirtyable, | |
1335 | .maxlen = sizeof(vm_highmem_is_dirtyable), | |
1336 | .mode = 0644, | |
6d456111 | 1337 | .proc_handler = proc_dointvec_minmax, |
195cf453 BG |
1338 | .extra1 = &zero, |
1339 | .extra2 = &one, | |
1340 | }, | |
1341 | #endif | |
4be6f6bb | 1342 | { |
4be6f6bb PZ |
1343 | .procname = "scan_unevictable_pages", |
1344 | .data = &scan_unevictable_pages, | |
1345 | .maxlen = sizeof(scan_unevictable_pages), | |
1346 | .mode = 0644, | |
6d456111 | 1347 | .proc_handler = scan_unevictable_handler, |
4be6f6bb | 1348 | }, |
6a46079c AK |
1349 | #ifdef CONFIG_MEMORY_FAILURE |
1350 | { | |
6a46079c AK |
1351 | .procname = "memory_failure_early_kill", |
1352 | .data = &sysctl_memory_failure_early_kill, | |
1353 | .maxlen = sizeof(sysctl_memory_failure_early_kill), | |
1354 | .mode = 0644, | |
6d456111 | 1355 | .proc_handler = proc_dointvec_minmax, |
6a46079c AK |
1356 | .extra1 = &zero, |
1357 | .extra2 = &one, | |
1358 | }, | |
1359 | { | |
6a46079c AK |
1360 | .procname = "memory_failure_recovery", |
1361 | .data = &sysctl_memory_failure_recovery, | |
1362 | .maxlen = sizeof(sysctl_memory_failure_recovery), | |
1363 | .mode = 0644, | |
6d456111 | 1364 | .proc_handler = proc_dointvec_minmax, |
6a46079c AK |
1365 | .extra1 = &zero, |
1366 | .extra2 = &one, | |
1367 | }, | |
1368 | #endif | |
6fce56ec | 1369 | { } |
1da177e4 LT |
1370 | }; |
1371 | ||
2abc26fc | 1372 | #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) |
d8217f07 | 1373 | static struct ctl_table binfmt_misc_table[] = { |
6fce56ec | 1374 | { } |
2abc26fc EB |
1375 | }; |
1376 | #endif | |
1377 | ||
d8217f07 | 1378 | static struct ctl_table fs_table[] = { |
1da177e4 | 1379 | { |
1da177e4 LT |
1380 | .procname = "inode-nr", |
1381 | .data = &inodes_stat, | |
1382 | .maxlen = 2*sizeof(int), | |
1383 | .mode = 0444, | |
cffbc8aa | 1384 | .proc_handler = proc_nr_inodes, |
1da177e4 LT |
1385 | }, |
1386 | { | |
1da177e4 LT |
1387 | .procname = "inode-state", |
1388 | .data = &inodes_stat, | |
1389 | .maxlen = 7*sizeof(int), | |
1390 | .mode = 0444, | |
cffbc8aa | 1391 | .proc_handler = proc_nr_inodes, |
1da177e4 LT |
1392 | }, |
1393 | { | |
1da177e4 LT |
1394 | .procname = "file-nr", |
1395 | .data = &files_stat, | |
518de9b3 | 1396 | .maxlen = sizeof(files_stat), |
1da177e4 | 1397 | .mode = 0444, |
6d456111 | 1398 | .proc_handler = proc_nr_files, |
1da177e4 LT |
1399 | }, |
1400 | { | |
1da177e4 LT |
1401 | .procname = "file-max", |
1402 | .data = &files_stat.max_files, | |
518de9b3 | 1403 | .maxlen = sizeof(files_stat.max_files), |
1da177e4 | 1404 | .mode = 0644, |
518de9b3 | 1405 | .proc_handler = proc_doulongvec_minmax, |
1da177e4 | 1406 | }, |
9cfe015a | 1407 | { |
9cfe015a ED |
1408 | .procname = "nr_open", |
1409 | .data = &sysctl_nr_open, | |
1410 | .maxlen = sizeof(int), | |
1411 | .mode = 0644, | |
6d456111 | 1412 | .proc_handler = proc_dointvec_minmax, |
eceea0b3 AV |
1413 | .extra1 = &sysctl_nr_open_min, |
1414 | .extra2 = &sysctl_nr_open_max, | |
9cfe015a | 1415 | }, |
1da177e4 | 1416 | { |
1da177e4 LT |
1417 | .procname = "dentry-state", |
1418 | .data = &dentry_stat, | |
1419 | .maxlen = 6*sizeof(int), | |
1420 | .mode = 0444, | |
312d3ca8 | 1421 | .proc_handler = proc_nr_dentry, |
1da177e4 LT |
1422 | }, |
1423 | { | |
1da177e4 LT |
1424 | .procname = "overflowuid", |
1425 | .data = &fs_overflowuid, | |
1426 | .maxlen = sizeof(int), | |
1427 | .mode = 0644, | |
6d456111 | 1428 | .proc_handler = proc_dointvec_minmax, |
1da177e4 LT |
1429 | .extra1 = &minolduid, |
1430 | .extra2 = &maxolduid, | |
1431 | }, | |
1432 | { | |
1da177e4 LT |
1433 | .procname = "overflowgid", |
1434 | .data = &fs_overflowgid, | |
1435 | .maxlen = sizeof(int), | |
1436 | .mode = 0644, | |
6d456111 | 1437 | .proc_handler = proc_dointvec_minmax, |
1da177e4 LT |
1438 | .extra1 = &minolduid, |
1439 | .extra2 = &maxolduid, | |
1440 | }, | |
bfcd17a6 | 1441 | #ifdef CONFIG_FILE_LOCKING |
1da177e4 | 1442 | { |
1da177e4 LT |
1443 | .procname = "leases-enable", |
1444 | .data = &leases_enable, | |
1445 | .maxlen = sizeof(int), | |
1446 | .mode = 0644, | |
6d456111 | 1447 | .proc_handler = proc_dointvec, |
1da177e4 | 1448 | }, |
bfcd17a6 | 1449 | #endif |
1da177e4 LT |
1450 | #ifdef CONFIG_DNOTIFY |
1451 | { | |
1da177e4 LT |
1452 | .procname = "dir-notify-enable", |
1453 | .data = &dir_notify_enable, | |
1454 | .maxlen = sizeof(int), | |
1455 | .mode = 0644, | |
6d456111 | 1456 | .proc_handler = proc_dointvec, |
1da177e4 LT |
1457 | }, |
1458 | #endif | |
1459 | #ifdef CONFIG_MMU | |
bfcd17a6 | 1460 | #ifdef CONFIG_FILE_LOCKING |
1da177e4 | 1461 | { |
1da177e4 LT |
1462 | .procname = "lease-break-time", |
1463 | .data = &lease_break_time, | |
1464 | .maxlen = sizeof(int), | |
1465 | .mode = 0644, | |
6d456111 | 1466 | .proc_handler = proc_dointvec, |
1da177e4 | 1467 | }, |
bfcd17a6 | 1468 | #endif |
ebf3f09c | 1469 | #ifdef CONFIG_AIO |
1da177e4 | 1470 | { |
1da177e4 LT |
1471 | .procname = "aio-nr", |
1472 | .data = &aio_nr, | |
1473 | .maxlen = sizeof(aio_nr), | |
1474 | .mode = 0444, | |
6d456111 | 1475 | .proc_handler = proc_doulongvec_minmax, |
1da177e4 LT |
1476 | }, |
1477 | { | |
1da177e4 LT |
1478 | .procname = "aio-max-nr", |
1479 | .data = &aio_max_nr, | |
1480 | .maxlen = sizeof(aio_max_nr), | |
1481 | .mode = 0644, | |
6d456111 | 1482 | .proc_handler = proc_doulongvec_minmax, |
1da177e4 | 1483 | }, |
ebf3f09c | 1484 | #endif /* CONFIG_AIO */ |
2d9048e2 | 1485 | #ifdef CONFIG_INOTIFY_USER |
0399cb08 | 1486 | { |
0399cb08 RL |
1487 | .procname = "inotify", |
1488 | .mode = 0555, | |
1489 | .child = inotify_table, | |
1490 | }, | |
1491 | #endif | |
7ef9964e DL |
1492 | #ifdef CONFIG_EPOLL |
1493 | { | |
1494 | .procname = "epoll", | |
1495 | .mode = 0555, | |
1496 | .child = epoll_table, | |
1497 | }, | |
1498 | #endif | |
1da177e4 | 1499 | #endif |
d6e71144 | 1500 | { |
d6e71144 AC |
1501 | .procname = "suid_dumpable", |
1502 | .data = &suid_dumpable, | |
1503 | .maxlen = sizeof(int), | |
1504 | .mode = 0644, | |
54b50199 | 1505 | .proc_handler = proc_dointvec_minmax_coredump, |
8e654fba MW |
1506 | .extra1 = &zero, |
1507 | .extra2 = &two, | |
d6e71144 | 1508 | }, |
2abc26fc EB |
1509 | #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) |
1510 | { | |
2abc26fc EB |
1511 | .procname = "binfmt_misc", |
1512 | .mode = 0555, | |
1513 | .child = binfmt_misc_table, | |
1514 | }, | |
1515 | #endif | |
b492e95b | 1516 | { |
ff9da691 JA |
1517 | .procname = "pipe-max-size", |
1518 | .data = &pipe_max_size, | |
b492e95b JA |
1519 | .maxlen = sizeof(int), |
1520 | .mode = 0644, | |
ff9da691 JA |
1521 | .proc_handler = &pipe_proc_fn, |
1522 | .extra1 = &pipe_min_size, | |
b492e95b | 1523 | }, |
6fce56ec | 1524 | { } |
1da177e4 LT |
1525 | }; |
1526 | ||
d8217f07 | 1527 | static struct ctl_table debug_table[] = { |
ab3c68ee | 1528 | #if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_SPARC) || \ |
571d76ac | 1529 | defined(CONFIG_S390) || defined(CONFIG_TILE) |
abd4f750 | 1530 | { |
abd4f750 MAS |
1531 | .procname = "exception-trace", |
1532 | .data = &show_unhandled_signals, | |
1533 | .maxlen = sizeof(int), | |
1534 | .mode = 0644, | |
1535 | .proc_handler = proc_dointvec | |
1536 | }, | |
b2be84df MH |
1537 | #endif |
1538 | #if defined(CONFIG_OPTPROBES) | |
1539 | { | |
1540 | .procname = "kprobes-optimization", | |
1541 | .data = &sysctl_kprobes_optimization, | |
1542 | .maxlen = sizeof(int), | |
1543 | .mode = 0644, | |
1544 | .proc_handler = proc_kprobes_optimization_handler, | |
1545 | .extra1 = &zero, | |
1546 | .extra2 = &one, | |
1547 | }, | |
abd4f750 | 1548 | #endif |
6fce56ec | 1549 | { } |
1da177e4 LT |
1550 | }; |
1551 | ||
d8217f07 | 1552 | static struct ctl_table dev_table[] = { |
6fce56ec | 1553 | { } |
0eeca283 | 1554 | }; |
1da177e4 | 1555 | |
de4e83bd | 1556 | int __init sysctl_init(void) |
d912b0cc | 1557 | { |
fd4b616b SR |
1558 | struct ctl_table_header *hdr; |
1559 | ||
1560 | hdr = register_sysctl_table(sysctl_base_table); | |
1561 | kmemleak_not_leak(hdr); | |
d912b0cc EB |
1562 | return 0; |
1563 | } | |
1564 | ||
b89a8171 EB |
1565 | #endif /* CONFIG_SYSCTL */ |
1566 | ||
1da177e4 LT |
1567 | /* |
1568 | * /proc/sys support | |
1569 | */ | |
1570 | ||
b89a8171 | 1571 | #ifdef CONFIG_PROC_SYSCTL |
1da177e4 | 1572 | |
b1ba4ddd | 1573 | static int _proc_do_string(void* data, int maxlen, int write, |
8d65af78 | 1574 | void __user *buffer, |
b1ba4ddd | 1575 | size_t *lenp, loff_t *ppos) |
1da177e4 LT |
1576 | { |
1577 | size_t len; | |
1578 | char __user *p; | |
1579 | char c; | |
8d060877 ON |
1580 | |
1581 | if (!data || !maxlen || !*lenp) { | |
1da177e4 LT |
1582 | *lenp = 0; |
1583 | return 0; | |
1584 | } | |
8d060877 | 1585 | |
1da177e4 LT |
1586 | if (write) { |
1587 | len = 0; | |
1588 | p = buffer; | |
1589 | while (len < *lenp) { | |
1590 | if (get_user(c, p++)) | |
1591 | return -EFAULT; | |
1592 | if (c == 0 || c == '\n') | |
1593 | break; | |
1594 | len++; | |
1595 | } | |
f5dd3d6f SV |
1596 | if (len >= maxlen) |
1597 | len = maxlen-1; | |
1598 | if(copy_from_user(data, buffer, len)) | |
1da177e4 | 1599 | return -EFAULT; |
f5dd3d6f | 1600 | ((char *) data)[len] = 0; |
1da177e4 LT |
1601 | *ppos += *lenp; |
1602 | } else { | |
f5dd3d6f SV |
1603 | len = strlen(data); |
1604 | if (len > maxlen) | |
1605 | len = maxlen; | |
8d060877 ON |
1606 | |
1607 | if (*ppos > len) { | |
1608 | *lenp = 0; | |
1609 | return 0; | |
1610 | } | |
1611 | ||
1612 | data += *ppos; | |
1613 | len -= *ppos; | |
1614 | ||
1da177e4 LT |
1615 | if (len > *lenp) |
1616 | len = *lenp; | |
1617 | if (len) | |
f5dd3d6f | 1618 | if(copy_to_user(buffer, data, len)) |
1da177e4 LT |
1619 | return -EFAULT; |
1620 | if (len < *lenp) { | |
1621 | if(put_user('\n', ((char __user *) buffer) + len)) | |
1622 | return -EFAULT; | |
1623 | len++; | |
1624 | } | |
1625 | *lenp = len; | |
1626 | *ppos += len; | |
1627 | } | |
1628 | return 0; | |
1629 | } | |
1630 | ||
f5dd3d6f SV |
1631 | /** |
1632 | * proc_dostring - read a string sysctl | |
1633 | * @table: the sysctl table | |
1634 | * @write: %TRUE if this is a write to the sysctl file | |
f5dd3d6f SV |
1635 | * @buffer: the user buffer |
1636 | * @lenp: the size of the user buffer | |
1637 | * @ppos: file position | |
1638 | * | |
1639 | * Reads/writes a string from/to the user buffer. If the kernel | |
1640 | * buffer provided is not large enough to hold the string, the | |
1641 | * string is truncated. The copied string is %NULL-terminated. | |
1642 | * If the string is being read by the user process, it is copied | |
1643 | * and a newline '\n' is added. It is truncated if the buffer is | |
1644 | * not large enough. | |
1645 | * | |
1646 | * Returns 0 on success. | |
1647 | */ | |
8d65af78 | 1648 | int proc_dostring(struct ctl_table *table, int write, |
f5dd3d6f SV |
1649 | void __user *buffer, size_t *lenp, loff_t *ppos) |
1650 | { | |
8d65af78 | 1651 | return _proc_do_string(table->data, table->maxlen, write, |
f5dd3d6f SV |
1652 | buffer, lenp, ppos); |
1653 | } | |
1654 | ||
00b7c339 AW |
1655 | static size_t proc_skip_spaces(char **buf) |
1656 | { | |
1657 | size_t ret; | |
1658 | char *tmp = skip_spaces(*buf); | |
1659 | ret = tmp - *buf; | |
1660 | *buf = tmp; | |
1661 | return ret; | |
1662 | } | |
1663 | ||
9f977fb7 OP |
1664 | static void proc_skip_char(char **buf, size_t *size, const char v) |
1665 | { | |
1666 | while (*size) { | |
1667 | if (**buf != v) | |
1668 | break; | |
1669 | (*size)--; | |
1670 | (*buf)++; | |
1671 | } | |
1672 | } | |
1673 | ||
00b7c339 AW |
1674 | #define TMPBUFLEN 22 |
1675 | /** | |
0fc377bd | 1676 | * proc_get_long - reads an ASCII formatted integer from a user buffer |
00b7c339 | 1677 | * |
0fc377bd RD |
1678 | * @buf: a kernel buffer |
1679 | * @size: size of the kernel buffer | |
1680 | * @val: this is where the number will be stored | |
1681 | * @neg: set to %TRUE if number is negative | |
1682 | * @perm_tr: a vector which contains the allowed trailers | |
1683 | * @perm_tr_len: size of the perm_tr vector | |
1684 | * @tr: pointer to store the trailer character | |
00b7c339 | 1685 | * |
0fc377bd RD |
1686 | * In case of success %0 is returned and @buf and @size are updated with |
1687 | * the amount of bytes read. If @tr is non-NULL and a trailing | |
1688 | * character exists (size is non-zero after returning from this | |
1689 | * function), @tr is updated with the trailing character. | |
00b7c339 AW |
1690 | */ |
1691 | static int proc_get_long(char **buf, size_t *size, | |
1692 | unsigned long *val, bool *neg, | |
1693 | const char *perm_tr, unsigned perm_tr_len, char *tr) | |
1694 | { | |
1695 | int len; | |
1696 | char *p, tmp[TMPBUFLEN]; | |
1697 | ||
1698 | if (!*size) | |
1699 | return -EINVAL; | |
1700 | ||
1701 | len = *size; | |
1702 | if (len > TMPBUFLEN - 1) | |
1703 | len = TMPBUFLEN - 1; | |
1704 | ||
1705 | memcpy(tmp, *buf, len); | |
1706 | ||
1707 | tmp[len] = 0; | |
1708 | p = tmp; | |
1709 | if (*p == '-' && *size > 1) { | |
1710 | *neg = true; | |
1711 | p++; | |
1712 | } else | |
1713 | *neg = false; | |
1714 | if (!isdigit(*p)) | |
1715 | return -EINVAL; | |
1716 | ||
1717 | *val = simple_strtoul(p, &p, 0); | |
1718 | ||
1719 | len = p - tmp; | |
1720 | ||
1721 | /* We don't know if the next char is whitespace thus we may accept | |
1722 | * invalid integers (e.g. 1234...a) or two integers instead of one | |
1723 | * (e.g. 123...1). So lets not allow such large numbers. */ | |
1724 | if (len == TMPBUFLEN - 1) | |
1725 | return -EINVAL; | |
1726 | ||
1727 | if (len < *size && perm_tr_len && !memchr(perm_tr, *p, perm_tr_len)) | |
1728 | return -EINVAL; | |
1da177e4 | 1729 | |
00b7c339 AW |
1730 | if (tr && (len < *size)) |
1731 | *tr = *p; | |
1732 | ||
1733 | *buf += len; | |
1734 | *size -= len; | |
1735 | ||
1736 | return 0; | |
1737 | } | |
1738 | ||
1739 | /** | |
0fc377bd | 1740 | * proc_put_long - converts an integer to a decimal ASCII formatted string |
00b7c339 | 1741 | * |
0fc377bd RD |
1742 | * @buf: the user buffer |
1743 | * @size: the size of the user buffer | |
1744 | * @val: the integer to be converted | |
1745 | * @neg: sign of the number, %TRUE for negative | |
00b7c339 | 1746 | * |
0fc377bd RD |
1747 | * In case of success %0 is returned and @buf and @size are updated with |
1748 | * the amount of bytes written. | |
00b7c339 AW |
1749 | */ |
1750 | static int proc_put_long(void __user **buf, size_t *size, unsigned long val, | |
1751 | bool neg) | |
1752 | { | |
1753 | int len; | |
1754 | char tmp[TMPBUFLEN], *p = tmp; | |
1755 | ||
1756 | sprintf(p, "%s%lu", neg ? "-" : "", val); | |
1757 | len = strlen(tmp); | |
1758 | if (len > *size) | |
1759 | len = *size; | |
1760 | if (copy_to_user(*buf, tmp, len)) | |
1761 | return -EFAULT; | |
1762 | *size -= len; | |
1763 | *buf += len; | |
1764 | return 0; | |
1765 | } | |
1766 | #undef TMPBUFLEN | |
1767 | ||
1768 | static int proc_put_char(void __user **buf, size_t *size, char c) | |
1769 | { | |
1770 | if (*size) { | |
1771 | char __user **buffer = (char __user **)buf; | |
1772 | if (put_user(c, *buffer)) | |
1773 | return -EFAULT; | |
1774 | (*size)--, (*buffer)++; | |
1775 | *buf = *buffer; | |
1776 | } | |
1777 | return 0; | |
1778 | } | |
1da177e4 | 1779 | |
00b7c339 | 1780 | static int do_proc_dointvec_conv(bool *negp, unsigned long *lvalp, |
1da177e4 LT |
1781 | int *valp, |
1782 | int write, void *data) | |
1783 | { | |
1784 | if (write) { | |
1785 | *valp = *negp ? -*lvalp : *lvalp; | |
1786 | } else { | |
1787 | int val = *valp; | |
1788 | if (val < 0) { | |
00b7c339 | 1789 | *negp = true; |
1da177e4 LT |
1790 | *lvalp = (unsigned long)-val; |
1791 | } else { | |
00b7c339 | 1792 | *negp = false; |
1da177e4 LT |
1793 | *lvalp = (unsigned long)val; |
1794 | } | |
1795 | } | |
1796 | return 0; | |
1797 | } | |
1798 | ||
00b7c339 AW |
1799 | static const char proc_wspace_sep[] = { ' ', '\t', '\n' }; |
1800 | ||
d8217f07 | 1801 | static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table, |
8d65af78 | 1802 | int write, void __user *buffer, |
fcfbd547 | 1803 | size_t *lenp, loff_t *ppos, |
00b7c339 | 1804 | int (*conv)(bool *negp, unsigned long *lvalp, int *valp, |
1da177e4 LT |
1805 | int write, void *data), |
1806 | void *data) | |
1807 | { | |
00b7c339 AW |
1808 | int *i, vleft, first = 1, err = 0; |
1809 | unsigned long page = 0; | |
1810 | size_t left; | |
1811 | char *kbuf; | |
1da177e4 | 1812 | |
00b7c339 | 1813 | if (!tbl_data || !table->maxlen || !*lenp || (*ppos && !write)) { |
1da177e4 LT |
1814 | *lenp = 0; |
1815 | return 0; | |
1816 | } | |
1817 | ||
fcfbd547 | 1818 | i = (int *) tbl_data; |
1da177e4 LT |
1819 | vleft = table->maxlen / sizeof(*i); |
1820 | left = *lenp; | |
1821 | ||
1822 | if (!conv) | |
1823 | conv = do_proc_dointvec_conv; | |
1824 | ||
00b7c339 AW |
1825 | if (write) { |
1826 | if (left > PAGE_SIZE - 1) | |
1827 | left = PAGE_SIZE - 1; | |
1828 | page = __get_free_page(GFP_TEMPORARY); | |
1829 | kbuf = (char *) page; | |
1830 | if (!kbuf) | |
1831 | return -ENOMEM; | |
1832 | if (copy_from_user(kbuf, buffer, left)) { | |
1833 | err = -EFAULT; | |
1834 | goto free; | |
1835 | } | |
1836 | kbuf[left] = 0; | |
1837 | } | |
1838 | ||
1da177e4 | 1839 | for (; left && vleft--; i++, first=0) { |
00b7c339 AW |
1840 | unsigned long lval; |
1841 | bool neg; | |
1da177e4 | 1842 | |
00b7c339 AW |
1843 | if (write) { |
1844 | left -= proc_skip_spaces(&kbuf); | |
1da177e4 | 1845 | |
563b0467 O |
1846 | if (!left) |
1847 | break; | |
00b7c339 AW |
1848 | err = proc_get_long(&kbuf, &left, &lval, &neg, |
1849 | proc_wspace_sep, | |
1850 | sizeof(proc_wspace_sep), NULL); | |
1851 | if (err) | |
1da177e4 | 1852 | break; |
00b7c339 AW |
1853 | if (conv(&neg, &lval, i, 1, data)) { |
1854 | err = -EINVAL; | |
1da177e4 | 1855 | break; |
00b7c339 | 1856 | } |
1da177e4 | 1857 | } else { |
00b7c339 AW |
1858 | if (conv(&neg, &lval, i, 0, data)) { |
1859 | err = -EINVAL; | |
1860 | break; | |
1861 | } | |
1da177e4 | 1862 | if (!first) |
00b7c339 AW |
1863 | err = proc_put_char(&buffer, &left, '\t'); |
1864 | if (err) | |
1865 | break; | |
1866 | err = proc_put_long(&buffer, &left, lval, neg); | |
1867 | if (err) | |
1da177e4 | 1868 | break; |
1da177e4 LT |
1869 | } |
1870 | } | |
1871 | ||
00b7c339 AW |
1872 | if (!write && !first && left && !err) |
1873 | err = proc_put_char(&buffer, &left, '\n'); | |
563b0467 | 1874 | if (write && !err && left) |
00b7c339 AW |
1875 | left -= proc_skip_spaces(&kbuf); |
1876 | free: | |
1da177e4 | 1877 | if (write) { |
00b7c339 AW |
1878 | free_page(page); |
1879 | if (first) | |
1880 | return err ? : -EINVAL; | |
1da177e4 | 1881 | } |
1da177e4 LT |
1882 | *lenp -= left; |
1883 | *ppos += *lenp; | |
00b7c339 | 1884 | return err; |
1da177e4 LT |
1885 | } |
1886 | ||
8d65af78 | 1887 | static int do_proc_dointvec(struct ctl_table *table, int write, |
fcfbd547 | 1888 | void __user *buffer, size_t *lenp, loff_t *ppos, |
00b7c339 | 1889 | int (*conv)(bool *negp, unsigned long *lvalp, int *valp, |
fcfbd547 KK |
1890 | int write, void *data), |
1891 | void *data) | |
1892 | { | |
8d65af78 | 1893 | return __do_proc_dointvec(table->data, table, write, |
fcfbd547 KK |
1894 | buffer, lenp, ppos, conv, data); |
1895 | } | |
1896 | ||
1da177e4 LT |
1897 | /** |
1898 | * proc_dointvec - read a vector of integers | |
1899 | * @table: the sysctl table | |
1900 | * @write: %TRUE if this is a write to the sysctl file | |
1da177e4 LT |
1901 | * @buffer: the user buffer |
1902 | * @lenp: the size of the user buffer | |
1903 | * @ppos: file position | |
1904 | * | |
1905 | * Reads/writes up to table->maxlen/sizeof(unsigned int) integer | |
1906 | * values from/to the user buffer, treated as an ASCII string. | |
1907 | * | |
1908 | * Returns 0 on success. | |
1909 | */ | |
8d65af78 | 1910 | int proc_dointvec(struct ctl_table *table, int write, |
1da177e4 LT |
1911 | void __user *buffer, size_t *lenp, loff_t *ppos) |
1912 | { | |
8d65af78 | 1913 | return do_proc_dointvec(table,write,buffer,lenp,ppos, |
1da177e4 LT |
1914 | NULL,NULL); |
1915 | } | |
1916 | ||
34f5a398 | 1917 | /* |
25ddbb18 AK |
1918 | * Taint values can only be increased |
1919 | * This means we can safely use a temporary. | |
34f5a398 | 1920 | */ |
8d65af78 | 1921 | static int proc_taint(struct ctl_table *table, int write, |
34f5a398 TT |
1922 | void __user *buffer, size_t *lenp, loff_t *ppos) |
1923 | { | |
25ddbb18 AK |
1924 | struct ctl_table t; |
1925 | unsigned long tmptaint = get_taint(); | |
1926 | int err; | |
34f5a398 | 1927 | |
91fcd412 | 1928 | if (write && !capable(CAP_SYS_ADMIN)) |
34f5a398 TT |
1929 | return -EPERM; |
1930 | ||
25ddbb18 AK |
1931 | t = *table; |
1932 | t.data = &tmptaint; | |
8d65af78 | 1933 | err = proc_doulongvec_minmax(&t, write, buffer, lenp, ppos); |
25ddbb18 AK |
1934 | if (err < 0) |
1935 | return err; | |
1936 | ||
1937 | if (write) { | |
1938 | /* | |
1939 | * Poor man's atomic or. Not worth adding a primitive | |
1940 | * to everyone's atomic.h for this | |
1941 | */ | |
1942 | int i; | |
1943 | for (i = 0; i < BITS_PER_LONG && tmptaint >> i; i++) { | |
1944 | if ((tmptaint >> i) & 1) | |
1945 | add_taint(i); | |
1946 | } | |
1947 | } | |
1948 | ||
1949 | return err; | |
34f5a398 TT |
1950 | } |
1951 | ||
bfdc0b49 | 1952 | #ifdef CONFIG_PRINTK |
620f6e8e | 1953 | static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write, |
bfdc0b49 RW |
1954 | void __user *buffer, size_t *lenp, loff_t *ppos) |
1955 | { | |
1956 | if (write && !capable(CAP_SYS_ADMIN)) | |
1957 | return -EPERM; | |
1958 | ||
1959 | return proc_dointvec_minmax(table, write, buffer, lenp, ppos); | |
1960 | } | |
1961 | #endif | |
1962 | ||
1da177e4 LT |
1963 | struct do_proc_dointvec_minmax_conv_param { |
1964 | int *min; | |
1965 | int *max; | |
1966 | }; | |
1967 | ||
00b7c339 AW |
1968 | static int do_proc_dointvec_minmax_conv(bool *negp, unsigned long *lvalp, |
1969 | int *valp, | |
1da177e4 LT |
1970 | int write, void *data) |
1971 | { | |
1972 | struct do_proc_dointvec_minmax_conv_param *param = data; | |
1973 | if (write) { | |
1974 | int val = *negp ? -*lvalp : *lvalp; | |
1975 | if ((param->min && *param->min > val) || | |
1976 | (param->max && *param->max < val)) | |
1977 | return -EINVAL; | |
1978 | *valp = val; | |
1979 | } else { | |
1980 | int val = *valp; | |
1981 | if (val < 0) { | |
00b7c339 | 1982 | *negp = true; |
1da177e4 LT |
1983 | *lvalp = (unsigned long)-val; |
1984 | } else { | |
00b7c339 | 1985 | *negp = false; |
1da177e4 LT |
1986 | *lvalp = (unsigned long)val; |
1987 | } | |
1988 | } | |
1989 | return 0; | |
1990 | } | |
1991 | ||
1992 | /** | |
1993 | * proc_dointvec_minmax - read a vector of integers with min/max values | |
1994 | * @table: the sysctl table | |
1995 | * @write: %TRUE if this is a write to the sysctl file | |
1da177e4 LT |
1996 | * @buffer: the user buffer |
1997 | * @lenp: the size of the user buffer | |
1998 | * @ppos: file position | |
1999 | * | |
2000 | * Reads/writes up to table->maxlen/sizeof(unsigned int) integer | |
2001 | * values from/to the user buffer, treated as an ASCII string. | |
2002 | * | |
2003 | * This routine will ensure the values are within the range specified by | |
2004 | * table->extra1 (min) and table->extra2 (max). | |
2005 | * | |
2006 | * Returns 0 on success. | |
2007 | */ | |
8d65af78 | 2008 | int proc_dointvec_minmax(struct ctl_table *table, int write, |
1da177e4 LT |
2009 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2010 | { | |
2011 | struct do_proc_dointvec_minmax_conv_param param = { | |
2012 | .min = (int *) table->extra1, | |
2013 | .max = (int *) table->extra2, | |
2014 | }; | |
8d65af78 | 2015 | return do_proc_dointvec(table, write, buffer, lenp, ppos, |
1da177e4 LT |
2016 | do_proc_dointvec_minmax_conv, ¶m); |
2017 | } | |
2018 | ||
54b50199 KC |
2019 | static void validate_coredump_safety(void) |
2020 | { | |
2021 | if (suid_dumpable == SUID_DUMPABLE_SAFE && | |
2022 | core_pattern[0] != '/' && core_pattern[0] != '|') { | |
2023 | printk(KERN_WARNING "Unsafe core_pattern used with "\ | |
2024 | "suid_dumpable=2. Pipe handler or fully qualified "\ | |
2025 | "core dump path required.\n"); | |
2026 | } | |
2027 | } | |
2028 | ||
2029 | static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write, | |
2030 | void __user *buffer, size_t *lenp, loff_t *ppos) | |
2031 | { | |
2032 | int error = proc_dointvec_minmax(table, write, buffer, lenp, ppos); | |
2033 | if (!error) | |
2034 | validate_coredump_safety(); | |
2035 | return error; | |
2036 | } | |
2037 | ||
2038 | static int proc_dostring_coredump(struct ctl_table *table, int write, | |
2039 | void __user *buffer, size_t *lenp, loff_t *ppos) | |
2040 | { | |
2041 | int error = proc_dostring(table, write, buffer, lenp, ppos); | |
2042 | if (!error) | |
2043 | validate_coredump_safety(); | |
2044 | return error; | |
2045 | } | |
2046 | ||
d8217f07 | 2047 | static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write, |
1da177e4 LT |
2048 | void __user *buffer, |
2049 | size_t *lenp, loff_t *ppos, | |
2050 | unsigned long convmul, | |
2051 | unsigned long convdiv) | |
2052 | { | |
00b7c339 AW |
2053 | unsigned long *i, *min, *max; |
2054 | int vleft, first = 1, err = 0; | |
2055 | unsigned long page = 0; | |
2056 | size_t left; | |
2057 | char *kbuf; | |
2058 | ||
2059 | if (!data || !table->maxlen || !*lenp || (*ppos && !write)) { | |
1da177e4 LT |
2060 | *lenp = 0; |
2061 | return 0; | |
2062 | } | |
00b7c339 | 2063 | |
fcfbd547 | 2064 | i = (unsigned long *) data; |
1da177e4 LT |
2065 | min = (unsigned long *) table->extra1; |
2066 | max = (unsigned long *) table->extra2; | |
2067 | vleft = table->maxlen / sizeof(unsigned long); | |
2068 | left = *lenp; | |
00b7c339 AW |
2069 | |
2070 | if (write) { | |
2071 | if (left > PAGE_SIZE - 1) | |
2072 | left = PAGE_SIZE - 1; | |
2073 | page = __get_free_page(GFP_TEMPORARY); | |
2074 | kbuf = (char *) page; | |
2075 | if (!kbuf) | |
2076 | return -ENOMEM; | |
2077 | if (copy_from_user(kbuf, buffer, left)) { | |
2078 | err = -EFAULT; | |
2079 | goto free; | |
2080 | } | |
2081 | kbuf[left] = 0; | |
2082 | } | |
2083 | ||
27b3d80a | 2084 | for (; left && vleft--; i++, first = 0) { |
00b7c339 AW |
2085 | unsigned long val; |
2086 | ||
1da177e4 | 2087 | if (write) { |
00b7c339 AW |
2088 | bool neg; |
2089 | ||
2090 | left -= proc_skip_spaces(&kbuf); | |
2091 | ||
2092 | err = proc_get_long(&kbuf, &left, &val, &neg, | |
2093 | proc_wspace_sep, | |
2094 | sizeof(proc_wspace_sep), NULL); | |
2095 | if (err) | |
1da177e4 LT |
2096 | break; |
2097 | if (neg) | |
1da177e4 LT |
2098 | continue; |
2099 | if ((min && val < *min) || (max && val > *max)) | |
2100 | continue; | |
2101 | *i = val; | |
2102 | } else { | |
00b7c339 | 2103 | val = convdiv * (*i) / convmul; |
1da177e4 | 2104 | if (!first) |
00b7c339 AW |
2105 | err = proc_put_char(&buffer, &left, '\t'); |
2106 | err = proc_put_long(&buffer, &left, val, false); | |
2107 | if (err) | |
2108 | break; | |
1da177e4 LT |
2109 | } |
2110 | } | |
2111 | ||
00b7c339 AW |
2112 | if (!write && !first && left && !err) |
2113 | err = proc_put_char(&buffer, &left, '\n'); | |
2114 | if (write && !err) | |
2115 | left -= proc_skip_spaces(&kbuf); | |
2116 | free: | |
1da177e4 | 2117 | if (write) { |
00b7c339 AW |
2118 | free_page(page); |
2119 | if (first) | |
2120 | return err ? : -EINVAL; | |
1da177e4 | 2121 | } |
1da177e4 LT |
2122 | *lenp -= left; |
2123 | *ppos += *lenp; | |
00b7c339 | 2124 | return err; |
1da177e4 LT |
2125 | } |
2126 | ||
d8217f07 | 2127 | static int do_proc_doulongvec_minmax(struct ctl_table *table, int write, |
fcfbd547 KK |
2128 | void __user *buffer, |
2129 | size_t *lenp, loff_t *ppos, | |
2130 | unsigned long convmul, | |
2131 | unsigned long convdiv) | |
2132 | { | |
2133 | return __do_proc_doulongvec_minmax(table->data, table, write, | |
8d65af78 | 2134 | buffer, lenp, ppos, convmul, convdiv); |
fcfbd547 KK |
2135 | } |
2136 | ||
1da177e4 LT |
2137 | /** |
2138 | * proc_doulongvec_minmax - read a vector of long integers with min/max values | |
2139 | * @table: the sysctl table | |
2140 | * @write: %TRUE if this is a write to the sysctl file | |
1da177e4 LT |
2141 | * @buffer: the user buffer |
2142 | * @lenp: the size of the user buffer | |
2143 | * @ppos: file position | |
2144 | * | |
2145 | * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long | |
2146 | * values from/to the user buffer, treated as an ASCII string. | |
2147 | * | |
2148 | * This routine will ensure the values are within the range specified by | |
2149 | * table->extra1 (min) and table->extra2 (max). | |
2150 | * | |
2151 | * Returns 0 on success. | |
2152 | */ | |
8d65af78 | 2153 | int proc_doulongvec_minmax(struct ctl_table *table, int write, |
1da177e4 LT |
2154 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2155 | { | |
8d65af78 | 2156 | return do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos, 1l, 1l); |
1da177e4 LT |
2157 | } |
2158 | ||
2159 | /** | |
2160 | * proc_doulongvec_ms_jiffies_minmax - read a vector of millisecond values with min/max values | |
2161 | * @table: the sysctl table | |
2162 | * @write: %TRUE if this is a write to the sysctl file | |
1da177e4 LT |
2163 | * @buffer: the user buffer |
2164 | * @lenp: the size of the user buffer | |
2165 | * @ppos: file position | |
2166 | * | |
2167 | * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long | |
2168 | * values from/to the user buffer, treated as an ASCII string. The values | |
2169 | * are treated as milliseconds, and converted to jiffies when they are stored. | |
2170 | * | |
2171 | * This routine will ensure the values are within the range specified by | |
2172 | * table->extra1 (min) and table->extra2 (max). | |
2173 | * | |
2174 | * Returns 0 on success. | |
2175 | */ | |
d8217f07 | 2176 | int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, |
1da177e4 LT |
2177 | void __user *buffer, |
2178 | size_t *lenp, loff_t *ppos) | |
2179 | { | |
8d65af78 | 2180 | return do_proc_doulongvec_minmax(table, write, buffer, |
1da177e4 LT |
2181 | lenp, ppos, HZ, 1000l); |
2182 | } | |
2183 | ||
2184 | ||
00b7c339 | 2185 | static int do_proc_dointvec_jiffies_conv(bool *negp, unsigned long *lvalp, |
1da177e4 LT |
2186 | int *valp, |
2187 | int write, void *data) | |
2188 | { | |
2189 | if (write) { | |
cba9f33d BS |
2190 | if (*lvalp > LONG_MAX / HZ) |
2191 | return 1; | |
1da177e4 LT |
2192 | *valp = *negp ? -(*lvalp*HZ) : (*lvalp*HZ); |
2193 | } else { | |
2194 | int val = *valp; | |
2195 | unsigned long lval; | |
2196 | if (val < 0) { | |
00b7c339 | 2197 | *negp = true; |
1da177e4 LT |
2198 | lval = (unsigned long)-val; |
2199 | } else { | |
00b7c339 | 2200 | *negp = false; |
1da177e4 LT |
2201 | lval = (unsigned long)val; |
2202 | } | |
2203 | *lvalp = lval / HZ; | |
2204 | } | |
2205 | return 0; | |
2206 | } | |
2207 | ||
00b7c339 | 2208 | static int do_proc_dointvec_userhz_jiffies_conv(bool *negp, unsigned long *lvalp, |
1da177e4 LT |
2209 | int *valp, |
2210 | int write, void *data) | |
2211 | { | |
2212 | if (write) { | |
cba9f33d BS |
2213 | if (USER_HZ < HZ && *lvalp > (LONG_MAX / HZ) * USER_HZ) |
2214 | return 1; | |
1da177e4 LT |
2215 | *valp = clock_t_to_jiffies(*negp ? -*lvalp : *lvalp); |
2216 | } else { | |
2217 | int val = *valp; | |
2218 | unsigned long lval; | |
2219 | if (val < 0) { | |
00b7c339 | 2220 | *negp = true; |
1da177e4 LT |
2221 | lval = (unsigned long)-val; |
2222 | } else { | |
00b7c339 | 2223 | *negp = false; |
1da177e4 LT |
2224 | lval = (unsigned long)val; |
2225 | } | |
2226 | *lvalp = jiffies_to_clock_t(lval); | |
2227 | } | |
2228 | return 0; | |
2229 | } | |
2230 | ||
00b7c339 | 2231 | static int do_proc_dointvec_ms_jiffies_conv(bool *negp, unsigned long *lvalp, |
1da177e4 LT |
2232 | int *valp, |
2233 | int write, void *data) | |
2234 | { | |
2235 | if (write) { | |
2236 | *valp = msecs_to_jiffies(*negp ? -*lvalp : *lvalp); | |
2237 | } else { | |
2238 | int val = *valp; | |
2239 | unsigned long lval; | |
2240 | if (val < 0) { | |
00b7c339 | 2241 | *negp = true; |
1da177e4 LT |
2242 | lval = (unsigned long)-val; |
2243 | } else { | |
00b7c339 | 2244 | *negp = false; |
1da177e4 LT |
2245 | lval = (unsigned long)val; |
2246 | } | |
2247 | *lvalp = jiffies_to_msecs(lval); | |
2248 | } | |
2249 | return 0; | |
2250 | } | |
2251 | ||
2252 | /** | |
2253 | * proc_dointvec_jiffies - read a vector of integers as seconds | |
2254 | * @table: the sysctl table | |
2255 | * @write: %TRUE if this is a write to the sysctl file | |
1da177e4 LT |
2256 | * @buffer: the user buffer |
2257 | * @lenp: the size of the user buffer | |
2258 | * @ppos: file position | |
2259 | * | |
2260 | * Reads/writes up to table->maxlen/sizeof(unsigned int) integer | |
2261 | * values from/to the user buffer, treated as an ASCII string. | |
2262 | * The values read are assumed to be in seconds, and are converted into | |
2263 | * jiffies. | |
2264 | * | |
2265 | * Returns 0 on success. | |
2266 | */ | |
8d65af78 | 2267 | int proc_dointvec_jiffies(struct ctl_table *table, int write, |
1da177e4 LT |
2268 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2269 | { | |
8d65af78 | 2270 | return do_proc_dointvec(table,write,buffer,lenp,ppos, |
1da177e4 LT |
2271 | do_proc_dointvec_jiffies_conv,NULL); |
2272 | } | |
2273 | ||
2274 | /** | |
2275 | * proc_dointvec_userhz_jiffies - read a vector of integers as 1/USER_HZ seconds | |
2276 | * @table: the sysctl table | |
2277 | * @write: %TRUE if this is a write to the sysctl file | |
1da177e4 LT |
2278 | * @buffer: the user buffer |
2279 | * @lenp: the size of the user buffer | |
1e5d5331 | 2280 | * @ppos: pointer to the file position |
1da177e4 LT |
2281 | * |
2282 | * Reads/writes up to table->maxlen/sizeof(unsigned int) integer | |
2283 | * values from/to the user buffer, treated as an ASCII string. | |
2284 | * The values read are assumed to be in 1/USER_HZ seconds, and | |
2285 | * are converted into jiffies. | |
2286 | * | |
2287 | * Returns 0 on success. | |
2288 | */ | |
8d65af78 | 2289 | int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, |
1da177e4 LT |
2290 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2291 | { | |
8d65af78 | 2292 | return do_proc_dointvec(table,write,buffer,lenp,ppos, |
1da177e4 LT |
2293 | do_proc_dointvec_userhz_jiffies_conv,NULL); |
2294 | } | |
2295 | ||
2296 | /** | |
2297 | * proc_dointvec_ms_jiffies - read a vector of integers as 1 milliseconds | |
2298 | * @table: the sysctl table | |
2299 | * @write: %TRUE if this is a write to the sysctl file | |
1da177e4 LT |
2300 | * @buffer: the user buffer |
2301 | * @lenp: the size of the user buffer | |
67be2dd1 MW |
2302 | * @ppos: file position |
2303 | * @ppos: the current position in the file | |
1da177e4 LT |
2304 | * |
2305 | * Reads/writes up to table->maxlen/sizeof(unsigned int) integer | |
2306 | * values from/to the user buffer, treated as an ASCII string. | |
2307 | * The values read are assumed to be in 1/1000 seconds, and | |
2308 | * are converted into jiffies. | |
2309 | * | |
2310 | * Returns 0 on success. | |
2311 | */ | |
8d65af78 | 2312 | int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, |
1da177e4 LT |
2313 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2314 | { | |
8d65af78 | 2315 | return do_proc_dointvec(table, write, buffer, lenp, ppos, |
1da177e4 LT |
2316 | do_proc_dointvec_ms_jiffies_conv, NULL); |
2317 | } | |
2318 | ||
8d65af78 | 2319 | static int proc_do_cad_pid(struct ctl_table *table, int write, |
9ec52099 CLG |
2320 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2321 | { | |
2322 | struct pid *new_pid; | |
2323 | pid_t tmp; | |
2324 | int r; | |
2325 | ||
6c5f3e7b | 2326 | tmp = pid_vnr(cad_pid); |
9ec52099 | 2327 | |
8d65af78 | 2328 | r = __do_proc_dointvec(&tmp, table, write, buffer, |
9ec52099 CLG |
2329 | lenp, ppos, NULL, NULL); |
2330 | if (r || !write) | |
2331 | return r; | |
2332 | ||
2333 | new_pid = find_get_pid(tmp); | |
2334 | if (!new_pid) | |
2335 | return -ESRCH; | |
2336 | ||
2337 | put_pid(xchg(&cad_pid, new_pid)); | |
2338 | return 0; | |
2339 | } | |
2340 | ||
9f977fb7 OP |
2341 | /** |
2342 | * proc_do_large_bitmap - read/write from/to a large bitmap | |
2343 | * @table: the sysctl table | |
2344 | * @write: %TRUE if this is a write to the sysctl file | |
2345 | * @buffer: the user buffer | |
2346 | * @lenp: the size of the user buffer | |
2347 | * @ppos: file position | |
2348 | * | |
2349 | * The bitmap is stored at table->data and the bitmap length (in bits) | |
2350 | * in table->maxlen. | |
2351 | * | |
2352 | * We use a range comma separated format (e.g. 1,3-4,10-10) so that | |
2353 | * large bitmaps may be represented in a compact manner. Writing into | |
2354 | * the file will clear the bitmap then update it with the given input. | |
2355 | * | |
2356 | * Returns 0 on success. | |
2357 | */ | |
2358 | int proc_do_large_bitmap(struct ctl_table *table, int write, | |
2359 | void __user *buffer, size_t *lenp, loff_t *ppos) | |
2360 | { | |
2361 | int err = 0; | |
2362 | bool first = 1; | |
2363 | size_t left = *lenp; | |
2364 | unsigned long bitmap_len = table->maxlen; | |
2365 | unsigned long *bitmap = (unsigned long *) table->data; | |
2366 | unsigned long *tmp_bitmap = NULL; | |
2367 | char tr_a[] = { '-', ',', '\n' }, tr_b[] = { ',', '\n', 0 }, c; | |
2368 | ||
2369 | if (!bitmap_len || !left || (*ppos && !write)) { | |
2370 | *lenp = 0; | |
2371 | return 0; | |
2372 | } | |
2373 | ||
2374 | if (write) { | |
2375 | unsigned long page = 0; | |
2376 | char *kbuf; | |
2377 | ||
2378 | if (left > PAGE_SIZE - 1) | |
2379 | left = PAGE_SIZE - 1; | |
2380 | ||
2381 | page = __get_free_page(GFP_TEMPORARY); | |
2382 | kbuf = (char *) page; | |
2383 | if (!kbuf) | |
2384 | return -ENOMEM; | |
2385 | if (copy_from_user(kbuf, buffer, left)) { | |
2386 | free_page(page); | |
2387 | return -EFAULT; | |
2388 | } | |
2389 | kbuf[left] = 0; | |
2390 | ||
2391 | tmp_bitmap = kzalloc(BITS_TO_LONGS(bitmap_len) * sizeof(unsigned long), | |
2392 | GFP_KERNEL); | |
2393 | if (!tmp_bitmap) { | |
2394 | free_page(page); | |
2395 | return -ENOMEM; | |
2396 | } | |
2397 | proc_skip_char(&kbuf, &left, '\n'); | |
2398 | while (!err && left) { | |
2399 | unsigned long val_a, val_b; | |
2400 | bool neg; | |
2401 | ||
2402 | err = proc_get_long(&kbuf, &left, &val_a, &neg, tr_a, | |
2403 | sizeof(tr_a), &c); | |
2404 | if (err) | |
2405 | break; | |
2406 | if (val_a >= bitmap_len || neg) { | |
2407 | err = -EINVAL; | |
2408 | break; | |
2409 | } | |
2410 | ||
2411 | val_b = val_a; | |
2412 | if (left) { | |
2413 | kbuf++; | |
2414 | left--; | |
2415 | } | |
2416 | ||
2417 | if (c == '-') { | |
2418 | err = proc_get_long(&kbuf, &left, &val_b, | |
2419 | &neg, tr_b, sizeof(tr_b), | |
2420 | &c); | |
2421 | if (err) | |
2422 | break; | |
2423 | if (val_b >= bitmap_len || neg || | |
2424 | val_a > val_b) { | |
2425 | err = -EINVAL; | |
2426 | break; | |
2427 | } | |
2428 | if (left) { | |
2429 | kbuf++; | |
2430 | left--; | |
2431 | } | |
2432 | } | |
2433 | ||
5a04cca6 | 2434 | bitmap_set(tmp_bitmap, val_a, val_b - val_a + 1); |
9f977fb7 OP |
2435 | first = 0; |
2436 | proc_skip_char(&kbuf, &left, '\n'); | |
2437 | } | |
2438 | free_page(page); | |
2439 | } else { | |
2440 | unsigned long bit_a, bit_b = 0; | |
2441 | ||
2442 | while (left) { | |
2443 | bit_a = find_next_bit(bitmap, bitmap_len, bit_b); | |
2444 | if (bit_a >= bitmap_len) | |
2445 | break; | |
2446 | bit_b = find_next_zero_bit(bitmap, bitmap_len, | |
2447 | bit_a + 1) - 1; | |
2448 | ||
2449 | if (!first) { | |
2450 | err = proc_put_char(&buffer, &left, ','); | |
2451 | if (err) | |
2452 | break; | |
2453 | } | |
2454 | err = proc_put_long(&buffer, &left, bit_a, false); | |
2455 | if (err) | |
2456 | break; | |
2457 | if (bit_a != bit_b) { | |
2458 | err = proc_put_char(&buffer, &left, '-'); | |
2459 | if (err) | |
2460 | break; | |
2461 | err = proc_put_long(&buffer, &left, bit_b, false); | |
2462 | if (err) | |
2463 | break; | |
2464 | } | |
2465 | ||
2466 | first = 0; bit_b++; | |
2467 | } | |
2468 | if (!err) | |
2469 | err = proc_put_char(&buffer, &left, '\n'); | |
2470 | } | |
2471 | ||
2472 | if (!err) { | |
2473 | if (write) { | |
2474 | if (*ppos) | |
2475 | bitmap_or(bitmap, bitmap, tmp_bitmap, bitmap_len); | |
2476 | else | |
5a04cca6 | 2477 | bitmap_copy(bitmap, tmp_bitmap, bitmap_len); |
9f977fb7 OP |
2478 | } |
2479 | kfree(tmp_bitmap); | |
2480 | *lenp -= left; | |
2481 | *ppos += *lenp; | |
2482 | return 0; | |
2483 | } else { | |
2484 | kfree(tmp_bitmap); | |
2485 | return err; | |
2486 | } | |
2487 | } | |
2488 | ||
55610500 | 2489 | #else /* CONFIG_PROC_SYSCTL */ |
1da177e4 | 2490 | |
8d65af78 | 2491 | int proc_dostring(struct ctl_table *table, int write, |
1da177e4 LT |
2492 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2493 | { | |
2494 | return -ENOSYS; | |
2495 | } | |
2496 | ||
8d65af78 | 2497 | int proc_dointvec(struct ctl_table *table, int write, |
1da177e4 | 2498 | void __user *buffer, size_t *lenp, loff_t *ppos) |
1da177e4 LT |
2499 | { |
2500 | return -ENOSYS; | |
2501 | } | |
2502 | ||
8d65af78 | 2503 | int proc_dointvec_minmax(struct ctl_table *table, int write, |
1da177e4 LT |
2504 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2505 | { | |
2506 | return -ENOSYS; | |
2507 | } | |
2508 | ||
8d65af78 | 2509 | int proc_dointvec_jiffies(struct ctl_table *table, int write, |
1da177e4 LT |
2510 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2511 | { | |
2512 | return -ENOSYS; | |
2513 | } | |
2514 | ||
8d65af78 | 2515 | int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, |
1da177e4 LT |
2516 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2517 | { | |
2518 | return -ENOSYS; | |
2519 | } | |
2520 | ||
8d65af78 | 2521 | int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, |
1da177e4 LT |
2522 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2523 | { | |
2524 | return -ENOSYS; | |
2525 | } | |
2526 | ||
8d65af78 | 2527 | int proc_doulongvec_minmax(struct ctl_table *table, int write, |
1da177e4 LT |
2528 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2529 | { | |
2530 | return -ENOSYS; | |
2531 | } | |
2532 | ||
d8217f07 | 2533 | int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, |
1da177e4 LT |
2534 | void __user *buffer, |
2535 | size_t *lenp, loff_t *ppos) | |
2536 | { | |
2537 | return -ENOSYS; | |
2538 | } | |
2539 | ||
2540 | ||
55610500 | 2541 | #endif /* CONFIG_PROC_SYSCTL */ |
1da177e4 | 2542 | |
1da177e4 LT |
2543 | /* |
2544 | * No sense putting this after each symbol definition, twice, | |
2545 | * exception granted :-) | |
2546 | */ | |
2547 | EXPORT_SYMBOL(proc_dointvec); | |
2548 | EXPORT_SYMBOL(proc_dointvec_jiffies); | |
2549 | EXPORT_SYMBOL(proc_dointvec_minmax); | |
2550 | EXPORT_SYMBOL(proc_dointvec_userhz_jiffies); | |
2551 | EXPORT_SYMBOL(proc_dointvec_ms_jiffies); | |
2552 | EXPORT_SYMBOL(proc_dostring); | |
2553 | EXPORT_SYMBOL(proc_doulongvec_minmax); | |
2554 | EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax); |