diff options
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 627 |
1 files changed, 12 insertions, 615 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 0d949c517412..b4a5763d6dc8 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <linux/security.h> | 27 | #include <linux/security.h> |
28 | #include <linux/ctype.h> | 28 | #include <linux/ctype.h> |
29 | #include <linux/kmemcheck.h> | 29 | #include <linux/kmemcheck.h> |
30 | #include <linux/smp_lock.h> | ||
31 | #include <linux/fs.h> | 30 | #include <linux/fs.h> |
32 | #include <linux/init.h> | 31 | #include <linux/init.h> |
33 | #include <linux/kernel.h> | 32 | #include <linux/kernel.h> |
@@ -60,7 +59,6 @@ | |||
60 | #include <asm/io.h> | 59 | #include <asm/io.h> |
61 | #endif | 60 | #endif |
62 | 61 | ||
63 | static int deprecated_sysctl_warning(struct __sysctl_args *args); | ||
64 | 62 | ||
65 | #if defined(CONFIG_SYSCTL) | 63 | #if defined(CONFIG_SYSCTL) |
66 | 64 | ||
@@ -207,31 +205,26 @@ extern int lock_stat; | |||
207 | 205 | ||
208 | static struct ctl_table root_table[] = { | 206 | static struct ctl_table root_table[] = { |
209 | { | 207 | { |
210 | .ctl_name = CTL_KERN, | ||
211 | .procname = "kernel", | 208 | .procname = "kernel", |
212 | .mode = 0555, | 209 | .mode = 0555, |
213 | .child = kern_table, | 210 | .child = kern_table, |
214 | }, | 211 | }, |
215 | { | 212 | { |
216 | .ctl_name = CTL_VM, | ||
217 | .procname = "vm", | 213 | .procname = "vm", |
218 | .mode = 0555, | 214 | .mode = 0555, |
219 | .child = vm_table, | 215 | .child = vm_table, |
220 | }, | 216 | }, |
221 | { | 217 | { |
222 | .ctl_name = CTL_FS, | ||
223 | .procname = "fs", | 218 | .procname = "fs", |
224 | .mode = 0555, | 219 | .mode = 0555, |
225 | .child = fs_table, | 220 | .child = fs_table, |
226 | }, | 221 | }, |
227 | { | 222 | { |
228 | .ctl_name = CTL_DEBUG, | ||
229 | .procname = "debug", | 223 | .procname = "debug", |
230 | .mode = 0555, | 224 | .mode = 0555, |
231 | .child = debug_table, | 225 | .child = debug_table, |
232 | }, | 226 | }, |
233 | { | 227 | { |
234 | .ctl_name = CTL_DEV, | ||
235 | .procname = "dev", | 228 | .procname = "dev", |
236 | .mode = 0555, | 229 | .mode = 0555, |
237 | .child = dev_table, | 230 | .child = dev_table, |
@@ -240,7 +233,7 @@ static struct ctl_table root_table[] = { | |||
240 | * NOTE: do not add new entries to this table unless you have read | 233 | * NOTE: do not add new entries to this table unless you have read |
241 | * Documentation/sysctl/ctl_unnumbered.txt | 234 | * Documentation/sysctl/ctl_unnumbered.txt |
242 | */ | 235 | */ |
243 | { .ctl_name = 0 } | 236 | { } |
244 | }; | 237 | }; |
245 | 238 | ||
246 | #ifdef CONFIG_SCHED_DEBUG | 239 | #ifdef CONFIG_SCHED_DEBUG |
@@ -252,7 +245,6 @@ static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ | |||
252 | 245 | ||
253 | static struct ctl_table kern_table[] = { | 246 | static struct ctl_table kern_table[] = { |
254 | { | 247 | { |
255 | .ctl_name = CTL_UNNUMBERED, | ||
256 | .procname = "sched_child_runs_first", | 248 | .procname = "sched_child_runs_first", |
257 | .data = &sysctl_sched_child_runs_first, | 249 | .data = &sysctl_sched_child_runs_first, |
258 | .maxlen = sizeof(unsigned int), | 250 | .maxlen = sizeof(unsigned int), |
@@ -261,40 +253,33 @@ static struct ctl_table kern_table[] = { | |||
261 | }, | 253 | }, |
262 | #ifdef CONFIG_SCHED_DEBUG | 254 | #ifdef CONFIG_SCHED_DEBUG |
263 | { | 255 | { |
264 | .ctl_name = CTL_UNNUMBERED, | ||
265 | .procname = "sched_min_granularity_ns", | 256 | .procname = "sched_min_granularity_ns", |
266 | .data = &sysctl_sched_min_granularity, | 257 | .data = &sysctl_sched_min_granularity, |
267 | .maxlen = sizeof(unsigned int), | 258 | .maxlen = sizeof(unsigned int), |
268 | .mode = 0644, | 259 | .mode = 0644, |
269 | .proc_handler = &sched_nr_latency_handler, | 260 | .proc_handler = &sched_nr_latency_handler, |
270 | .strategy = &sysctl_intvec, | ||
271 | .extra1 = &min_sched_granularity_ns, | 261 | .extra1 = &min_sched_granularity_ns, |
272 | .extra2 = &max_sched_granularity_ns, | 262 | .extra2 = &max_sched_granularity_ns, |
273 | }, | 263 | }, |
274 | { | 264 | { |
275 | .ctl_name = CTL_UNNUMBERED, | ||
276 | .procname = "sched_latency_ns", | 265 | .procname = "sched_latency_ns", |
277 | .data = &sysctl_sched_latency, | 266 | .data = &sysctl_sched_latency, |
278 | .maxlen = sizeof(unsigned int), | 267 | .maxlen = sizeof(unsigned int), |
279 | .mode = 0644, | 268 | .mode = 0644, |
280 | .proc_handler = &sched_nr_latency_handler, | 269 | .proc_handler = &sched_nr_latency_handler, |
281 | .strategy = &sysctl_intvec, | ||
282 | .extra1 = &min_sched_granularity_ns, | 270 | .extra1 = &min_sched_granularity_ns, |
283 | .extra2 = &max_sched_granularity_ns, | 271 | .extra2 = &max_sched_granularity_ns, |
284 | }, | 272 | }, |
285 | { | 273 | { |
286 | .ctl_name = CTL_UNNUMBERED, | ||
287 | .procname = "sched_wakeup_granularity_ns", | 274 | .procname = "sched_wakeup_granularity_ns", |
288 | .data = &sysctl_sched_wakeup_granularity, | 275 | .data = &sysctl_sched_wakeup_granularity, |
289 | .maxlen = sizeof(unsigned int), | 276 | .maxlen = sizeof(unsigned int), |
290 | .mode = 0644, | 277 | .mode = 0644, |
291 | .proc_handler = &proc_dointvec_minmax, | 278 | .proc_handler = &proc_dointvec_minmax, |
292 | .strategy = &sysctl_intvec, | ||
293 | .extra1 = &min_wakeup_granularity_ns, | 279 | .extra1 = &min_wakeup_granularity_ns, |
294 | .extra2 = &max_wakeup_granularity_ns, | 280 | .extra2 = &max_wakeup_granularity_ns, |
295 | }, | 281 | }, |
296 | { | 282 | { |
297 | .ctl_name = CTL_UNNUMBERED, | ||
298 | .procname = "sched_shares_ratelimit", | 283 | .procname = "sched_shares_ratelimit", |
299 | .data = &sysctl_sched_shares_ratelimit, | 284 | .data = &sysctl_sched_shares_ratelimit, |
300 | .maxlen = sizeof(unsigned int), | 285 | .maxlen = sizeof(unsigned int), |
@@ -302,17 +287,14 @@ static struct ctl_table kern_table[] = { | |||
302 | .proc_handler = &proc_dointvec, | 287 | .proc_handler = &proc_dointvec, |
303 | }, | 288 | }, |
304 | { | 289 | { |
305 | .ctl_name = CTL_UNNUMBERED, | ||
306 | .procname = "sched_shares_thresh", | 290 | .procname = "sched_shares_thresh", |
307 | .data = &sysctl_sched_shares_thresh, | 291 | .data = &sysctl_sched_shares_thresh, |
308 | .maxlen = sizeof(unsigned int), | 292 | .maxlen = sizeof(unsigned int), |
309 | .mode = 0644, | 293 | .mode = 0644, |
310 | .proc_handler = &proc_dointvec_minmax, | 294 | .proc_handler = &proc_dointvec_minmax, |
311 | .strategy = &sysctl_intvec, | ||
312 | .extra1 = &zero, | 295 | .extra1 = &zero, |
313 | }, | 296 | }, |
314 | { | 297 | { |
315 | .ctl_name = CTL_UNNUMBERED, | ||
316 | .procname = "sched_features", | 298 | .procname = "sched_features", |
317 | .data = &sysctl_sched_features, | 299 | .data = &sysctl_sched_features, |
318 | .maxlen = sizeof(unsigned int), | 300 | .maxlen = sizeof(unsigned int), |
@@ -320,7 +302,6 @@ static struct ctl_table kern_table[] = { | |||
320 | .proc_handler = &proc_dointvec, | 302 | .proc_handler = &proc_dointvec, |
321 | }, | 303 | }, |
322 | { | 304 | { |
323 | .ctl_name = CTL_UNNUMBERED, | ||
324 | .procname = "sched_migration_cost", | 305 | .procname = "sched_migration_cost", |
325 | .data = &sysctl_sched_migration_cost, | 306 | .data = &sysctl_sched_migration_cost, |
326 | .maxlen = sizeof(unsigned int), | 307 | .maxlen = sizeof(unsigned int), |
@@ -328,7 +309,6 @@ static struct ctl_table kern_table[] = { | |||
328 | .proc_handler = &proc_dointvec, | 309 | .proc_handler = &proc_dointvec, |
329 | }, | 310 | }, |
330 | { | 311 | { |
331 | .ctl_name = CTL_UNNUMBERED, | ||
332 | .procname = "sched_nr_migrate", | 312 | .procname = "sched_nr_migrate", |
333 | .data = &sysctl_sched_nr_migrate, | 313 | .data = &sysctl_sched_nr_migrate, |
334 | .maxlen = sizeof(unsigned int), | 314 | .maxlen = sizeof(unsigned int), |
@@ -336,7 +316,6 @@ static struct ctl_table kern_table[] = { | |||
336 | .proc_handler = &proc_dointvec, | 316 | .proc_handler = &proc_dointvec, |
337 | }, | 317 | }, |
338 | { | 318 | { |
339 | .ctl_name = CTL_UNNUMBERED, | ||
340 | .procname = "sched_time_avg", | 319 | .procname = "sched_time_avg", |
341 | .data = &sysctl_sched_time_avg, | 320 | .data = &sysctl_sched_time_avg, |
342 | .maxlen = sizeof(unsigned int), | 321 | .maxlen = sizeof(unsigned int), |
@@ -344,19 +323,16 @@ static struct ctl_table kern_table[] = { | |||
344 | .proc_handler = &proc_dointvec, | 323 | .proc_handler = &proc_dointvec, |
345 | }, | 324 | }, |
346 | { | 325 | { |
347 | .ctl_name = CTL_UNNUMBERED, | ||
348 | .procname = "timer_migration", | 326 | .procname = "timer_migration", |
349 | .data = &sysctl_timer_migration, | 327 | .data = &sysctl_timer_migration, |
350 | .maxlen = sizeof(unsigned int), | 328 | .maxlen = sizeof(unsigned int), |
351 | .mode = 0644, | 329 | .mode = 0644, |
352 | .proc_handler = &proc_dointvec_minmax, | 330 | .proc_handler = &proc_dointvec_minmax, |
353 | .strategy = &sysctl_intvec, | ||
354 | .extra1 = &zero, | 331 | .extra1 = &zero, |
355 | .extra2 = &one, | 332 | .extra2 = &one, |
356 | }, | 333 | }, |
357 | #endif | 334 | #endif |
358 | { | 335 | { |
359 | .ctl_name = CTL_UNNUMBERED, | ||
360 | .procname = "sched_rt_period_us", | 336 | .procname = "sched_rt_period_us", |
361 | .data = &sysctl_sched_rt_period, | 337 | .data = &sysctl_sched_rt_period, |
362 | .maxlen = sizeof(unsigned int), | 338 | .maxlen = sizeof(unsigned int), |
@@ -364,7 +340,6 @@ static struct ctl_table kern_table[] = { | |||
364 | .proc_handler = &sched_rt_handler, | 340 | .proc_handler = &sched_rt_handler, |
365 | }, | 341 | }, |
366 | { | 342 | { |
367 | .ctl_name = CTL_UNNUMBERED, | ||
368 | .procname = "sched_rt_runtime_us", | 343 | .procname = "sched_rt_runtime_us", |
369 | .data = &sysctl_sched_rt_runtime, | 344 | .data = &sysctl_sched_rt_runtime, |
370 | .maxlen = sizeof(int), | 345 | .maxlen = sizeof(int), |
@@ -372,7 +347,6 @@ static struct ctl_table kern_table[] = { | |||
372 | .proc_handler = &sched_rt_handler, | 347 | .proc_handler = &sched_rt_handler, |
373 | }, | 348 | }, |
374 | { | 349 | { |
375 | .ctl_name = CTL_UNNUMBERED, | ||
376 | .procname = "sched_compat_yield", | 350 | .procname = "sched_compat_yield", |
377 | .data = &sysctl_sched_compat_yield, | 351 | .data = &sysctl_sched_compat_yield, |
378 | .maxlen = sizeof(unsigned int), | 352 | .maxlen = sizeof(unsigned int), |
@@ -381,7 +355,6 @@ static struct ctl_table kern_table[] = { | |||
381 | }, | 355 | }, |
382 | #ifdef CONFIG_PROVE_LOCKING | 356 | #ifdef CONFIG_PROVE_LOCKING |
383 | { | 357 | { |
384 | .ctl_name = CTL_UNNUMBERED, | ||
385 | .procname = "prove_locking", | 358 | .procname = "prove_locking", |
386 | .data = &prove_locking, | 359 | .data = &prove_locking, |
387 | .maxlen = sizeof(int), | 360 | .maxlen = sizeof(int), |
@@ -391,7 +364,6 @@ static struct ctl_table kern_table[] = { | |||
391 | #endif | 364 | #endif |
392 | #ifdef CONFIG_LOCK_STAT | 365 | #ifdef CONFIG_LOCK_STAT |
393 | { | 366 | { |
394 | .ctl_name = CTL_UNNUMBERED, | ||
395 | .procname = "lock_stat", | 367 | .procname = "lock_stat", |
396 | .data = &lock_stat, | 368 | .data = &lock_stat, |
397 | .maxlen = sizeof(int), | 369 | .maxlen = sizeof(int), |
@@ -400,7 +372,6 @@ static struct ctl_table kern_table[] = { | |||
400 | }, | 372 | }, |
401 | #endif | 373 | #endif |
402 | { | 374 | { |
403 | .ctl_name = KERN_PANIC, | ||
404 | .procname = "panic", | 375 | .procname = "panic", |
405 | .data = &panic_timeout, | 376 | .data = &panic_timeout, |
406 | .maxlen = sizeof(int), | 377 | .maxlen = sizeof(int), |
@@ -408,7 +379,6 @@ static struct ctl_table kern_table[] = { | |||
408 | .proc_handler = &proc_dointvec, | 379 | .proc_handler = &proc_dointvec, |
409 | }, | 380 | }, |
410 | { | 381 | { |
411 | .ctl_name = KERN_CORE_USES_PID, | ||
412 | .procname = "core_uses_pid", | 382 | .procname = "core_uses_pid", |
413 | .data = &core_uses_pid, | 383 | .data = &core_uses_pid, |
414 | .maxlen = sizeof(int), | 384 | .maxlen = sizeof(int), |
@@ -416,16 +386,13 @@ static struct ctl_table kern_table[] = { | |||
416 | .proc_handler = &proc_dointvec, | 386 | .proc_handler = &proc_dointvec, |
417 | }, | 387 | }, |
418 | { | 388 | { |
419 | .ctl_name = KERN_CORE_PATTERN, | ||
420 | .procname = "core_pattern", | 389 | .procname = "core_pattern", |
421 | .data = core_pattern, | 390 | .data = core_pattern, |
422 | .maxlen = CORENAME_MAX_SIZE, | 391 | .maxlen = CORENAME_MAX_SIZE, |
423 | .mode = 0644, | 392 | .mode = 0644, |
424 | .proc_handler = &proc_dostring, | 393 | .proc_handler = &proc_dostring, |
425 | .strategy = &sysctl_string, | ||
426 | }, | 394 | }, |
427 | { | 395 | { |
428 | .ctl_name = CTL_UNNUMBERED, | ||
429 | .procname = "core_pipe_limit", | 396 | .procname = "core_pipe_limit", |
430 | .data = &core_pipe_limit, | 397 | .data = &core_pipe_limit, |
431 | .maxlen = sizeof(unsigned int), | 398 | .maxlen = sizeof(unsigned int), |
@@ -451,7 +418,6 @@ static struct ctl_table kern_table[] = { | |||
451 | #endif | 418 | #endif |
452 | #ifdef CONFIG_BLK_DEV_INITRD | 419 | #ifdef CONFIG_BLK_DEV_INITRD |
453 | { | 420 | { |
454 | .ctl_name = KERN_REALROOTDEV, | ||
455 | .procname = "real-root-dev", | 421 | .procname = "real-root-dev", |
456 | .data = &real_root_dev, | 422 | .data = &real_root_dev, |
457 | .maxlen = sizeof(int), | 423 | .maxlen = sizeof(int), |
@@ -460,7 +426,6 @@ static struct ctl_table kern_table[] = { | |||
460 | }, | 426 | }, |
461 | #endif | 427 | #endif |
462 | { | 428 | { |
463 | .ctl_name = CTL_UNNUMBERED, | ||
464 | .procname = "print-fatal-signals", | 429 | .procname = "print-fatal-signals", |
465 | .data = &print_fatal_signals, | 430 | .data = &print_fatal_signals, |
466 | .maxlen = sizeof(int), | 431 | .maxlen = sizeof(int), |
@@ -469,16 +434,13 @@ static struct ctl_table kern_table[] = { | |||
469 | }, | 434 | }, |
470 | #ifdef CONFIG_SPARC | 435 | #ifdef CONFIG_SPARC |
471 | { | 436 | { |
472 | .ctl_name = KERN_SPARC_REBOOT, | ||
473 | .procname = "reboot-cmd", | 437 | .procname = "reboot-cmd", |
474 | .data = reboot_command, | 438 | .data = reboot_command, |
475 | .maxlen = 256, | 439 | .maxlen = 256, |
476 | .mode = 0644, | 440 | .mode = 0644, |
477 | .proc_handler = &proc_dostring, | 441 | .proc_handler = &proc_dostring, |
478 | .strategy = &sysctl_string, | ||
479 | }, | 442 | }, |
480 | { | 443 | { |
481 | .ctl_name = KERN_SPARC_STOP_A, | ||
482 | .procname = "stop-a", | 444 | .procname = "stop-a", |
483 | .data = &stop_a_enabled, | 445 | .data = &stop_a_enabled, |
484 | .maxlen = sizeof (int), | 446 | .maxlen = sizeof (int), |
@@ -486,7 +448,6 @@ static struct ctl_table kern_table[] = { | |||
486 | .proc_handler = &proc_dointvec, | 448 | .proc_handler = &proc_dointvec, |
487 | }, | 449 | }, |
488 | { | 450 | { |
489 | .ctl_name = KERN_SPARC_SCONS_PWROFF, | ||
490 | .procname = "scons-poweroff", | 451 | .procname = "scons-poweroff", |
491 | .data = &scons_pwroff, | 452 | .data = &scons_pwroff, |
492 | .maxlen = sizeof (int), | 453 | .maxlen = sizeof (int), |
@@ -496,7 +457,6 @@ static struct ctl_table kern_table[] = { | |||
496 | #endif | 457 | #endif |
497 | #ifdef CONFIG_SPARC64 | 458 | #ifdef CONFIG_SPARC64 |
498 | { | 459 | { |
499 | .ctl_name = CTL_UNNUMBERED, | ||
500 | .procname = "tsb-ratio", | 460 | .procname = "tsb-ratio", |
501 | .data = &sysctl_tsb_ratio, | 461 | .data = &sysctl_tsb_ratio, |
502 | .maxlen = sizeof (int), | 462 | .maxlen = sizeof (int), |
@@ -506,7 +466,6 @@ static struct ctl_table kern_table[] = { | |||
506 | #endif | 466 | #endif |
507 | #ifdef __hppa__ | 467 | #ifdef __hppa__ |
508 | { | 468 | { |
509 | .ctl_name = KERN_HPPA_PWRSW, | ||
510 | .procname = "soft-power", | 469 | .procname = "soft-power", |
511 | .data = &pwrsw_enabled, | 470 | .data = &pwrsw_enabled, |
512 | .maxlen = sizeof (int), | 471 | .maxlen = sizeof (int), |
@@ -514,7 +473,6 @@ static struct ctl_table kern_table[] = { | |||
514 | .proc_handler = &proc_dointvec, | 473 | .proc_handler = &proc_dointvec, |
515 | }, | 474 | }, |
516 | { | 475 | { |
517 | .ctl_name = KERN_HPPA_UNALIGNED, | ||
518 | .procname = "unaligned-trap", | 476 | .procname = "unaligned-trap", |
519 | .data = &unaligned_enabled, | 477 | .data = &unaligned_enabled, |
520 | .maxlen = sizeof (int), | 478 | .maxlen = sizeof (int), |
@@ -523,7 +481,6 @@ static struct ctl_table kern_table[] = { | |||
523 | }, | 481 | }, |
524 | #endif | 482 | #endif |
525 | { | 483 | { |
526 | .ctl_name = KERN_CTLALTDEL, | ||
527 | .procname = "ctrl-alt-del", | 484 | .procname = "ctrl-alt-del", |
528 | .data = &C_A_D, | 485 | .data = &C_A_D, |
529 | .maxlen = sizeof(int), | 486 | .maxlen = sizeof(int), |
@@ -532,7 +489,6 @@ static struct ctl_table kern_table[] = { | |||
532 | }, | 489 | }, |
533 | #ifdef CONFIG_FUNCTION_TRACER | 490 | #ifdef CONFIG_FUNCTION_TRACER |
534 | { | 491 | { |
535 | .ctl_name = CTL_UNNUMBERED, | ||
536 | .procname = "ftrace_enabled", | 492 | .procname = "ftrace_enabled", |
537 | .data = &ftrace_enabled, | 493 | .data = &ftrace_enabled, |
538 | .maxlen = sizeof(int), | 494 | .maxlen = sizeof(int), |
@@ -542,7 +498,6 @@ static struct ctl_table kern_table[] = { | |||
542 | #endif | 498 | #endif |
543 | #ifdef CONFIG_STACK_TRACER | 499 | #ifdef CONFIG_STACK_TRACER |
544 | { | 500 | { |
545 | .ctl_name = CTL_UNNUMBERED, | ||
546 | .procname = "stack_tracer_enabled", | 501 | .procname = "stack_tracer_enabled", |
547 | .data = &stack_tracer_enabled, | 502 | .data = &stack_tracer_enabled, |
548 | .maxlen = sizeof(int), | 503 | .maxlen = sizeof(int), |
@@ -552,7 +507,6 @@ static struct ctl_table kern_table[] = { | |||
552 | #endif | 507 | #endif |
553 | #ifdef CONFIG_TRACING | 508 | #ifdef CONFIG_TRACING |
554 | { | 509 | { |
555 | .ctl_name = CTL_UNNUMBERED, | ||
556 | .procname = "ftrace_dump_on_oops", | 510 | .procname = "ftrace_dump_on_oops", |
557 | .data = &ftrace_dump_on_oops, | 511 | .data = &ftrace_dump_on_oops, |
558 | .maxlen = sizeof(int), | 512 | .maxlen = sizeof(int), |
@@ -562,16 +516,13 @@ static struct ctl_table kern_table[] = { | |||
562 | #endif | 516 | #endif |
563 | #ifdef CONFIG_MODULES | 517 | #ifdef CONFIG_MODULES |
564 | { | 518 | { |
565 | .ctl_name = KERN_MODPROBE, | ||
566 | .procname = "modprobe", | 519 | .procname = "modprobe", |
567 | .data = &modprobe_path, | 520 | .data = &modprobe_path, |
568 | .maxlen = KMOD_PATH_LEN, | 521 | .maxlen = KMOD_PATH_LEN, |
569 | .mode = 0644, | 522 | .mode = 0644, |
570 | .proc_handler = &proc_dostring, | 523 | .proc_handler = &proc_dostring, |
571 | .strategy = &sysctl_string, | ||
572 | }, | 524 | }, |
573 | { | 525 | { |
574 | .ctl_name = CTL_UNNUMBERED, | ||
575 | .procname = "modules_disabled", | 526 | .procname = "modules_disabled", |
576 | .data = &modules_disabled, | 527 | .data = &modules_disabled, |
577 | .maxlen = sizeof(int), | 528 | .maxlen = sizeof(int), |
@@ -584,18 +535,15 @@ static struct ctl_table kern_table[] = { | |||
584 | #endif | 535 | #endif |
585 | #if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) | 536 | #if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) |
586 | { | 537 | { |
587 | .ctl_name = KERN_HOTPLUG, | ||
588 | .procname = "hotplug", | 538 | .procname = "hotplug", |
589 | .data = &uevent_helper, | 539 | .data = &uevent_helper, |
590 | .maxlen = UEVENT_HELPER_PATH_LEN, | 540 | .maxlen = UEVENT_HELPER_PATH_LEN, |
591 | .mode = 0644, | 541 | .mode = 0644, |
592 | .proc_handler = &proc_dostring, | 542 | .proc_handler = &proc_dostring, |
593 | .strategy = &sysctl_string, | ||
594 | }, | 543 | }, |
595 | #endif | 544 | #endif |
596 | #ifdef CONFIG_CHR_DEV_SG | 545 | #ifdef CONFIG_CHR_DEV_SG |
597 | { | 546 | { |
598 | .ctl_name = KERN_SG_BIG_BUFF, | ||
599 | .procname = "sg-big-buff", | 547 | .procname = "sg-big-buff", |
600 | .data = &sg_big_buff, | 548 | .data = &sg_big_buff, |
601 | .maxlen = sizeof (int), | 549 | .maxlen = sizeof (int), |
@@ -605,7 +553,6 @@ static struct ctl_table kern_table[] = { | |||
605 | #endif | 553 | #endif |
606 | #ifdef CONFIG_BSD_PROCESS_ACCT | 554 | #ifdef CONFIG_BSD_PROCESS_ACCT |
607 | { | 555 | { |
608 | .ctl_name = KERN_ACCT, | ||
609 | .procname = "acct", | 556 | .procname = "acct", |
610 | .data = &acct_parm, | 557 | .data = &acct_parm, |
611 | .maxlen = 3*sizeof(int), | 558 | .maxlen = 3*sizeof(int), |
@@ -615,7 +562,6 @@ static struct ctl_table kern_table[] = { | |||
615 | #endif | 562 | #endif |
616 | #ifdef CONFIG_MAGIC_SYSRQ | 563 | #ifdef CONFIG_MAGIC_SYSRQ |
617 | { | 564 | { |
618 | .ctl_name = KERN_SYSRQ, | ||
619 | .procname = "sysrq", | 565 | .procname = "sysrq", |
620 | .data = &__sysrq_enabled, | 566 | .data = &__sysrq_enabled, |
621 | .maxlen = sizeof (int), | 567 | .maxlen = sizeof (int), |
@@ -633,7 +579,6 @@ static struct ctl_table kern_table[] = { | |||
633 | }, | 579 | }, |
634 | #endif | 580 | #endif |
635 | { | 581 | { |
636 | .ctl_name = KERN_MAX_THREADS, | ||
637 | .procname = "threads-max", | 582 | .procname = "threads-max", |
638 | .data = &max_threads, | 583 | .data = &max_threads, |
639 | .maxlen = sizeof(int), | 584 | .maxlen = sizeof(int), |
@@ -641,37 +586,31 @@ static struct ctl_table kern_table[] = { | |||
641 | .proc_handler = &proc_dointvec, | 586 | .proc_handler = &proc_dointvec, |
642 | }, | 587 | }, |
643 | { | 588 | { |
644 | .ctl_name = KERN_RANDOM, | ||
645 | .procname = "random", | 589 | .procname = "random", |
646 | .mode = 0555, | 590 | .mode = 0555, |
647 | .child = random_table, | 591 | .child = random_table, |
648 | }, | 592 | }, |
649 | { | 593 | { |
650 | .ctl_name = KERN_OVERFLOWUID, | ||
651 | .procname = "overflowuid", | 594 | .procname = "overflowuid", |
652 | .data = &overflowuid, | 595 | .data = &overflowuid, |
653 | .maxlen = sizeof(int), | 596 | .maxlen = sizeof(int), |
654 | .mode = 0644, | 597 | .mode = 0644, |
655 | .proc_handler = &proc_dointvec_minmax, | 598 | .proc_handler = &proc_dointvec_minmax, |
656 | .strategy = &sysctl_intvec, | ||
657 | .extra1 = &minolduid, | 599 | .extra1 = &minolduid, |
658 | .extra2 = &maxolduid, | 600 | .extra2 = &maxolduid, |
659 | }, | 601 | }, |
660 | { | 602 | { |
661 | .ctl_name = KERN_OVERFLOWGID, | ||
662 | .procname = "overflowgid", | 603 | .procname = "overflowgid", |
663 | .data = &overflowgid, | 604 | .data = &overflowgid, |
664 | .maxlen = sizeof(int), | 605 | .maxlen = sizeof(int), |
665 | .mode = 0644, | 606 | .mode = 0644, |
666 | .proc_handler = &proc_dointvec_minmax, | 607 | .proc_handler = &proc_dointvec_minmax, |
667 | .strategy = &sysctl_intvec, | ||
668 | .extra1 = &minolduid, | 608 | .extra1 = &minolduid, |
669 | .extra2 = &maxolduid, | 609 | .extra2 = &maxolduid, |
670 | }, | 610 | }, |
671 | #ifdef CONFIG_S390 | 611 | #ifdef CONFIG_S390 |
672 | #ifdef CONFIG_MATHEMU | 612 | #ifdef CONFIG_MATHEMU |
673 | { | 613 | { |
674 | .ctl_name = KERN_IEEE_EMULATION_WARNINGS, | ||
675 | .procname = "ieee_emulation_warnings", | 614 | .procname = "ieee_emulation_warnings", |
676 | .data = &sysctl_ieee_emulation_warnings, | 615 | .data = &sysctl_ieee_emulation_warnings, |
677 | .maxlen = sizeof(int), | 616 | .maxlen = sizeof(int), |
@@ -680,7 +619,6 @@ static struct ctl_table kern_table[] = { | |||
680 | }, | 619 | }, |
681 | #endif | 620 | #endif |
682 | { | 621 | { |
683 | .ctl_name = KERN_S390_USER_DEBUG_LOGGING, | ||
684 | .procname = "userprocess_debug", | 622 | .procname = "userprocess_debug", |
685 | .data = &sysctl_userprocess_debug, | 623 | .data = &sysctl_userprocess_debug, |
686 | .maxlen = sizeof(int), | 624 | .maxlen = sizeof(int), |
@@ -689,18 +627,15 @@ static struct ctl_table kern_table[] = { | |||
689 | }, | 627 | }, |
690 | #endif | 628 | #endif |
691 | { | 629 | { |
692 | .ctl_name = KERN_PIDMAX, | ||
693 | .procname = "pid_max", | 630 | .procname = "pid_max", |
694 | .data = &pid_max, | 631 | .data = &pid_max, |
695 | .maxlen = sizeof (int), | 632 | .maxlen = sizeof (int), |
696 | .mode = 0644, | 633 | .mode = 0644, |
697 | .proc_handler = &proc_dointvec_minmax, | 634 | .proc_handler = &proc_dointvec_minmax, |
698 | .strategy = sysctl_intvec, | ||
699 | .extra1 = &pid_max_min, | 635 | .extra1 = &pid_max_min, |
700 | .extra2 = &pid_max_max, | 636 | .extra2 = &pid_max_max, |
701 | }, | 637 | }, |
702 | { | 638 | { |
703 | .ctl_name = KERN_PANIC_ON_OOPS, | ||
704 | .procname = "panic_on_oops", | 639 | .procname = "panic_on_oops", |
705 | .data = &panic_on_oops, | 640 | .data = &panic_on_oops, |
706 | .maxlen = sizeof(int), | 641 | .maxlen = sizeof(int), |
@@ -709,7 +644,6 @@ static struct ctl_table kern_table[] = { | |||
709 | }, | 644 | }, |
710 | #if defined CONFIG_PRINTK | 645 | #if defined CONFIG_PRINTK |
711 | { | 646 | { |
712 | .ctl_name = KERN_PRINTK, | ||
713 | .procname = "printk", | 647 | .procname = "printk", |
714 | .data = &console_loglevel, | 648 | .data = &console_loglevel, |
715 | .maxlen = 4*sizeof(int), | 649 | .maxlen = 4*sizeof(int), |
@@ -717,16 +651,13 @@ static struct ctl_table kern_table[] = { | |||
717 | .proc_handler = &proc_dointvec, | 651 | .proc_handler = &proc_dointvec, |
718 | }, | 652 | }, |
719 | { | 653 | { |
720 | .ctl_name = KERN_PRINTK_RATELIMIT, | ||
721 | .procname = "printk_ratelimit", | 654 | .procname = "printk_ratelimit", |
722 | .data = &printk_ratelimit_state.interval, | 655 | .data = &printk_ratelimit_state.interval, |
723 | .maxlen = sizeof(int), | 656 | .maxlen = sizeof(int), |
724 | .mode = 0644, | 657 | .mode = 0644, |
725 | .proc_handler = &proc_dointvec_jiffies, | 658 | .proc_handler = &proc_dointvec_jiffies, |
726 | .strategy = &sysctl_jiffies, | ||
727 | }, | 659 | }, |
728 | { | 660 | { |
729 | .ctl_name = KERN_PRINTK_RATELIMIT_BURST, | ||
730 | .procname = "printk_ratelimit_burst", | 661 | .procname = "printk_ratelimit_burst", |
731 | .data = &printk_ratelimit_state.burst, | 662 | .data = &printk_ratelimit_state.burst, |
732 | .maxlen = sizeof(int), | 663 | .maxlen = sizeof(int), |
@@ -734,19 +665,16 @@ static struct ctl_table kern_table[] = { | |||
734 | .proc_handler = &proc_dointvec, | 665 | .proc_handler = &proc_dointvec, |
735 | }, | 666 | }, |
736 | { | 667 | { |
737 | .ctl_name = CTL_UNNUMBERED, | ||
738 | .procname = "printk_delay", | 668 | .procname = "printk_delay", |
739 | .data = &printk_delay_msec, | 669 | .data = &printk_delay_msec, |
740 | .maxlen = sizeof(int), | 670 | .maxlen = sizeof(int), |
741 | .mode = 0644, | 671 | .mode = 0644, |
742 | .proc_handler = &proc_dointvec_minmax, | 672 | .proc_handler = &proc_dointvec_minmax, |
743 | .strategy = &sysctl_intvec, | ||
744 | .extra1 = &zero, | 673 | .extra1 = &zero, |
745 | .extra2 = &ten_thousand, | 674 | .extra2 = &ten_thousand, |
746 | }, | 675 | }, |
747 | #endif | 676 | #endif |
748 | { | 677 | { |
749 | .ctl_name = KERN_NGROUPS_MAX, | ||
750 | .procname = "ngroups_max", | 678 | .procname = "ngroups_max", |
751 | .data = &ngroups_max, | 679 | .data = &ngroups_max, |
752 | .maxlen = sizeof (int), | 680 | .maxlen = sizeof (int), |
@@ -755,7 +683,6 @@ static struct ctl_table kern_table[] = { | |||
755 | }, | 683 | }, |
756 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) | 684 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) |
757 | { | 685 | { |
758 | .ctl_name = KERN_UNKNOWN_NMI_PANIC, | ||
759 | .procname = "unknown_nmi_panic", | 686 | .procname = "unknown_nmi_panic", |
760 | .data = &unknown_nmi_panic, | 687 | .data = &unknown_nmi_panic, |
761 | .maxlen = sizeof (int), | 688 | .maxlen = sizeof (int), |
@@ -772,7 +699,6 @@ static struct ctl_table kern_table[] = { | |||
772 | #endif | 699 | #endif |
773 | #if defined(CONFIG_X86) | 700 | #if defined(CONFIG_X86) |
774 | { | 701 | { |
775 | .ctl_name = KERN_PANIC_ON_NMI, | ||
776 | .procname = "panic_on_unrecovered_nmi", | 702 | .procname = "panic_on_unrecovered_nmi", |
777 | .data = &panic_on_unrecovered_nmi, | 703 | .data = &panic_on_unrecovered_nmi, |
778 | .maxlen = sizeof(int), | 704 | .maxlen = sizeof(int), |
@@ -780,7 +706,6 @@ static struct ctl_table kern_table[] = { | |||
780 | .proc_handler = &proc_dointvec, | 706 | .proc_handler = &proc_dointvec, |
781 | }, | 707 | }, |
782 | { | 708 | { |
783 | .ctl_name = CTL_UNNUMBERED, | ||
784 | .procname = "panic_on_io_nmi", | 709 | .procname = "panic_on_io_nmi", |
785 | .data = &panic_on_io_nmi, | 710 | .data = &panic_on_io_nmi, |
786 | .maxlen = sizeof(int), | 711 | .maxlen = sizeof(int), |
@@ -788,7 +713,6 @@ static struct ctl_table kern_table[] = { | |||
788 | .proc_handler = &proc_dointvec, | 713 | .proc_handler = &proc_dointvec, |
789 | }, | 714 | }, |
790 | { | 715 | { |
791 | .ctl_name = KERN_BOOTLOADER_TYPE, | ||
792 | .procname = "bootloader_type", | 716 | .procname = "bootloader_type", |
793 | .data = &bootloader_type, | 717 | .data = &bootloader_type, |
794 | .maxlen = sizeof (int), | 718 | .maxlen = sizeof (int), |
@@ -796,7 +720,6 @@ static struct ctl_table kern_table[] = { | |||
796 | .proc_handler = &proc_dointvec, | 720 | .proc_handler = &proc_dointvec, |
797 | }, | 721 | }, |
798 | { | 722 | { |
799 | .ctl_name = CTL_UNNUMBERED, | ||
800 | .procname = "bootloader_version", | 723 | .procname = "bootloader_version", |
801 | .data = &bootloader_version, | 724 | .data = &bootloader_version, |
802 | .maxlen = sizeof (int), | 725 | .maxlen = sizeof (int), |
@@ -804,7 +727,6 @@ static struct ctl_table kern_table[] = { | |||
804 | .proc_handler = &proc_dointvec, | 727 | .proc_handler = &proc_dointvec, |
805 | }, | 728 | }, |
806 | { | 729 | { |
807 | .ctl_name = CTL_UNNUMBERED, | ||
808 | .procname = "kstack_depth_to_print", | 730 | .procname = "kstack_depth_to_print", |
809 | .data = &kstack_depth_to_print, | 731 | .data = &kstack_depth_to_print, |
810 | .maxlen = sizeof(int), | 732 | .maxlen = sizeof(int), |
@@ -812,7 +734,6 @@ static struct ctl_table kern_table[] = { | |||
812 | .proc_handler = &proc_dointvec, | 734 | .proc_handler = &proc_dointvec, |
813 | }, | 735 | }, |
814 | { | 736 | { |
815 | .ctl_name = CTL_UNNUMBERED, | ||
816 | .procname = "io_delay_type", | 737 | .procname = "io_delay_type", |
817 | .data = &io_delay_type, | 738 | .data = &io_delay_type, |
818 | .maxlen = sizeof(int), | 739 | .maxlen = sizeof(int), |
@@ -822,7 +743,6 @@ static struct ctl_table kern_table[] = { | |||
822 | #endif | 743 | #endif |
823 | #if defined(CONFIG_MMU) | 744 | #if defined(CONFIG_MMU) |
824 | { | 745 | { |
825 | .ctl_name = KERN_RANDOMIZE, | ||
826 | .procname = "randomize_va_space", | 746 | .procname = "randomize_va_space", |
827 | .data = &randomize_va_space, | 747 | .data = &randomize_va_space, |
828 | .maxlen = sizeof(int), | 748 | .maxlen = sizeof(int), |
@@ -832,7 +752,6 @@ static struct ctl_table kern_table[] = { | |||
832 | #endif | 752 | #endif |
833 | #if defined(CONFIG_S390) && defined(CONFIG_SMP) | 753 | #if defined(CONFIG_S390) && defined(CONFIG_SMP) |
834 | { | 754 | { |
835 | .ctl_name = KERN_SPIN_RETRY, | ||
836 | .procname = "spin_retry", | 755 | .procname = "spin_retry", |
837 | .data = &spin_retry, | 756 | .data = &spin_retry, |
838 | .maxlen = sizeof (int), | 757 | .maxlen = sizeof (int), |
@@ -851,7 +770,6 @@ static struct ctl_table kern_table[] = { | |||
851 | #endif | 770 | #endif |
852 | #ifdef CONFIG_IA64 | 771 | #ifdef CONFIG_IA64 |
853 | { | 772 | { |
854 | .ctl_name = KERN_IA64_UNALIGNED, | ||
855 | .procname = "ignore-unaligned-usertrap", | 773 | .procname = "ignore-unaligned-usertrap", |
856 | .data = &no_unaligned_warning, | 774 | .data = &no_unaligned_warning, |
857 | .maxlen = sizeof (int), | 775 | .maxlen = sizeof (int), |
@@ -859,7 +777,6 @@ static struct ctl_table kern_table[] = { | |||
859 | .proc_handler = &proc_dointvec, | 777 | .proc_handler = &proc_dointvec, |
860 | }, | 778 | }, |
861 | { | 779 | { |
862 | .ctl_name = CTL_UNNUMBERED, | ||
863 | .procname = "unaligned-dump-stack", | 780 | .procname = "unaligned-dump-stack", |
864 | .data = &unaligned_dump_stack, | 781 | .data = &unaligned_dump_stack, |
865 | .maxlen = sizeof (int), | 782 | .maxlen = sizeof (int), |
@@ -869,71 +786,58 @@ static struct ctl_table kern_table[] = { | |||
869 | #endif | 786 | #endif |
870 | #ifdef CONFIG_DETECT_SOFTLOCKUP | 787 | #ifdef CONFIG_DETECT_SOFTLOCKUP |
871 | { | 788 | { |
872 | .ctl_name = CTL_UNNUMBERED, | ||
873 | .procname = "softlockup_panic", | 789 | .procname = "softlockup_panic", |
874 | .data = &softlockup_panic, | 790 | .data = &softlockup_panic, |
875 | .maxlen = sizeof(int), | 791 | .maxlen = sizeof(int), |
876 | .mode = 0644, | 792 | .mode = 0644, |
877 | .proc_handler = &proc_dointvec_minmax, | 793 | .proc_handler = &proc_dointvec_minmax, |
878 | .strategy = &sysctl_intvec, | ||
879 | .extra1 = &zero, | 794 | .extra1 = &zero, |
880 | .extra2 = &one, | 795 | .extra2 = &one, |
881 | }, | 796 | }, |
882 | { | 797 | { |
883 | .ctl_name = CTL_UNNUMBERED, | ||
884 | .procname = "softlockup_thresh", | 798 | .procname = "softlockup_thresh", |
885 | .data = &softlockup_thresh, | 799 | .data = &softlockup_thresh, |
886 | .maxlen = sizeof(int), | 800 | .maxlen = sizeof(int), |
887 | .mode = 0644, | 801 | .mode = 0644, |
888 | .proc_handler = &proc_dosoftlockup_thresh, | 802 | .proc_handler = &proc_dosoftlockup_thresh, |
889 | .strategy = &sysctl_intvec, | ||
890 | .extra1 = &neg_one, | 803 | .extra1 = &neg_one, |
891 | .extra2 = &sixty, | 804 | .extra2 = &sixty, |
892 | }, | 805 | }, |
893 | #endif | 806 | #endif |
894 | #ifdef CONFIG_DETECT_HUNG_TASK | 807 | #ifdef CONFIG_DETECT_HUNG_TASK |
895 | { | 808 | { |
896 | .ctl_name = CTL_UNNUMBERED, | ||
897 | .procname = "hung_task_panic", | 809 | .procname = "hung_task_panic", |
898 | .data = &sysctl_hung_task_panic, | 810 | .data = &sysctl_hung_task_panic, |
899 | .maxlen = sizeof(int), | 811 | .maxlen = sizeof(int), |
900 | .mode = 0644, | 812 | .mode = 0644, |
901 | .proc_handler = &proc_dointvec_minmax, | 813 | .proc_handler = &proc_dointvec_minmax, |
902 | .strategy = &sysctl_intvec, | ||
903 | .extra1 = &zero, | 814 | .extra1 = &zero, |
904 | .extra2 = &one, | 815 | .extra2 = &one, |
905 | }, | 816 | }, |
906 | { | 817 | { |
907 | .ctl_name = CTL_UNNUMBERED, | ||
908 | .procname = "hung_task_check_count", | 818 | .procname = "hung_task_check_count", |
909 | .data = &sysctl_hung_task_check_count, | 819 | .data = &sysctl_hung_task_check_count, |
910 | .maxlen = sizeof(unsigned long), | 820 | .maxlen = sizeof(unsigned long), |
911 | .mode = 0644, | 821 | .mode = 0644, |
912 | .proc_handler = &proc_doulongvec_minmax, | 822 | .proc_handler = &proc_doulongvec_minmax, |
913 | .strategy = &sysctl_intvec, | ||
914 | }, | 823 | }, |
915 | { | 824 | { |
916 | .ctl_name = CTL_UNNUMBERED, | ||
917 | .procname = "hung_task_timeout_secs", | 825 | .procname = "hung_task_timeout_secs", |
918 | .data = &sysctl_hung_task_timeout_secs, | 826 | .data = &sysctl_hung_task_timeout_secs, |
919 | .maxlen = sizeof(unsigned long), | 827 | .maxlen = sizeof(unsigned long), |
920 | .mode = 0644, | 828 | .mode = 0644, |
921 | .proc_handler = &proc_dohung_task_timeout_secs, | 829 | .proc_handler = &proc_dohung_task_timeout_secs, |
922 | .strategy = &sysctl_intvec, | ||
923 | }, | 830 | }, |
924 | { | 831 | { |
925 | .ctl_name = CTL_UNNUMBERED, | ||
926 | .procname = "hung_task_warnings", | 832 | .procname = "hung_task_warnings", |
927 | .data = &sysctl_hung_task_warnings, | 833 | .data = &sysctl_hung_task_warnings, |
928 | .maxlen = sizeof(unsigned long), | 834 | .maxlen = sizeof(unsigned long), |
929 | .mode = 0644, | 835 | .mode = 0644, |
930 | .proc_handler = &proc_doulongvec_minmax, | 836 | .proc_handler = &proc_doulongvec_minmax, |
931 | .strategy = &sysctl_intvec, | ||
932 | }, | 837 | }, |
933 | #endif | 838 | #endif |
934 | #ifdef CONFIG_COMPAT | 839 | #ifdef CONFIG_COMPAT |
935 | { | 840 | { |
936 | .ctl_name = KERN_COMPAT_LOG, | ||
937 | .procname = "compat-log", | 841 | .procname = "compat-log", |
938 | .data = &compat_log, | 842 | .data = &compat_log, |
939 | .maxlen = sizeof (int), | 843 | .maxlen = sizeof (int), |
@@ -943,7 +847,6 @@ static struct ctl_table kern_table[] = { | |||
943 | #endif | 847 | #endif |
944 | #ifdef CONFIG_RT_MUTEXES | 848 | #ifdef CONFIG_RT_MUTEXES |
945 | { | 849 | { |
946 | .ctl_name = KERN_MAX_LOCK_DEPTH, | ||
947 | .procname = "max_lock_depth", | 850 | .procname = "max_lock_depth", |
948 | .data = &max_lock_depth, | 851 | .data = &max_lock_depth, |
949 | .maxlen = sizeof(int), | 852 | .maxlen = sizeof(int), |
@@ -952,17 +855,14 @@ static struct ctl_table kern_table[] = { | |||
952 | }, | 855 | }, |
953 | #endif | 856 | #endif |
954 | { | 857 | { |
955 | .ctl_name = CTL_UNNUMBERED, | ||
956 | .procname = "poweroff_cmd", | 858 | .procname = "poweroff_cmd", |
957 | .data = &poweroff_cmd, | 859 | .data = &poweroff_cmd, |
958 | .maxlen = POWEROFF_CMD_PATH_LEN, | 860 | .maxlen = POWEROFF_CMD_PATH_LEN, |
959 | .mode = 0644, | 861 | .mode = 0644, |
960 | .proc_handler = &proc_dostring, | 862 | .proc_handler = &proc_dostring, |
961 | .strategy = &sysctl_string, | ||
962 | }, | 863 | }, |
963 | #ifdef CONFIG_KEYS | 864 | #ifdef CONFIG_KEYS |
964 | { | 865 | { |
965 | .ctl_name = CTL_UNNUMBERED, | ||
966 | .procname = "keys", | 866 | .procname = "keys", |
967 | .mode = 0555, | 867 | .mode = 0555, |
968 | .child = key_sysctls, | 868 | .child = key_sysctls, |
@@ -970,7 +870,6 @@ static struct ctl_table kern_table[] = { | |||
970 | #endif | 870 | #endif |
971 | #ifdef CONFIG_RCU_TORTURE_TEST | 871 | #ifdef CONFIG_RCU_TORTURE_TEST |
972 | { | 872 | { |
973 | .ctl_name = CTL_UNNUMBERED, | ||
974 | .procname = "rcutorture_runnable", | 873 | .procname = "rcutorture_runnable", |
975 | .data = &rcutorture_runnable, | 874 | .data = &rcutorture_runnable, |
976 | .maxlen = sizeof(int), | 875 | .maxlen = sizeof(int), |
@@ -980,7 +879,6 @@ static struct ctl_table kern_table[] = { | |||
980 | #endif | 879 | #endif |
981 | #ifdef CONFIG_SLOW_WORK | 880 | #ifdef CONFIG_SLOW_WORK |
982 | { | 881 | { |
983 | .ctl_name = CTL_UNNUMBERED, | ||
984 | .procname = "slow-work", | 882 | .procname = "slow-work", |
985 | .mode = 0555, | 883 | .mode = 0555, |
986 | .child = slow_work_sysctls, | 884 | .child = slow_work_sysctls, |
@@ -988,7 +886,6 @@ static struct ctl_table kern_table[] = { | |||
988 | #endif | 886 | #endif |
989 | #ifdef CONFIG_PERF_EVENTS | 887 | #ifdef CONFIG_PERF_EVENTS |
990 | { | 888 | { |
991 | .ctl_name = CTL_UNNUMBERED, | ||
992 | .procname = "perf_event_paranoid", | 889 | .procname = "perf_event_paranoid", |
993 | .data = &sysctl_perf_event_paranoid, | 890 | .data = &sysctl_perf_event_paranoid, |
994 | .maxlen = sizeof(sysctl_perf_event_paranoid), | 891 | .maxlen = sizeof(sysctl_perf_event_paranoid), |
@@ -996,7 +893,6 @@ static struct ctl_table kern_table[] = { | |||
996 | .proc_handler = &proc_dointvec, | 893 | .proc_handler = &proc_dointvec, |
997 | }, | 894 | }, |
998 | { | 895 | { |
999 | .ctl_name = CTL_UNNUMBERED, | ||
1000 | .procname = "perf_event_mlock_kb", | 896 | .procname = "perf_event_mlock_kb", |
1001 | .data = &sysctl_perf_event_mlock, | 897 | .data = &sysctl_perf_event_mlock, |
1002 | .maxlen = sizeof(sysctl_perf_event_mlock), | 898 | .maxlen = sizeof(sysctl_perf_event_mlock), |
@@ -1004,7 +900,6 @@ static struct ctl_table kern_table[] = { | |||
1004 | .proc_handler = &proc_dointvec, | 900 | .proc_handler = &proc_dointvec, |
1005 | }, | 901 | }, |
1006 | { | 902 | { |
1007 | .ctl_name = CTL_UNNUMBERED, | ||
1008 | .procname = "perf_event_max_sample_rate", | 903 | .procname = "perf_event_max_sample_rate", |
1009 | .data = &sysctl_perf_event_sample_rate, | 904 | .data = &sysctl_perf_event_sample_rate, |
1010 | .maxlen = sizeof(sysctl_perf_event_sample_rate), | 905 | .maxlen = sizeof(sysctl_perf_event_sample_rate), |
@@ -1014,7 +909,6 @@ static struct ctl_table kern_table[] = { | |||
1014 | #endif | 909 | #endif |
1015 | #ifdef CONFIG_KMEMCHECK | 910 | #ifdef CONFIG_KMEMCHECK |
1016 | { | 911 | { |
1017 | .ctl_name = CTL_UNNUMBERED, | ||
1018 | .procname = "kmemcheck", | 912 | .procname = "kmemcheck", |
1019 | .data = &kmemcheck_enabled, | 913 | .data = &kmemcheck_enabled, |
1020 | .maxlen = sizeof(int), | 914 | .maxlen = sizeof(int), |
@@ -1024,7 +918,6 @@ static struct ctl_table kern_table[] = { | |||
1024 | #endif | 918 | #endif |
1025 | #ifdef CONFIG_BLOCK | 919 | #ifdef CONFIG_BLOCK |
1026 | { | 920 | { |
1027 | .ctl_name = CTL_UNNUMBERED, | ||
1028 | .procname = "blk_iopoll", | 921 | .procname = "blk_iopoll", |
1029 | .data = &blk_iopoll_enabled, | 922 | .data = &blk_iopoll_enabled, |
1030 | .maxlen = sizeof(int), | 923 | .maxlen = sizeof(int), |
@@ -1036,12 +929,11 @@ static struct ctl_table kern_table[] = { | |||
1036 | * NOTE: do not add new entries to this table unless you have read | 929 | * NOTE: do not add new entries to this table unless you have read |
1037 | * Documentation/sysctl/ctl_unnumbered.txt | 930 | * Documentation/sysctl/ctl_unnumbered.txt |
1038 | */ | 931 | */ |
1039 | { .ctl_name = 0 } | 932 | { } |
1040 | }; | 933 | }; |
1041 | 934 | ||
1042 | static struct ctl_table vm_table[] = { | 935 | static struct ctl_table vm_table[] = { |
1043 | { | 936 | { |
1044 | .ctl_name = VM_OVERCOMMIT_MEMORY, | ||
1045 | .procname = "overcommit_memory", | 937 | .procname = "overcommit_memory", |
1046 | .data = &sysctl_overcommit_memory, | 938 | .data = &sysctl_overcommit_memory, |
1047 | .maxlen = sizeof(sysctl_overcommit_memory), | 939 | .maxlen = sizeof(sysctl_overcommit_memory), |
@@ -1049,7 +941,6 @@ static struct ctl_table vm_table[] = { | |||
1049 | .proc_handler = &proc_dointvec, | 941 | .proc_handler = &proc_dointvec, |
1050 | }, | 942 | }, |
1051 | { | 943 | { |
1052 | .ctl_name = VM_PANIC_ON_OOM, | ||
1053 | .procname = "panic_on_oom", | 944 | .procname = "panic_on_oom", |
1054 | .data = &sysctl_panic_on_oom, | 945 | .data = &sysctl_panic_on_oom, |
1055 | .maxlen = sizeof(sysctl_panic_on_oom), | 946 | .maxlen = sizeof(sysctl_panic_on_oom), |
@@ -1057,7 +948,6 @@ static struct ctl_table vm_table[] = { | |||
1057 | .proc_handler = &proc_dointvec, | 948 | .proc_handler = &proc_dointvec, |
1058 | }, | 949 | }, |
1059 | { | 950 | { |
1060 | .ctl_name = CTL_UNNUMBERED, | ||
1061 | .procname = "oom_kill_allocating_task", | 951 | .procname = "oom_kill_allocating_task", |
1062 | .data = &sysctl_oom_kill_allocating_task, | 952 | .data = &sysctl_oom_kill_allocating_task, |
1063 | .maxlen = sizeof(sysctl_oom_kill_allocating_task), | 953 | .maxlen = sizeof(sysctl_oom_kill_allocating_task), |
@@ -1065,7 +955,6 @@ static struct ctl_table vm_table[] = { | |||
1065 | .proc_handler = &proc_dointvec, | 955 | .proc_handler = &proc_dointvec, |
1066 | }, | 956 | }, |
1067 | { | 957 | { |
1068 | .ctl_name = CTL_UNNUMBERED, | ||
1069 | .procname = "oom_dump_tasks", | 958 | .procname = "oom_dump_tasks", |
1070 | .data = &sysctl_oom_dump_tasks, | 959 | .data = &sysctl_oom_dump_tasks, |
1071 | .maxlen = sizeof(sysctl_oom_dump_tasks), | 960 | .maxlen = sizeof(sysctl_oom_dump_tasks), |
@@ -1073,7 +962,6 @@ static struct ctl_table vm_table[] = { | |||
1073 | .proc_handler = &proc_dointvec, | 962 | .proc_handler = &proc_dointvec, |
1074 | }, | 963 | }, |
1075 | { | 964 | { |
1076 | .ctl_name = VM_OVERCOMMIT_RATIO, | ||
1077 | .procname = "overcommit_ratio", | 965 | .procname = "overcommit_ratio", |
1078 | .data = &sysctl_overcommit_ratio, | 966 | .data = &sysctl_overcommit_ratio, |
1079 | .maxlen = sizeof(sysctl_overcommit_ratio), | 967 | .maxlen = sizeof(sysctl_overcommit_ratio), |
@@ -1081,7 +969,6 @@ static struct ctl_table vm_table[] = { | |||
1081 | .proc_handler = &proc_dointvec, | 969 | .proc_handler = &proc_dointvec, |
1082 | }, | 970 | }, |
1083 | { | 971 | { |
1084 | .ctl_name = VM_PAGE_CLUSTER, | ||
1085 | .procname = "page-cluster", | 972 | .procname = "page-cluster", |
1086 | .data = &page_cluster, | 973 | .data = &page_cluster, |
1087 | .maxlen = sizeof(int), | 974 | .maxlen = sizeof(int), |
@@ -1089,45 +976,37 @@ static struct ctl_table vm_table[] = { | |||
1089 | .proc_handler = &proc_dointvec, | 976 | .proc_handler = &proc_dointvec, |
1090 | }, | 977 | }, |
1091 | { | 978 | { |
1092 | .ctl_name = VM_DIRTY_BACKGROUND, | ||
1093 | .procname = "dirty_background_ratio", | 979 | .procname = "dirty_background_ratio", |
1094 | .data = &dirty_background_ratio, | 980 | .data = &dirty_background_ratio, |
1095 | .maxlen = sizeof(dirty_background_ratio), | 981 | .maxlen = sizeof(dirty_background_ratio), |
1096 | .mode = 0644, | 982 | .mode = 0644, |
1097 | .proc_handler = &dirty_background_ratio_handler, | 983 | .proc_handler = &dirty_background_ratio_handler, |
1098 | .strategy = &sysctl_intvec, | ||
1099 | .extra1 = &zero, | 984 | .extra1 = &zero, |
1100 | .extra2 = &one_hundred, | 985 | .extra2 = &one_hundred, |
1101 | }, | 986 | }, |
1102 | { | 987 | { |
1103 | .ctl_name = CTL_UNNUMBERED, | ||
1104 | .procname = "dirty_background_bytes", | 988 | .procname = "dirty_background_bytes", |
1105 | .data = &dirty_background_bytes, | 989 | .data = &dirty_background_bytes, |
1106 | .maxlen = sizeof(dirty_background_bytes), | 990 | .maxlen = sizeof(dirty_background_bytes), |
1107 | .mode = 0644, | 991 | .mode = 0644, |
1108 | .proc_handler = &dirty_background_bytes_handler, | 992 | .proc_handler = &dirty_background_bytes_handler, |
1109 | .strategy = &sysctl_intvec, | ||
1110 | .extra1 = &one_ul, | 993 | .extra1 = &one_ul, |
1111 | }, | 994 | }, |
1112 | { | 995 | { |
1113 | .ctl_name = VM_DIRTY_RATIO, | ||
1114 | .procname = "dirty_ratio", | 996 | .procname = "dirty_ratio", |
1115 | .data = &vm_dirty_ratio, | 997 | .data = &vm_dirty_ratio, |
1116 | .maxlen = sizeof(vm_dirty_ratio), | 998 | .maxlen = sizeof(vm_dirty_ratio), |
1117 | .mode = 0644, | 999 | .mode = 0644, |
1118 | .proc_handler = &dirty_ratio_handler, | 1000 | .proc_handler = &dirty_ratio_handler, |
1119 | .strategy = &sysctl_intvec, | ||
1120 | .extra1 = &zero, | 1001 | .extra1 = &zero, |
1121 | .extra2 = &one_hundred, | 1002 | .extra2 = &one_hundred, |
1122 | }, | 1003 | }, |
1123 | { | 1004 | { |
1124 | .ctl_name = CTL_UNNUMBERED, | ||
1125 | .procname = "dirty_bytes", | 1005 | .procname = "dirty_bytes", |
1126 | .data = &vm_dirty_bytes, | 1006 | .data = &vm_dirty_bytes, |
1127 | .maxlen = sizeof(vm_dirty_bytes), | 1007 | .maxlen = sizeof(vm_dirty_bytes), |
1128 | .mode = 0644, | 1008 | .mode = 0644, |
1129 | .proc_handler = &dirty_bytes_handler, | 1009 | .proc_handler = &dirty_bytes_handler, |
1130 | .strategy = &sysctl_intvec, | ||
1131 | .extra1 = &dirty_bytes_min, | 1010 | .extra1 = &dirty_bytes_min, |
1132 | }, | 1011 | }, |
1133 | { | 1012 | { |
@@ -1145,7 +1024,6 @@ static struct ctl_table vm_table[] = { | |||
1145 | .proc_handler = &proc_dointvec, | 1024 | .proc_handler = &proc_dointvec, |
1146 | }, | 1025 | }, |
1147 | { | 1026 | { |
1148 | .ctl_name = VM_NR_PDFLUSH_THREADS, | ||
1149 | .procname = "nr_pdflush_threads", | 1027 | .procname = "nr_pdflush_threads", |
1150 | .data = &nr_pdflush_threads, | 1028 | .data = &nr_pdflush_threads, |
1151 | .maxlen = sizeof nr_pdflush_threads, | 1029 | .maxlen = sizeof nr_pdflush_threads, |
@@ -1153,13 +1031,11 @@ static struct ctl_table vm_table[] = { | |||
1153 | .proc_handler = &proc_dointvec, | 1031 | .proc_handler = &proc_dointvec, |
1154 | }, | 1032 | }, |
1155 | { | 1033 | { |
1156 | .ctl_name = VM_SWAPPINESS, | ||
1157 | .procname = "swappiness", | 1034 | .procname = "swappiness", |
1158 | .data = &vm_swappiness, | 1035 | .data = &vm_swappiness, |
1159 | .maxlen = sizeof(vm_swappiness), | 1036 | .maxlen = sizeof(vm_swappiness), |
1160 | .mode = 0644, | 1037 | .mode = 0644, |
1161 | .proc_handler = &proc_dointvec_minmax, | 1038 | .proc_handler = &proc_dointvec_minmax, |
1162 | .strategy = &sysctl_intvec, | ||
1163 | .extra1 = &zero, | 1039 | .extra1 = &zero, |
1164 | .extra2 = &one_hundred, | 1040 | .extra2 = &one_hundred, |
1165 | }, | 1041 | }, |
@@ -1174,7 +1050,6 @@ static struct ctl_table vm_table[] = { | |||
1174 | .extra2 = (void *)&hugetlb_infinity, | 1050 | .extra2 = (void *)&hugetlb_infinity, |
1175 | }, | 1051 | }, |
1176 | { | 1052 | { |
1177 | .ctl_name = VM_HUGETLB_GROUP, | ||
1178 | .procname = "hugetlb_shm_group", | 1053 | .procname = "hugetlb_shm_group", |
1179 | .data = &sysctl_hugetlb_shm_group, | 1054 | .data = &sysctl_hugetlb_shm_group, |
1180 | .maxlen = sizeof(gid_t), | 1055 | .maxlen = sizeof(gid_t), |
@@ -1182,7 +1057,6 @@ static struct ctl_table vm_table[] = { | |||
1182 | .proc_handler = &proc_dointvec, | 1057 | .proc_handler = &proc_dointvec, |
1183 | }, | 1058 | }, |
1184 | { | 1059 | { |
1185 | .ctl_name = CTL_UNNUMBERED, | ||
1186 | .procname = "hugepages_treat_as_movable", | 1060 | .procname = "hugepages_treat_as_movable", |
1187 | .data = &hugepages_treat_as_movable, | 1061 | .data = &hugepages_treat_as_movable, |
1188 | .maxlen = sizeof(int), | 1062 | .maxlen = sizeof(int), |
@@ -1190,7 +1064,6 @@ static struct ctl_table vm_table[] = { | |||
1190 | .proc_handler = &hugetlb_treat_movable_handler, | 1064 | .proc_handler = &hugetlb_treat_movable_handler, |
1191 | }, | 1065 | }, |
1192 | { | 1066 | { |
1193 | .ctl_name = CTL_UNNUMBERED, | ||
1194 | .procname = "nr_overcommit_hugepages", | 1067 | .procname = "nr_overcommit_hugepages", |
1195 | .data = NULL, | 1068 | .data = NULL, |
1196 | .maxlen = sizeof(unsigned long), | 1069 | .maxlen = sizeof(unsigned long), |
@@ -1201,46 +1074,37 @@ static struct ctl_table vm_table[] = { | |||
1201 | }, | 1074 | }, |
1202 | #endif | 1075 | #endif |
1203 | { | 1076 | { |
1204 | .ctl_name = VM_LOWMEM_RESERVE_RATIO, | ||
1205 | .procname = "lowmem_reserve_ratio", | 1077 | .procname = "lowmem_reserve_ratio", |
1206 | .data = &sysctl_lowmem_reserve_ratio, | 1078 | .data = &sysctl_lowmem_reserve_ratio, |
1207 | .maxlen = sizeof(sysctl_lowmem_reserve_ratio), | 1079 | .maxlen = sizeof(sysctl_lowmem_reserve_ratio), |
1208 | .mode = 0644, | 1080 | .mode = 0644, |
1209 | .proc_handler = &lowmem_reserve_ratio_sysctl_handler, | 1081 | .proc_handler = &lowmem_reserve_ratio_sysctl_handler, |
1210 | .strategy = &sysctl_intvec, | ||
1211 | }, | 1082 | }, |
1212 | { | 1083 | { |
1213 | .ctl_name = VM_DROP_PAGECACHE, | ||
1214 | .procname = "drop_caches", | 1084 | .procname = "drop_caches", |
1215 | .data = &sysctl_drop_caches, | 1085 | .data = &sysctl_drop_caches, |
1216 | .maxlen = sizeof(int), | 1086 | .maxlen = sizeof(int), |
1217 | .mode = 0644, | 1087 | .mode = 0644, |
1218 | .proc_handler = drop_caches_sysctl_handler, | 1088 | .proc_handler = drop_caches_sysctl_handler, |
1219 | .strategy = &sysctl_intvec, | ||
1220 | }, | 1089 | }, |
1221 | { | 1090 | { |
1222 | .ctl_name = VM_MIN_FREE_KBYTES, | ||
1223 | .procname = "min_free_kbytes", | 1091 | .procname = "min_free_kbytes", |
1224 | .data = &min_free_kbytes, | 1092 | .data = &min_free_kbytes, |
1225 | .maxlen = sizeof(min_free_kbytes), | 1093 | .maxlen = sizeof(min_free_kbytes), |
1226 | .mode = 0644, | 1094 | .mode = 0644, |
1227 | .proc_handler = &min_free_kbytes_sysctl_handler, | 1095 | .proc_handler = &min_free_kbytes_sysctl_handler, |
1228 | .strategy = &sysctl_intvec, | ||
1229 | .extra1 = &zero, | 1096 | .extra1 = &zero, |
1230 | }, | 1097 | }, |
1231 | { | 1098 | { |
1232 | .ctl_name = VM_PERCPU_PAGELIST_FRACTION, | ||
1233 | .procname = "percpu_pagelist_fraction", | 1099 | .procname = "percpu_pagelist_fraction", |
1234 | .data = &percpu_pagelist_fraction, | 1100 | .data = &percpu_pagelist_fraction, |
1235 | .maxlen = sizeof(percpu_pagelist_fraction), | 1101 | .maxlen = sizeof(percpu_pagelist_fraction), |
1236 | .mode = 0644, | 1102 | .mode = 0644, |
1237 | .proc_handler = &percpu_pagelist_fraction_sysctl_handler, | 1103 | .proc_handler = &percpu_pagelist_fraction_sysctl_handler, |
1238 | .strategy = &sysctl_intvec, | ||
1239 | .extra1 = &min_percpu_pagelist_fract, | 1104 | .extra1 = &min_percpu_pagelist_fract, |
1240 | }, | 1105 | }, |
1241 | #ifdef CONFIG_MMU | 1106 | #ifdef CONFIG_MMU |
1242 | { | 1107 | { |
1243 | .ctl_name = VM_MAX_MAP_COUNT, | ||
1244 | .procname = "max_map_count", | 1108 | .procname = "max_map_count", |
1245 | .data = &sysctl_max_map_count, | 1109 | .data = &sysctl_max_map_count, |
1246 | .maxlen = sizeof(sysctl_max_map_count), | 1110 | .maxlen = sizeof(sysctl_max_map_count), |
@@ -1249,104 +1113,85 @@ static struct ctl_table vm_table[] = { | |||
1249 | }, | 1113 | }, |
1250 | #else | 1114 | #else |
1251 | { | 1115 | { |
1252 | .ctl_name = CTL_UNNUMBERED, | ||
1253 | .procname = "nr_trim_pages", | 1116 | .procname = "nr_trim_pages", |
1254 | .data = &sysctl_nr_trim_pages, | 1117 | .data = &sysctl_nr_trim_pages, |
1255 | .maxlen = sizeof(sysctl_nr_trim_pages), | 1118 | .maxlen = sizeof(sysctl_nr_trim_pages), |
1256 | .mode = 0644, | 1119 | .mode = 0644, |
1257 | .proc_handler = &proc_dointvec_minmax, | 1120 | .proc_handler = &proc_dointvec_minmax, |
1258 | .strategy = &sysctl_intvec, | ||
1259 | .extra1 = &zero, | 1121 | .extra1 = &zero, |
1260 | }, | 1122 | }, |
1261 | #endif | 1123 | #endif |
1262 | { | 1124 | { |
1263 | .ctl_name = VM_LAPTOP_MODE, | ||
1264 | .procname = "laptop_mode", | 1125 | .procname = "laptop_mode", |
1265 | .data = &laptop_mode, | 1126 | .data = &laptop_mode, |
1266 | .maxlen = sizeof(laptop_mode), | 1127 | .maxlen = sizeof(laptop_mode), |
1267 | .mode = 0644, | 1128 | .mode = 0644, |
1268 | .proc_handler = &proc_dointvec_jiffies, | 1129 | .proc_handler = &proc_dointvec_jiffies, |
1269 | .strategy = &sysctl_jiffies, | ||
1270 | }, | 1130 | }, |
1271 | { | 1131 | { |
1272 | .ctl_name = VM_BLOCK_DUMP, | ||
1273 | .procname = "block_dump", | 1132 | .procname = "block_dump", |
1274 | .data = &block_dump, | 1133 | .data = &block_dump, |
1275 | .maxlen = sizeof(block_dump), | 1134 | .maxlen = sizeof(block_dump), |
1276 | .mode = 0644, | 1135 | .mode = 0644, |
1277 | .proc_handler = &proc_dointvec, | 1136 | .proc_handler = &proc_dointvec, |
1278 | .strategy = &sysctl_intvec, | ||
1279 | .extra1 = &zero, | 1137 | .extra1 = &zero, |
1280 | }, | 1138 | }, |
1281 | { | 1139 | { |
1282 | .ctl_name = VM_VFS_CACHE_PRESSURE, | ||
1283 | .procname = "vfs_cache_pressure", | 1140 | .procname = "vfs_cache_pressure", |
1284 | .data = &sysctl_vfs_cache_pressure, | 1141 | .data = &sysctl_vfs_cache_pressure, |
1285 | .maxlen = sizeof(sysctl_vfs_cache_pressure), | 1142 | .maxlen = sizeof(sysctl_vfs_cache_pressure), |
1286 | .mode = 0644, | 1143 | .mode = 0644, |
1287 | .proc_handler = &proc_dointvec, | 1144 | .proc_handler = &proc_dointvec, |
1288 | .strategy = &sysctl_intvec, | ||
1289 | .extra1 = &zero, | 1145 | .extra1 = &zero, |
1290 | }, | 1146 | }, |
1291 | #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT | 1147 | #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT |
1292 | { | 1148 | { |
1293 | .ctl_name = VM_LEGACY_VA_LAYOUT, | ||
1294 | .procname = "legacy_va_layout", | 1149 | .procname = "legacy_va_layout", |
1295 | .data = &sysctl_legacy_va_layout, | 1150 | .data = &sysctl_legacy_va_layout, |
1296 | .maxlen = sizeof(sysctl_legacy_va_layout), | 1151 | .maxlen = sizeof(sysctl_legacy_va_layout), |
1297 | .mode = 0644, | 1152 | .mode = 0644, |
1298 | .proc_handler = &proc_dointvec, | 1153 | .proc_handler = &proc_dointvec, |
1299 | .strategy = &sysctl_intvec, | ||
1300 | .extra1 = &zero, | 1154 | .extra1 = &zero, |
1301 | }, | 1155 | }, |
1302 | #endif | 1156 | #endif |
1303 | #ifdef CONFIG_NUMA | 1157 | #ifdef CONFIG_NUMA |
1304 | { | 1158 | { |
1305 | .ctl_name = VM_ZONE_RECLAIM_MODE, | ||
1306 | .procname = "zone_reclaim_mode", | 1159 | .procname = "zone_reclaim_mode", |
1307 | .data = &zone_reclaim_mode, | 1160 | .data = &zone_reclaim_mode, |
1308 | .maxlen = sizeof(zone_reclaim_mode), | 1161 | .maxlen = sizeof(zone_reclaim_mode), |
1309 | .mode = 0644, | 1162 | .mode = 0644, |
1310 | .proc_handler = &proc_dointvec, | 1163 | .proc_handler = &proc_dointvec, |
1311 | .strategy = &sysctl_intvec, | ||
1312 | .extra1 = &zero, | 1164 | .extra1 = &zero, |
1313 | }, | 1165 | }, |
1314 | { | 1166 | { |
1315 | .ctl_name = VM_MIN_UNMAPPED, | ||
1316 | .procname = "min_unmapped_ratio", | 1167 | .procname = "min_unmapped_ratio", |
1317 | .data = &sysctl_min_unmapped_ratio, | 1168 | .data = &sysctl_min_unmapped_ratio, |
1318 | .maxlen = sizeof(sysctl_min_unmapped_ratio), | 1169 | .maxlen = sizeof(sysctl_min_unmapped_ratio), |
1319 | .mode = 0644, | 1170 | .mode = 0644, |
1320 | .proc_handler = &sysctl_min_unmapped_ratio_sysctl_handler, | 1171 | .proc_handler = &sysctl_min_unmapped_ratio_sysctl_handler, |
1321 | .strategy = &sysctl_intvec, | ||
1322 | .extra1 = &zero, | 1172 | .extra1 = &zero, |
1323 | .extra2 = &one_hundred, | 1173 | .extra2 = &one_hundred, |
1324 | }, | 1174 | }, |
1325 | { | 1175 | { |
1326 | .ctl_name = VM_MIN_SLAB, | ||
1327 | .procname = "min_slab_ratio", | 1176 | .procname = "min_slab_ratio", |
1328 | .data = &sysctl_min_slab_ratio, | 1177 | .data = &sysctl_min_slab_ratio, |
1329 | .maxlen = sizeof(sysctl_min_slab_ratio), | 1178 | .maxlen = sizeof(sysctl_min_slab_ratio), |
1330 | .mode = 0644, | 1179 | .mode = 0644, |
1331 | .proc_handler = &sysctl_min_slab_ratio_sysctl_handler, | 1180 | .proc_handler = &sysctl_min_slab_ratio_sysctl_handler, |
1332 | .strategy = &sysctl_intvec, | ||
1333 | .extra1 = &zero, | 1181 | .extra1 = &zero, |
1334 | .extra2 = &one_hundred, | 1182 | .extra2 = &one_hundred, |
1335 | }, | 1183 | }, |
1336 | #endif | 1184 | #endif |
1337 | #ifdef CONFIG_SMP | 1185 | #ifdef CONFIG_SMP |
1338 | { | 1186 | { |
1339 | .ctl_name = CTL_UNNUMBERED, | ||
1340 | .procname = "stat_interval", | 1187 | .procname = "stat_interval", |
1341 | .data = &sysctl_stat_interval, | 1188 | .data = &sysctl_stat_interval, |
1342 | .maxlen = sizeof(sysctl_stat_interval), | 1189 | .maxlen = sizeof(sysctl_stat_interval), |
1343 | .mode = 0644, | 1190 | .mode = 0644, |
1344 | .proc_handler = &proc_dointvec_jiffies, | 1191 | .proc_handler = &proc_dointvec_jiffies, |
1345 | .strategy = &sysctl_jiffies, | ||
1346 | }, | 1192 | }, |
1347 | #endif | 1193 | #endif |
1348 | { | 1194 | { |
1349 | .ctl_name = CTL_UNNUMBERED, | ||
1350 | .procname = "mmap_min_addr", | 1195 | .procname = "mmap_min_addr", |
1351 | .data = &dac_mmap_min_addr, | 1196 | .data = &dac_mmap_min_addr, |
1352 | .maxlen = sizeof(unsigned long), | 1197 | .maxlen = sizeof(unsigned long), |
@@ -1355,43 +1200,36 @@ static struct ctl_table vm_table[] = { | |||
1355 | }, | 1200 | }, |
1356 | #ifdef CONFIG_NUMA | 1201 | #ifdef CONFIG_NUMA |
1357 | { | 1202 | { |
1358 | .ctl_name = CTL_UNNUMBERED, | ||
1359 | .procname = "numa_zonelist_order", | 1203 | .procname = "numa_zonelist_order", |
1360 | .data = &numa_zonelist_order, | 1204 | .data = &numa_zonelist_order, |
1361 | .maxlen = NUMA_ZONELIST_ORDER_LEN, | 1205 | .maxlen = NUMA_ZONELIST_ORDER_LEN, |
1362 | .mode = 0644, | 1206 | .mode = 0644, |
1363 | .proc_handler = &numa_zonelist_order_handler, | 1207 | .proc_handler = &numa_zonelist_order_handler, |
1364 | .strategy = &sysctl_string, | ||
1365 | }, | 1208 | }, |
1366 | #endif | 1209 | #endif |
1367 | #if (defined(CONFIG_X86_32) && !defined(CONFIG_UML))|| \ | 1210 | #if (defined(CONFIG_X86_32) && !defined(CONFIG_UML))|| \ |
1368 | (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL)) | 1211 | (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL)) |
1369 | { | 1212 | { |
1370 | .ctl_name = VM_VDSO_ENABLED, | ||
1371 | .procname = "vdso_enabled", | 1213 | .procname = "vdso_enabled", |
1372 | .data = &vdso_enabled, | 1214 | .data = &vdso_enabled, |
1373 | .maxlen = sizeof(vdso_enabled), | 1215 | .maxlen = sizeof(vdso_enabled), |
1374 | .mode = 0644, | 1216 | .mode = 0644, |
1375 | .proc_handler = &proc_dointvec, | 1217 | .proc_handler = &proc_dointvec, |
1376 | .strategy = &sysctl_intvec, | ||
1377 | .extra1 = &zero, | 1218 | .extra1 = &zero, |
1378 | }, | 1219 | }, |
1379 | #endif | 1220 | #endif |
1380 | #ifdef CONFIG_HIGHMEM | 1221 | #ifdef CONFIG_HIGHMEM |
1381 | { | 1222 | { |
1382 | .ctl_name = CTL_UNNUMBERED, | ||
1383 | .procname = "highmem_is_dirtyable", | 1223 | .procname = "highmem_is_dirtyable", |
1384 | .data = &vm_highmem_is_dirtyable, | 1224 | .data = &vm_highmem_is_dirtyable, |
1385 | .maxlen = sizeof(vm_highmem_is_dirtyable), | 1225 | .maxlen = sizeof(vm_highmem_is_dirtyable), |
1386 | .mode = 0644, | 1226 | .mode = 0644, |
1387 | .proc_handler = &proc_dointvec_minmax, | 1227 | .proc_handler = &proc_dointvec_minmax, |
1388 | .strategy = &sysctl_intvec, | ||
1389 | .extra1 = &zero, | 1228 | .extra1 = &zero, |
1390 | .extra2 = &one, | 1229 | .extra2 = &one, |
1391 | }, | 1230 | }, |
1392 | #endif | 1231 | #endif |
1393 | { | 1232 | { |
1394 | .ctl_name = CTL_UNNUMBERED, | ||
1395 | .procname = "scan_unevictable_pages", | 1233 | .procname = "scan_unevictable_pages", |
1396 | .data = &scan_unevictable_pages, | 1234 | .data = &scan_unevictable_pages, |
1397 | .maxlen = sizeof(scan_unevictable_pages), | 1235 | .maxlen = sizeof(scan_unevictable_pages), |
@@ -1400,24 +1238,20 @@ static struct ctl_table vm_table[] = { | |||
1400 | }, | 1238 | }, |
1401 | #ifdef CONFIG_MEMORY_FAILURE | 1239 | #ifdef CONFIG_MEMORY_FAILURE |
1402 | { | 1240 | { |
1403 | .ctl_name = CTL_UNNUMBERED, | ||
1404 | .procname = "memory_failure_early_kill", | 1241 | .procname = "memory_failure_early_kill", |
1405 | .data = &sysctl_memory_failure_early_kill, | 1242 | .data = &sysctl_memory_failure_early_kill, |
1406 | .maxlen = sizeof(sysctl_memory_failure_early_kill), | 1243 | .maxlen = sizeof(sysctl_memory_failure_early_kill), |
1407 | .mode = 0644, | 1244 | .mode = 0644, |
1408 | .proc_handler = &proc_dointvec_minmax, | 1245 | .proc_handler = &proc_dointvec_minmax, |
1409 | .strategy = &sysctl_intvec, | ||
1410 | .extra1 = &zero, | 1246 | .extra1 = &zero, |
1411 | .extra2 = &one, | 1247 | .extra2 = &one, |
1412 | }, | 1248 | }, |
1413 | { | 1249 | { |
1414 | .ctl_name = CTL_UNNUMBERED, | ||
1415 | .procname = "memory_failure_recovery", | 1250 | .procname = "memory_failure_recovery", |
1416 | .data = &sysctl_memory_failure_recovery, | 1251 | .data = &sysctl_memory_failure_recovery, |
1417 | .maxlen = sizeof(sysctl_memory_failure_recovery), | 1252 | .maxlen = sizeof(sysctl_memory_failure_recovery), |
1418 | .mode = 0644, | 1253 | .mode = 0644, |
1419 | .proc_handler = &proc_dointvec_minmax, | 1254 | .proc_handler = &proc_dointvec_minmax, |
1420 | .strategy = &sysctl_intvec, | ||
1421 | .extra1 = &zero, | 1255 | .extra1 = &zero, |
1422 | .extra2 = &one, | 1256 | .extra2 = &one, |
1423 | }, | 1257 | }, |
@@ -1427,18 +1261,17 @@ static struct ctl_table vm_table[] = { | |||
1427 | * NOTE: do not add new entries to this table unless you have read | 1261 | * NOTE: do not add new entries to this table unless you have read |
1428 | * Documentation/sysctl/ctl_unnumbered.txt | 1262 | * Documentation/sysctl/ctl_unnumbered.txt |
1429 | */ | 1263 | */ |
1430 | { .ctl_name = 0 } | 1264 | { } |
1431 | }; | 1265 | }; |
1432 | 1266 | ||
1433 | #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) | 1267 | #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) |
1434 | static struct ctl_table binfmt_misc_table[] = { | 1268 | static struct ctl_table binfmt_misc_table[] = { |
1435 | { .ctl_name = 0 } | 1269 | { } |
1436 | }; | 1270 | }; |
1437 | #endif | 1271 | #endif |
1438 | 1272 | ||
1439 | static struct ctl_table fs_table[] = { | 1273 | static struct ctl_table fs_table[] = { |
1440 | { | 1274 | { |
1441 | .ctl_name = FS_NRINODE, | ||
1442 | .procname = "inode-nr", | 1275 | .procname = "inode-nr", |
1443 | .data = &inodes_stat, | 1276 | .data = &inodes_stat, |
1444 | .maxlen = 2*sizeof(int), | 1277 | .maxlen = 2*sizeof(int), |
@@ -1446,7 +1279,6 @@ static struct ctl_table fs_table[] = { | |||
1446 | .proc_handler = &proc_dointvec, | 1279 | .proc_handler = &proc_dointvec, |
1447 | }, | 1280 | }, |
1448 | { | 1281 | { |
1449 | .ctl_name = FS_STATINODE, | ||
1450 | .procname = "inode-state", | 1282 | .procname = "inode-state", |
1451 | .data = &inodes_stat, | 1283 | .data = &inodes_stat, |
1452 | .maxlen = 7*sizeof(int), | 1284 | .maxlen = 7*sizeof(int), |
@@ -1461,7 +1293,6 @@ static struct ctl_table fs_table[] = { | |||
1461 | .proc_handler = &proc_nr_files, | 1293 | .proc_handler = &proc_nr_files, |
1462 | }, | 1294 | }, |
1463 | { | 1295 | { |
1464 | .ctl_name = FS_MAXFILE, | ||
1465 | .procname = "file-max", | 1296 | .procname = "file-max", |
1466 | .data = &files_stat.max_files, | 1297 | .data = &files_stat.max_files, |
1467 | .maxlen = sizeof(int), | 1298 | .maxlen = sizeof(int), |
@@ -1469,7 +1300,6 @@ static struct ctl_table fs_table[] = { | |||
1469 | .proc_handler = &proc_dointvec, | 1300 | .proc_handler = &proc_dointvec, |
1470 | }, | 1301 | }, |
1471 | { | 1302 | { |
1472 | .ctl_name = CTL_UNNUMBERED, | ||
1473 | .procname = "nr_open", | 1303 | .procname = "nr_open", |
1474 | .data = &sysctl_nr_open, | 1304 | .data = &sysctl_nr_open, |
1475 | .maxlen = sizeof(int), | 1305 | .maxlen = sizeof(int), |
@@ -1479,7 +1309,6 @@ static struct ctl_table fs_table[] = { | |||
1479 | .extra2 = &sysctl_nr_open_max, | 1309 | .extra2 = &sysctl_nr_open_max, |
1480 | }, | 1310 | }, |
1481 | { | 1311 | { |
1482 | .ctl_name = FS_DENTRY, | ||
1483 | .procname = "dentry-state", | 1312 | .procname = "dentry-state", |
1484 | .data = &dentry_stat, | 1313 | .data = &dentry_stat, |
1485 | .maxlen = 6*sizeof(int), | 1314 | .maxlen = 6*sizeof(int), |
@@ -1487,30 +1316,25 @@ static struct ctl_table fs_table[] = { | |||
1487 | .proc_handler = &proc_dointvec, | 1316 | .proc_handler = &proc_dointvec, |
1488 | }, | 1317 | }, |
1489 | { | 1318 | { |
1490 | .ctl_name = FS_OVERFLOWUID, | ||
1491 | .procname = "overflowuid", | 1319 | .procname = "overflowuid", |
1492 | .data = &fs_overflowuid, | 1320 | .data = &fs_overflowuid, |
1493 | .maxlen = sizeof(int), | 1321 | .maxlen = sizeof(int), |
1494 | .mode = 0644, | 1322 | .mode = 0644, |
1495 | .proc_handler = &proc_dointvec_minmax, | 1323 | .proc_handler = &proc_dointvec_minmax, |
1496 | .strategy = &sysctl_intvec, | ||
1497 | .extra1 = &minolduid, | 1324 | .extra1 = &minolduid, |
1498 | .extra2 = &maxolduid, | 1325 | .extra2 = &maxolduid, |
1499 | }, | 1326 | }, |
1500 | { | 1327 | { |
1501 | .ctl_name = FS_OVERFLOWGID, | ||
1502 | .procname = "overflowgid", | 1328 | .procname = "overflowgid", |
1503 | .data = &fs_overflowgid, | 1329 | .data = &fs_overflowgid, |
1504 | .maxlen = sizeof(int), | 1330 | .maxlen = sizeof(int), |
1505 | .mode = 0644, | 1331 | .mode = 0644, |
1506 | .proc_handler = &proc_dointvec_minmax, | 1332 | .proc_handler = &proc_dointvec_minmax, |
1507 | .strategy = &sysctl_intvec, | ||
1508 | .extra1 = &minolduid, | 1333 | .extra1 = &minolduid, |
1509 | .extra2 = &maxolduid, | 1334 | .extra2 = &maxolduid, |
1510 | }, | 1335 | }, |
1511 | #ifdef CONFIG_FILE_LOCKING | 1336 | #ifdef CONFIG_FILE_LOCKING |
1512 | { | 1337 | { |
1513 | .ctl_name = FS_LEASES, | ||
1514 | .procname = "leases-enable", | 1338 | .procname = "leases-enable", |
1515 | .data = &leases_enable, | 1339 | .data = &leases_enable, |
1516 | .maxlen = sizeof(int), | 1340 | .maxlen = sizeof(int), |
@@ -1520,7 +1344,6 @@ static struct ctl_table fs_table[] = { | |||
1520 | #endif | 1344 | #endif |
1521 | #ifdef CONFIG_DNOTIFY | 1345 | #ifdef CONFIG_DNOTIFY |
1522 | { | 1346 | { |
1523 | .ctl_name = FS_DIR_NOTIFY, | ||
1524 | .procname = "dir-notify-enable", | 1347 | .procname = "dir-notify-enable", |
1525 | .data = &dir_notify_enable, | 1348 | .data = &dir_notify_enable, |
1526 | .maxlen = sizeof(int), | 1349 | .maxlen = sizeof(int), |
@@ -1531,7 +1354,6 @@ static struct ctl_table fs_table[] = { | |||
1531 | #ifdef CONFIG_MMU | 1354 | #ifdef CONFIG_MMU |
1532 | #ifdef CONFIG_FILE_LOCKING | 1355 | #ifdef CONFIG_FILE_LOCKING |
1533 | { | 1356 | { |
1534 | .ctl_name = FS_LEASE_TIME, | ||
1535 | .procname = "lease-break-time", | 1357 | .procname = "lease-break-time", |
1536 | .data = &lease_break_time, | 1358 | .data = &lease_break_time, |
1537 | .maxlen = sizeof(int), | 1359 | .maxlen = sizeof(int), |
@@ -1557,7 +1379,6 @@ static struct ctl_table fs_table[] = { | |||
1557 | #endif /* CONFIG_AIO */ | 1379 | #endif /* CONFIG_AIO */ |
1558 | #ifdef CONFIG_INOTIFY_USER | 1380 | #ifdef CONFIG_INOTIFY_USER |
1559 | { | 1381 | { |
1560 | .ctl_name = FS_INOTIFY, | ||
1561 | .procname = "inotify", | 1382 | .procname = "inotify", |
1562 | .mode = 0555, | 1383 | .mode = 0555, |
1563 | .child = inotify_table, | 1384 | .child = inotify_table, |
@@ -1572,19 +1393,16 @@ static struct ctl_table fs_table[] = { | |||
1572 | #endif | 1393 | #endif |
1573 | #endif | 1394 | #endif |
1574 | { | 1395 | { |
1575 | .ctl_name = KERN_SETUID_DUMPABLE, | ||
1576 | .procname = "suid_dumpable", | 1396 | .procname = "suid_dumpable", |
1577 | .data = &suid_dumpable, | 1397 | .data = &suid_dumpable, |
1578 | .maxlen = sizeof(int), | 1398 | .maxlen = sizeof(int), |
1579 | .mode = 0644, | 1399 | .mode = 0644, |
1580 | .proc_handler = &proc_dointvec_minmax, | 1400 | .proc_handler = &proc_dointvec_minmax, |
1581 | .strategy = &sysctl_intvec, | ||
1582 | .extra1 = &zero, | 1401 | .extra1 = &zero, |
1583 | .extra2 = &two, | 1402 | .extra2 = &two, |
1584 | }, | 1403 | }, |
1585 | #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) | 1404 | #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) |
1586 | { | 1405 | { |
1587 | .ctl_name = CTL_UNNUMBERED, | ||
1588 | .procname = "binfmt_misc", | 1406 | .procname = "binfmt_misc", |
1589 | .mode = 0555, | 1407 | .mode = 0555, |
1590 | .child = binfmt_misc_table, | 1408 | .child = binfmt_misc_table, |
@@ -1594,13 +1412,12 @@ static struct ctl_table fs_table[] = { | |||
1594 | * NOTE: do not add new entries to this table unless you have read | 1412 | * NOTE: do not add new entries to this table unless you have read |
1595 | * Documentation/sysctl/ctl_unnumbered.txt | 1413 | * Documentation/sysctl/ctl_unnumbered.txt |
1596 | */ | 1414 | */ |
1597 | { .ctl_name = 0 } | 1415 | { } |
1598 | }; | 1416 | }; |
1599 | 1417 | ||
1600 | static struct ctl_table debug_table[] = { | 1418 | static struct ctl_table debug_table[] = { |
1601 | #if defined(CONFIG_X86) || defined(CONFIG_PPC) | 1419 | #if defined(CONFIG_X86) || defined(CONFIG_PPC) |
1602 | { | 1420 | { |
1603 | .ctl_name = CTL_UNNUMBERED, | ||
1604 | .procname = "exception-trace", | 1421 | .procname = "exception-trace", |
1605 | .data = &show_unhandled_signals, | 1422 | .data = &show_unhandled_signals, |
1606 | .maxlen = sizeof(int), | 1423 | .maxlen = sizeof(int), |
@@ -1608,11 +1425,11 @@ static struct ctl_table debug_table[] = { | |||
1608 | .proc_handler = proc_dointvec | 1425 | .proc_handler = proc_dointvec |
1609 | }, | 1426 | }, |
1610 | #endif | 1427 | #endif |
1611 | { .ctl_name = 0 } | 1428 | { } |
1612 | }; | 1429 | }; |
1613 | 1430 | ||
1614 | static struct ctl_table dev_table[] = { | 1431 | static struct ctl_table dev_table[] = { |
1615 | { .ctl_name = 0 } | 1432 | { } |
1616 | }; | 1433 | }; |
1617 | 1434 | ||
1618 | static DEFINE_SPINLOCK(sysctl_lock); | 1435 | static DEFINE_SPINLOCK(sysctl_lock); |
@@ -1766,122 +1583,6 @@ void register_sysctl_root(struct ctl_table_root *root) | |||
1766 | spin_unlock(&sysctl_lock); | 1583 | spin_unlock(&sysctl_lock); |
1767 | } | 1584 | } |
1768 | 1585 | ||
1769 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
1770 | /* Perform the actual read/write of a sysctl table entry. */ | ||
1771 | static int do_sysctl_strategy(struct ctl_table_root *root, | ||
1772 | struct ctl_table *table, | ||
1773 | void __user *oldval, size_t __user *oldlenp, | ||
1774 | void __user *newval, size_t newlen) | ||
1775 | { | ||
1776 | int op = 0, rc; | ||
1777 | |||
1778 | if (oldval) | ||
1779 | op |= MAY_READ; | ||
1780 | if (newval) | ||
1781 | op |= MAY_WRITE; | ||
1782 | if (sysctl_perm(root, table, op)) | ||
1783 | return -EPERM; | ||
1784 | |||
1785 | if (table->strategy) { | ||
1786 | rc = table->strategy(table, oldval, oldlenp, newval, newlen); | ||
1787 | if (rc < 0) | ||
1788 | return rc; | ||
1789 | if (rc > 0) | ||
1790 | return 0; | ||
1791 | } | ||
1792 | |||
1793 | /* If there is no strategy routine, or if the strategy returns | ||
1794 | * zero, proceed with automatic r/w */ | ||
1795 | if (table->data && table->maxlen) { | ||
1796 | rc = sysctl_data(table, oldval, oldlenp, newval, newlen); | ||
1797 | if (rc < 0) | ||
1798 | return rc; | ||
1799 | } | ||
1800 | return 0; | ||
1801 | } | ||
1802 | |||
1803 | static int parse_table(int __user *name, int nlen, | ||
1804 | void __user *oldval, size_t __user *oldlenp, | ||
1805 | void __user *newval, size_t newlen, | ||
1806 | struct ctl_table_root *root, | ||
1807 | struct ctl_table *table) | ||
1808 | { | ||
1809 | int n; | ||
1810 | repeat: | ||
1811 | if (!nlen) | ||
1812 | return -ENOTDIR; | ||
1813 | if (get_user(n, name)) | ||
1814 | return -EFAULT; | ||
1815 | for ( ; table->ctl_name || table->procname; table++) { | ||
1816 | if (!table->ctl_name) | ||
1817 | continue; | ||
1818 | if (n == table->ctl_name) { | ||
1819 | int error; | ||
1820 | if (table->child) { | ||
1821 | if (sysctl_perm(root, table, MAY_EXEC)) | ||
1822 | return -EPERM; | ||
1823 | name++; | ||
1824 | nlen--; | ||
1825 | table = table->child; | ||
1826 | goto repeat; | ||
1827 | } | ||
1828 | error = do_sysctl_strategy(root, table, | ||
1829 | oldval, oldlenp, | ||
1830 | newval, newlen); | ||
1831 | return error; | ||
1832 | } | ||
1833 | } | ||
1834 | return -ENOTDIR; | ||
1835 | } | ||
1836 | |||
1837 | int do_sysctl(int __user *name, int nlen, void __user *oldval, size_t __user *oldlenp, | ||
1838 | void __user *newval, size_t newlen) | ||
1839 | { | ||
1840 | struct ctl_table_header *head; | ||
1841 | int error = -ENOTDIR; | ||
1842 | |||
1843 | if (nlen <= 0 || nlen >= CTL_MAXNAME) | ||
1844 | return -ENOTDIR; | ||
1845 | if (oldval) { | ||
1846 | int old_len; | ||
1847 | if (!oldlenp || get_user(old_len, oldlenp)) | ||
1848 | return -EFAULT; | ||
1849 | } | ||
1850 | |||
1851 | for (head = sysctl_head_next(NULL); head; | ||
1852 | head = sysctl_head_next(head)) { | ||
1853 | error = parse_table(name, nlen, oldval, oldlenp, | ||
1854 | newval, newlen, | ||
1855 | head->root, head->ctl_table); | ||
1856 | if (error != -ENOTDIR) { | ||
1857 | sysctl_head_finish(head); | ||
1858 | break; | ||
1859 | } | ||
1860 | } | ||
1861 | return error; | ||
1862 | } | ||
1863 | |||
1864 | SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args) | ||
1865 | { | ||
1866 | struct __sysctl_args tmp; | ||
1867 | int error; | ||
1868 | |||
1869 | if (copy_from_user(&tmp, args, sizeof(tmp))) | ||
1870 | return -EFAULT; | ||
1871 | |||
1872 | error = deprecated_sysctl_warning(&tmp); | ||
1873 | if (error) | ||
1874 | goto out; | ||
1875 | |||
1876 | lock_kernel(); | ||
1877 | error = do_sysctl(tmp.name, tmp.nlen, tmp.oldval, tmp.oldlenp, | ||
1878 | tmp.newval, tmp.newlen); | ||
1879 | unlock_kernel(); | ||
1880 | out: | ||
1881 | return error; | ||
1882 | } | ||
1883 | #endif /* CONFIG_SYSCTL_SYSCALL */ | ||
1884 | |||
1885 | /* | 1586 | /* |
1886 | * sysctl_perm does NOT grant the superuser all rights automatically, because | 1587 | * sysctl_perm does NOT grant the superuser all rights automatically, because |
1887 | * some sysctl variables are readonly even to root. | 1588 | * some sysctl variables are readonly even to root. |
@@ -1917,7 +1618,7 @@ int sysctl_perm(struct ctl_table_root *root, struct ctl_table *table, int op) | |||
1917 | 1618 | ||
1918 | static void sysctl_set_parent(struct ctl_table *parent, struct ctl_table *table) | 1619 | static void sysctl_set_parent(struct ctl_table *parent, struct ctl_table *table) |
1919 | { | 1620 | { |
1920 | for (; table->ctl_name || table->procname; table++) { | 1621 | for (; table->procname; table++) { |
1921 | table->parent = parent; | 1622 | table->parent = parent; |
1922 | if (table->child) | 1623 | if (table->child) |
1923 | sysctl_set_parent(table, table->child); | 1624 | sysctl_set_parent(table, table->child); |
@@ -1949,11 +1650,11 @@ static struct ctl_table *is_branch_in(struct ctl_table *branch, | |||
1949 | return NULL; | 1650 | return NULL; |
1950 | 1651 | ||
1951 | /* ... and nothing else */ | 1652 | /* ... and nothing else */ |
1952 | if (branch[1].procname || branch[1].ctl_name) | 1653 | if (branch[1].procname) |
1953 | return NULL; | 1654 | return NULL; |
1954 | 1655 | ||
1955 | /* table should contain subdirectory with the same name */ | 1656 | /* table should contain subdirectory with the same name */ |
1956 | for (p = table; p->procname || p->ctl_name; p++) { | 1657 | for (p = table; p->procname; p++) { |
1957 | if (!p->child) | 1658 | if (!p->child) |
1958 | continue; | 1659 | continue; |
1959 | if (p->procname && strcmp(p->procname, s) == 0) | 1660 | if (p->procname && strcmp(p->procname, s) == 0) |
@@ -1998,9 +1699,6 @@ static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q) | |||
1998 | * | 1699 | * |
1999 | * The members of the &struct ctl_table structure are used as follows: | 1700 | * The members of the &struct ctl_table structure are used as follows: |
2000 | * | 1701 | * |
2001 | * ctl_name - This is the numeric sysctl value used by sysctl(2). The number | ||
2002 | * must be unique within that level of sysctl | ||
2003 | * | ||
2004 | * procname - the name of the sysctl file under /proc/sys. Set to %NULL to not | 1702 | * procname - the name of the sysctl file under /proc/sys. Set to %NULL to not |
2005 | * enter a sysctl file | 1703 | * enter a sysctl file |
2006 | * | 1704 | * |
@@ -2015,8 +1713,6 @@ static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q) | |||
2015 | * | 1713 | * |
2016 | * proc_handler - the text handler routine (described below) | 1714 | * proc_handler - the text handler routine (described below) |
2017 | * | 1715 | * |
2018 | * strategy - the strategy routine (described below) | ||
2019 | * | ||
2020 | * de - for internal use by the sysctl routines | 1716 | * de - for internal use by the sysctl routines |
2021 | * | 1717 | * |
2022 | * extra1, extra2 - extra pointers usable by the proc handler routines | 1718 | * extra1, extra2 - extra pointers usable by the proc handler routines |
@@ -2029,19 +1725,6 @@ static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q) | |||
2029 | * struct enable minimal validation of the values being written to be | 1725 | * struct enable minimal validation of the values being written to be |
2030 | * performed, and the mode field allows minimal authentication. | 1726 | * performed, and the mode field allows minimal authentication. |
2031 | * | 1727 | * |
2032 | * More sophisticated management can be enabled by the provision of a | ||
2033 | * strategy routine with the table entry. This will be called before | ||
2034 | * any automatic read or write of the data is performed. | ||
2035 | * | ||
2036 | * The strategy routine may return | ||
2037 | * | ||
2038 | * < 0 - Error occurred (error is passed to user process) | ||
2039 | * | ||
2040 | * 0 - OK - proceed with automatic read or write. | ||
2041 | * | ||
2042 | * > 0 - OK - read or write has been done by the strategy routine, so | ||
2043 | * return immediately. | ||
2044 | * | ||
2045 | * There must be a proc_handler routine for any terminal nodes | 1728 | * There must be a proc_handler routine for any terminal nodes |
2046 | * mirrored under /proc/sys (non-terminals are handled by a built-in | 1729 | * mirrored under /proc/sys (non-terminals are handled by a built-in |
2047 | * directory handler). Several default handlers are available to | 1730 | * directory handler). Several default handlers are available to |
@@ -2068,13 +1751,13 @@ struct ctl_table_header *__register_sysctl_paths( | |||
2068 | struct ctl_table_set *set; | 1751 | struct ctl_table_set *set; |
2069 | 1752 | ||
2070 | /* Count the path components */ | 1753 | /* Count the path components */ |
2071 | for (npath = 0; path[npath].ctl_name || path[npath].procname; ++npath) | 1754 | for (npath = 0; path[npath].procname; ++npath) |
2072 | ; | 1755 | ; |
2073 | 1756 | ||
2074 | /* | 1757 | /* |
2075 | * For each path component, allocate a 2-element ctl_table array. | 1758 | * For each path component, allocate a 2-element ctl_table array. |
2076 | * The first array element will be filled with the sysctl entry | 1759 | * The first array element will be filled with the sysctl entry |
2077 | * for this, the second will be the sentinel (ctl_name == 0). | 1760 | * for this, the second will be the sentinel (procname == 0). |
2078 | * | 1761 | * |
2079 | * We allocate everything in one go so that we don't have to | 1762 | * We allocate everything in one go so that we don't have to |
2080 | * worry about freeing additional memory in unregister_sysctl_table. | 1763 | * worry about freeing additional memory in unregister_sysctl_table. |
@@ -2091,7 +1774,6 @@ struct ctl_table_header *__register_sysctl_paths( | |||
2091 | for (n = 0; n < npath; ++n, ++path) { | 1774 | for (n = 0; n < npath; ++n, ++path) { |
2092 | /* Copy the procname */ | 1775 | /* Copy the procname */ |
2093 | new->procname = path->procname; | 1776 | new->procname = path->procname; |
2094 | new->ctl_name = path->ctl_name; | ||
2095 | new->mode = 0555; | 1777 | new->mode = 0555; |
2096 | 1778 | ||
2097 | *prevp = new; | 1779 | *prevp = new; |
@@ -2953,286 +2635,6 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, | |||
2953 | 2635 | ||
2954 | #endif /* CONFIG_PROC_FS */ | 2636 | #endif /* CONFIG_PROC_FS */ |
2955 | 2637 | ||
2956 | |||
2957 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
2958 | /* | ||
2959 | * General sysctl support routines | ||
2960 | */ | ||
2961 | |||
2962 | /* The generic sysctl data routine (used if no strategy routine supplied) */ | ||
2963 | int sysctl_data(struct ctl_table *table, | ||
2964 | void __user *oldval, size_t __user *oldlenp, | ||
2965 | void __user *newval, size_t newlen) | ||
2966 | { | ||
2967 | size_t len; | ||
2968 | |||
2969 | /* Get out of I don't have a variable */ | ||
2970 | if (!table->data || !table->maxlen) | ||
2971 | return -ENOTDIR; | ||
2972 | |||
2973 | if (oldval && oldlenp) { | ||
2974 | if (get_user(len, oldlenp)) | ||
2975 | return -EFAULT; | ||
2976 | if (len) { | ||
2977 | if (len > table->maxlen) | ||
2978 | len = table->maxlen; | ||
2979 | if (copy_to_user(oldval, table->data, len)) | ||
2980 | return -EFAULT; | ||
2981 | if (put_user(len, oldlenp)) | ||
2982 | return -EFAULT; | ||
2983 | } | ||
2984 | } | ||
2985 | |||
2986 | if (newval && newlen) { | ||
2987 | if (newlen > table->maxlen) | ||
2988 | newlen = table->maxlen; | ||
2989 | |||
2990 | if (copy_from_user(table->data, newval, newlen)) | ||
2991 | return -EFAULT; | ||
2992 | } | ||
2993 | return 1; | ||
2994 | } | ||
2995 | |||
2996 | /* The generic string strategy routine: */ | ||
2997 | int sysctl_string(struct ctl_table *table, | ||
2998 | void __user *oldval, size_t __user *oldlenp, | ||
2999 | void __user *newval, size_t newlen) | ||
3000 | { | ||
3001 | if (!table->data || !table->maxlen) | ||
3002 | return -ENOTDIR; | ||
3003 | |||
3004 | if (oldval && oldlenp) { | ||
3005 | size_t bufsize; | ||
3006 | if (get_user(bufsize, oldlenp)) | ||
3007 | return -EFAULT; | ||
3008 | if (bufsize) { | ||
3009 | size_t len = strlen(table->data), copied; | ||
3010 | |||
3011 | /* This shouldn't trigger for a well-formed sysctl */ | ||
3012 | if (len > table->maxlen) | ||
3013 | len = table->maxlen; | ||
3014 | |||
3015 | /* Copy up to a max of bufsize-1 bytes of the string */ | ||
3016 | copied = (len >= bufsize) ? bufsize - 1 : len; | ||
3017 | |||
3018 | if (copy_to_user(oldval, table->data, copied) || | ||
3019 | put_user(0, (char __user *)(oldval + copied))) | ||
3020 | return -EFAULT; | ||
3021 | if (put_user(len, oldlenp)) | ||
3022 | return -EFAULT; | ||
3023 | } | ||
3024 | } | ||
3025 | if (newval && newlen) { | ||
3026 | size_t len = newlen; | ||
3027 | if (len > table->maxlen) | ||
3028 | len = table->maxlen; | ||
3029 | if(copy_from_user(table->data, newval, len)) | ||
3030 | return -EFAULT; | ||
3031 | if (len == table->maxlen) | ||
3032 | len--; | ||
3033 | ((char *) table->data)[len] = 0; | ||
3034 | } | ||
3035 | return 1; | ||
3036 | } | ||
3037 | |||
3038 | /* | ||
3039 | * This function makes sure that all of the integers in the vector | ||
3040 | * are between the minimum and maximum values given in the arrays | ||
3041 | * table->extra1 and table->extra2, respectively. | ||
3042 | */ | ||
3043 | int sysctl_intvec(struct ctl_table *table, | ||
3044 | void __user *oldval, size_t __user *oldlenp, | ||
3045 | void __user *newval, size_t newlen) | ||
3046 | { | ||
3047 | |||
3048 | if (newval && newlen) { | ||
3049 | int __user *vec = (int __user *) newval; | ||
3050 | int *min = (int *) table->extra1; | ||
3051 | int *max = (int *) table->extra2; | ||
3052 | size_t length; | ||
3053 | int i; | ||
3054 | |||
3055 | if (newlen % sizeof(int) != 0) | ||
3056 | return -EINVAL; | ||
3057 | |||
3058 | if (!table->extra1 && !table->extra2) | ||
3059 | return 0; | ||
3060 | |||
3061 | if (newlen > table->maxlen) | ||
3062 | newlen = table->maxlen; | ||
3063 | length = newlen / sizeof(int); | ||
3064 | |||
3065 | for (i = 0; i < length; i++) { | ||
3066 | int value; | ||
3067 | if (get_user(value, vec + i)) | ||
3068 | return -EFAULT; | ||
3069 | if (min && value < min[i]) | ||
3070 | return -EINVAL; | ||
3071 | if (max && value > max[i]) | ||
3072 | return -EINVAL; | ||
3073 | } | ||
3074 | } | ||
3075 | return 0; | ||
3076 | } | ||
3077 | |||
3078 | /* Strategy function to convert jiffies to seconds */ | ||
3079 | int sysctl_jiffies(struct ctl_table *table, | ||
3080 | void __user *oldval, size_t __user *oldlenp, | ||
3081 | void __user *newval, size_t newlen) | ||
3082 | { | ||
3083 | if (oldval && oldlenp) { | ||
3084 | size_t olen; | ||
3085 | |||
3086 | if (get_user(olen, oldlenp)) | ||
3087 | return -EFAULT; | ||
3088 | if (olen) { | ||
3089 | int val; | ||
3090 | |||
3091 | if (olen < sizeof(int)) | ||
3092 | return -EINVAL; | ||
3093 | |||
3094 | val = *(int *)(table->data) / HZ; | ||
3095 | if (put_user(val, (int __user *)oldval)) | ||
3096 | return -EFAULT; | ||
3097 | if (put_user(sizeof(int), oldlenp)) | ||
3098 | return -EFAULT; | ||
3099 | } | ||
3100 | } | ||
3101 | if (newval && newlen) { | ||
3102 | int new; | ||
3103 | if (newlen != sizeof(int)) | ||
3104 | return -EINVAL; | ||
3105 | if (get_user(new, (int __user *)newval)) | ||
3106 | return -EFAULT; | ||
3107 | *(int *)(table->data) = new*HZ; | ||
3108 | } | ||
3109 | return 1; | ||
3110 | } | ||
3111 | |||
3112 | /* Strategy function to convert jiffies to seconds */ | ||
3113 | int sysctl_ms_jiffies(struct ctl_table *table, | ||
3114 | void __user *oldval, size_t __user *oldlenp, | ||
3115 | void __user *newval, size_t newlen) | ||
3116 | { | ||
3117 | if (oldval && oldlenp) { | ||
3118 | size_t olen; | ||
3119 | |||
3120 | if (get_user(olen, oldlenp)) | ||
3121 | return -EFAULT; | ||
3122 | if (olen) { | ||
3123 | int val; | ||
3124 | |||
3125 | if (olen < sizeof(int)) | ||
3126 | return -EINVAL; | ||
3127 | |||
3128 | val = jiffies_to_msecs(*(int *)(table->data)); | ||
3129 | if (put_user(val, (int __user *)oldval)) | ||
3130 | return -EFAULT; | ||
3131 | if (put_user(sizeof(int), oldlenp)) | ||
3132 | return -EFAULT; | ||
3133 | } | ||
3134 | } | ||
3135 | if (newval && newlen) { | ||
3136 | int new; | ||
3137 | if (newlen != sizeof(int)) | ||
3138 | return -EINVAL; | ||
3139 | if (get_user(new, (int __user *)newval)) | ||
3140 | return -EFAULT; | ||
3141 | *(int *)(table->data) = msecs_to_jiffies(new); | ||
3142 | } | ||
3143 | return 1; | ||
3144 | } | ||
3145 | |||
3146 | |||
3147 | |||
3148 | #else /* CONFIG_SYSCTL_SYSCALL */ | ||
3149 | |||
3150 | |||
3151 | SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args) | ||
3152 | { | ||
3153 | struct __sysctl_args tmp; | ||
3154 | int error; | ||
3155 | |||
3156 | if (copy_from_user(&tmp, args, sizeof(tmp))) | ||
3157 | return -EFAULT; | ||
3158 | |||
3159 | error = deprecated_sysctl_warning(&tmp); | ||
3160 | |||
3161 | /* If no error reading the parameters then just -ENOSYS ... */ | ||
3162 | if (!error) | ||
3163 | error = -ENOSYS; | ||
3164 | |||
3165 | return error; | ||
3166 | } | ||
3167 | |||
3168 | int sysctl_data(struct ctl_table *table, | ||
3169 | void __user *oldval, size_t __user *oldlenp, | ||
3170 | void __user *newval, size_t newlen) | ||
3171 | { | ||
3172 | return -ENOSYS; | ||
3173 | } | ||
3174 | |||
3175 | int sysctl_string(struct ctl_table *table, | ||
3176 | void __user *oldval, size_t __user *oldlenp, | ||
3177 | void __user *newval, size_t newlen) | ||
3178 | { | ||
3179 | return -ENOSYS; | ||
3180 | } | ||
3181 | |||
3182 | int sysctl_intvec(struct ctl_table *table, | ||
3183 | void __user *oldval, size_t __user *oldlenp, | ||
3184 | void __user *newval, size_t newlen) | ||
3185 | { | ||
3186 | return -ENOSYS; | ||
3187 | } | ||
3188 | |||
3189 | int sysctl_jiffies(struct ctl_table *table, | ||
3190 | void __user *oldval, size_t __user *oldlenp, | ||
3191 | void __user *newval, size_t newlen) | ||
3192 | { | ||
3193 | return -ENOSYS; | ||
3194 | } | ||
3195 | |||
3196 | int sysctl_ms_jiffies(struct ctl_table *table, | ||
3197 | void __user *oldval, size_t __user *oldlenp, | ||
3198 | void __user *newval, size_t newlen) | ||
3199 | { | ||
3200 | return -ENOSYS; | ||
3201 | } | ||
3202 | |||
3203 | #endif /* CONFIG_SYSCTL_SYSCALL */ | ||
3204 | |||
3205 | static int deprecated_sysctl_warning(struct __sysctl_args *args) | ||
3206 | { | ||
3207 | static int msg_count; | ||
3208 | int name[CTL_MAXNAME]; | ||
3209 | int i; | ||
3210 | |||
3211 | /* Check args->nlen. */ | ||
3212 | if (args->nlen < 0 || args->nlen > CTL_MAXNAME) | ||
3213 | return -ENOTDIR; | ||
3214 | |||
3215 | /* Read in the sysctl name for better debug message logging */ | ||
3216 | for (i = 0; i < args->nlen; i++) | ||
3217 | if (get_user(name[i], args->name + i)) | ||
3218 | return -EFAULT; | ||
3219 | |||
3220 | /* Ignore accesses to kernel.version */ | ||
3221 | if ((args->nlen == 2) && (name[0] == CTL_KERN) && (name[1] == KERN_VERSION)) | ||
3222 | return 0; | ||
3223 | |||
3224 | if (msg_count < 5) { | ||
3225 | msg_count++; | ||
3226 | printk(KERN_INFO | ||
3227 | "warning: process `%s' used the deprecated sysctl " | ||
3228 | "system call with ", current->comm); | ||
3229 | for (i = 0; i < args->nlen; i++) | ||
3230 | printk("%d.", name[i]); | ||
3231 | printk("\n"); | ||
3232 | } | ||
3233 | return 0; | ||
3234 | } | ||
3235 | |||
3236 | /* | 2638 | /* |
3237 | * No sense putting this after each symbol definition, twice, | 2639 | * No sense putting this after each symbol definition, twice, |
3238 | * exception granted :-) | 2640 | * exception granted :-) |
@@ -3247,9 +2649,4 @@ EXPORT_SYMBOL(proc_doulongvec_minmax); | |||
3247 | EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax); | 2649 | EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax); |
3248 | EXPORT_SYMBOL(register_sysctl_table); | 2650 | EXPORT_SYMBOL(register_sysctl_table); |
3249 | EXPORT_SYMBOL(register_sysctl_paths); | 2651 | EXPORT_SYMBOL(register_sysctl_paths); |
3250 | EXPORT_SYMBOL(sysctl_intvec); | ||
3251 | EXPORT_SYMBOL(sysctl_jiffies); | ||
3252 | EXPORT_SYMBOL(sysctl_ms_jiffies); | ||
3253 | EXPORT_SYMBOL(sysctl_string); | ||
3254 | EXPORT_SYMBOL(sysctl_data); | ||
3255 | EXPORT_SYMBOL(unregister_sysctl_table); | 2652 | EXPORT_SYMBOL(unregister_sysctl_table); |