diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/Makefile | 3 | ||||
| -rw-r--r-- | kernel/fork.c | 2 | ||||
| -rw-r--r-- | kernel/power/Makefile | 2 | ||||
| -rw-r--r-- | kernel/power/hibernate.c | 30 | ||||
| -rw-r--r-- | kernel/power/main.c | 1 | ||||
| -rw-r--r-- | kernel/power/process.c | 14 | ||||
| -rw-r--r-- | kernel/power/swap.c | 107 | ||||
| -rw-r--r-- | kernel/power/swsusp.c | 130 | ||||
| -rw-r--r-- | kernel/sched.c | 5 | ||||
| -rw-r--r-- | kernel/slow-work.c | 7 | ||||
| -rw-r--r-- | kernel/sys_ni.c | 3 | ||||
| -rw-r--r-- | kernel/sysctl.c | 893 | ||||
| -rw-r--r-- | kernel/sysctl_binary.c | 1507 | ||||
| -rw-r--r-- | kernel/sysctl_check.c | 1376 | ||||
| -rw-r--r-- | kernel/time/clocksource.c | 6 | ||||
| -rw-r--r-- | kernel/time/timecompare.c | 6 | ||||
| -rw-r--r-- | kernel/user-return-notifier.c | 46 | ||||
| -rw-r--r-- | kernel/utsname_sysctl.c | 31 |
18 files changed, 1863 insertions, 2306 deletions
diff --git a/kernel/Makefile b/kernel/Makefile index 982c50e2ce53..864ff75d65f2 100644 --- a/kernel/Makefile +++ b/kernel/Makefile | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | obj-y = sched.o fork.o exec_domain.o panic.o printk.o \ | 5 | obj-y = sched.o fork.o exec_domain.o panic.o printk.o \ |
| 6 | cpu.o exit.o itimer.o time.o softirq.o resource.o \ | 6 | cpu.o exit.o itimer.o time.o softirq.o resource.o \ |
| 7 | sysctl.o capability.o ptrace.o timer.o user.o \ | 7 | sysctl.o sysctl_binary.o capability.o ptrace.o timer.o user.o \ |
| 8 | signal.o sys.o kmod.o workqueue.o pid.o \ | 8 | signal.o sys.o kmod.o workqueue.o pid.o \ |
| 9 | rcupdate.o extable.o params.o posix-timers.o \ | 9 | rcupdate.o extable.o params.o posix-timers.o \ |
| 10 | kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \ | 10 | kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \ |
| @@ -99,6 +99,7 @@ obj-$(CONFIG_SLOW_WORK) += slow-work.o | |||
| 99 | obj-$(CONFIG_SLOW_WORK_DEBUG) += slow-work-debugfs.o | 99 | obj-$(CONFIG_SLOW_WORK_DEBUG) += slow-work-debugfs.o |
| 100 | obj-$(CONFIG_PERF_EVENTS) += perf_event.o | 100 | obj-$(CONFIG_PERF_EVENTS) += perf_event.o |
| 101 | obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o | 101 | obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o |
| 102 | obj-$(CONFIG_USER_RETURN_NOTIFIER) += user-return-notifier.o | ||
| 102 | 103 | ||
| 103 | ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y) | 104 | ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y) |
| 104 | # According to Alan Modra <alan@linuxcare.com.au>, the -fno-omit-frame-pointer is | 105 | # According to Alan Modra <alan@linuxcare.com.au>, the -fno-omit-frame-pointer is |
diff --git a/kernel/fork.c b/kernel/fork.c index 3d6f121bbe8a..edeff9ceaab9 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
| @@ -64,6 +64,7 @@ | |||
| 64 | #include <linux/magic.h> | 64 | #include <linux/magic.h> |
| 65 | #include <linux/perf_event.h> | 65 | #include <linux/perf_event.h> |
| 66 | #include <linux/posix-timers.h> | 66 | #include <linux/posix-timers.h> |
| 67 | #include <linux/user-return-notifier.h> | ||
| 67 | 68 | ||
| 68 | #include <asm/pgtable.h> | 69 | #include <asm/pgtable.h> |
| 69 | #include <asm/pgalloc.h> | 70 | #include <asm/pgalloc.h> |
| @@ -249,6 +250,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig) | |||
| 249 | goto out; | 250 | goto out; |
| 250 | 251 | ||
| 251 | setup_thread_stack(tsk, orig); | 252 | setup_thread_stack(tsk, orig); |
| 253 | clear_user_return_notifier(tsk); | ||
| 252 | stackend = end_of_stack(tsk); | 254 | stackend = end_of_stack(tsk); |
| 253 | *stackend = STACK_END_MAGIC; /* for overflow detection */ | 255 | *stackend = STACK_END_MAGIC; /* for overflow detection */ |
| 254 | 256 | ||
diff --git a/kernel/power/Makefile b/kernel/power/Makefile index c3b81c30e5d5..43191815f874 100644 --- a/kernel/power/Makefile +++ b/kernel/power/Makefile | |||
| @@ -8,7 +8,7 @@ obj-$(CONFIG_PM_SLEEP) += console.o | |||
| 8 | obj-$(CONFIG_FREEZER) += process.o | 8 | obj-$(CONFIG_FREEZER) += process.o |
| 9 | obj-$(CONFIG_SUSPEND) += suspend.o | 9 | obj-$(CONFIG_SUSPEND) += suspend.o |
| 10 | obj-$(CONFIG_PM_TEST_SUSPEND) += suspend_test.o | 10 | obj-$(CONFIG_PM_TEST_SUSPEND) += suspend_test.o |
| 11 | obj-$(CONFIG_HIBERNATION) += swsusp.o hibernate.o snapshot.o swap.o user.o | 11 | obj-$(CONFIG_HIBERNATION) += hibernate.o snapshot.o swap.o user.o |
| 12 | obj-$(CONFIG_HIBERNATION_NVS) += hibernate_nvs.o | 12 | obj-$(CONFIG_HIBERNATION_NVS) += hibernate_nvs.o |
| 13 | 13 | ||
| 14 | obj-$(CONFIG_MAGIC_SYSRQ) += poweroff.o | 14 | obj-$(CONFIG_MAGIC_SYSRQ) += poweroff.o |
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index 04a9e90d248f..bbfe472d7524 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c | |||
| @@ -32,6 +32,7 @@ static int noresume = 0; | |||
| 32 | static char resume_file[256] = CONFIG_PM_STD_PARTITION; | 32 | static char resume_file[256] = CONFIG_PM_STD_PARTITION; |
| 33 | dev_t swsusp_resume_device; | 33 | dev_t swsusp_resume_device; |
| 34 | sector_t swsusp_resume_block; | 34 | sector_t swsusp_resume_block; |
| 35 | int in_suspend __nosavedata = 0; | ||
| 35 | 36 | ||
| 36 | enum { | 37 | enum { |
| 37 | HIBERNATION_INVALID, | 38 | HIBERNATION_INVALID, |
| @@ -202,6 +203,35 @@ static void platform_recover(int platform_mode) | |||
| 202 | } | 203 | } |
| 203 | 204 | ||
| 204 | /** | 205 | /** |
| 206 | * swsusp_show_speed - print the time elapsed between two events. | ||
| 207 | * @start: Starting event. | ||
| 208 | * @stop: Final event. | ||
| 209 | * @nr_pages - number of pages processed between @start and @stop | ||
| 210 | * @msg - introductory message to print | ||
| 211 | */ | ||
| 212 | |||
| 213 | void swsusp_show_speed(struct timeval *start, struct timeval *stop, | ||
| 214 | unsigned nr_pages, char *msg) | ||
| 215 | { | ||
| 216 | s64 elapsed_centisecs64; | ||
| 217 | int centisecs; | ||
| 218 | int k; | ||
| 219 | int kps; | ||
| 220 | |||
| 221 | elapsed_centisecs64 = timeval_to_ns(stop) - timeval_to_ns(start); | ||
| 222 | do_div(elapsed_centisecs64, NSEC_PER_SEC / 100); | ||
| 223 | centisecs = elapsed_centisecs64; | ||
| 224 | if (centisecs == 0) | ||
| 225 | centisecs = 1; /* avoid div-by-zero */ | ||
| 226 | k = nr_pages * (PAGE_SIZE / 1024); | ||
| 227 | kps = (k * 100) / centisecs; | ||
| 228 | printk(KERN_INFO "PM: %s %d kbytes in %d.%02d seconds (%d.%02d MB/s)\n", | ||
| 229 | msg, k, | ||
| 230 | centisecs / 100, centisecs % 100, | ||
| 231 | kps / 1000, (kps % 1000) / 10); | ||
| 232 | } | ||
| 233 | |||
| 234 | /** | ||
| 205 | * create_image - freeze devices that need to be frozen with interrupts | 235 | * create_image - freeze devices that need to be frozen with interrupts |
| 206 | * off, create the hibernation image and thaw those devices. Control | 236 | * off, create the hibernation image and thaw those devices. Control |
| 207 | * reappears in this routine after a restore. | 237 | * reappears in this routine after a restore. |
diff --git a/kernel/power/main.c b/kernel/power/main.c index 347d2cc88cd0..0998c7139053 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
| @@ -220,6 +220,7 @@ static struct attribute_group attr_group = { | |||
| 220 | 220 | ||
| 221 | #ifdef CONFIG_PM_RUNTIME | 221 | #ifdef CONFIG_PM_RUNTIME |
| 222 | struct workqueue_struct *pm_wq; | 222 | struct workqueue_struct *pm_wq; |
| 223 | EXPORT_SYMBOL_GPL(pm_wq); | ||
| 223 | 224 | ||
| 224 | static int __init pm_start_workqueue(void) | 225 | static int __init pm_start_workqueue(void) |
| 225 | { | 226 | { |
diff --git a/kernel/power/process.c b/kernel/power/process.c index cc2e55373b68..5ade1bdcf366 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
| 15 | #include <linux/syscalls.h> | 15 | #include <linux/syscalls.h> |
| 16 | #include <linux/freezer.h> | 16 | #include <linux/freezer.h> |
| 17 | #include <linux/delay.h> | ||
| 17 | 18 | ||
| 18 | /* | 19 | /* |
| 19 | * Timeout for stopping processes | 20 | * Timeout for stopping processes |
| @@ -41,7 +42,7 @@ static int try_to_freeze_tasks(bool sig_only) | |||
| 41 | do_gettimeofday(&start); | 42 | do_gettimeofday(&start); |
| 42 | 43 | ||
| 43 | end_time = jiffies + TIMEOUT; | 44 | end_time = jiffies + TIMEOUT; |
| 44 | do { | 45 | while (true) { |
| 45 | todo = 0; | 46 | todo = 0; |
| 46 | read_lock(&tasklist_lock); | 47 | read_lock(&tasklist_lock); |
| 47 | do_each_thread(g, p) { | 48 | do_each_thread(g, p) { |
| @@ -62,10 +63,15 @@ static int try_to_freeze_tasks(bool sig_only) | |||
| 62 | todo++; | 63 | todo++; |
| 63 | } while_each_thread(g, p); | 64 | } while_each_thread(g, p); |
| 64 | read_unlock(&tasklist_lock); | 65 | read_unlock(&tasklist_lock); |
| 65 | yield(); /* Yield is okay here */ | 66 | if (!todo || time_after(jiffies, end_time)) |
| 66 | if (time_after(jiffies, end_time)) | ||
| 67 | break; | 67 | break; |
| 68 | } while (todo); | 68 | |
| 69 | /* | ||
| 70 | * We need to retry, but first give the freezing tasks some | ||
| 71 | * time to enter the regrigerator. | ||
| 72 | */ | ||
| 73 | msleep(10); | ||
| 74 | } | ||
| 69 | 75 | ||
| 70 | do_gettimeofday(&end); | 76 | do_gettimeofday(&end); |
| 71 | elapsed_csecs64 = timeval_to_ns(&end) - timeval_to_ns(&start); | 77 | elapsed_csecs64 = timeval_to_ns(&end) - timeval_to_ns(&start); |
diff --git a/kernel/power/swap.c b/kernel/power/swap.c index 890f6b11b1d3..09b2b0ae9e9d 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c | |||
| @@ -38,6 +38,107 @@ struct swsusp_header { | |||
| 38 | 38 | ||
| 39 | static struct swsusp_header *swsusp_header; | 39 | static struct swsusp_header *swsusp_header; |
| 40 | 40 | ||
| 41 | /** | ||
| 42 | * The following functions are used for tracing the allocated | ||
| 43 | * swap pages, so that they can be freed in case of an error. | ||
| 44 | */ | ||
| 45 | |||
| 46 | struct swsusp_extent { | ||
| 47 | struct rb_node node; | ||
| 48 | unsigned long start; | ||
| 49 | unsigned long end; | ||
| 50 | }; | ||
| 51 | |||
| 52 | static struct rb_root swsusp_extents = RB_ROOT; | ||
| 53 | |||
| 54 | static int swsusp_extents_insert(unsigned long swap_offset) | ||
| 55 | { | ||
| 56 | struct rb_node **new = &(swsusp_extents.rb_node); | ||
| 57 | struct rb_node *parent = NULL; | ||
| 58 | struct swsusp_extent *ext; | ||
| 59 | |||
| 60 | /* Figure out where to put the new node */ | ||
| 61 | while (*new) { | ||
| 62 | ext = container_of(*new, struct swsusp_extent, node); | ||
| 63 | parent = *new; | ||
| 64 | if (swap_offset < ext->start) { | ||
| 65 | /* Try to merge */ | ||
| 66 | if (swap_offset == ext->start - 1) { | ||
| 67 | ext->start--; | ||
| 68 | return 0; | ||
| 69 | } | ||
| 70 | new = &((*new)->rb_left); | ||
| 71 | } else if (swap_offset > ext->end) { | ||
| 72 | /* Try to merge */ | ||
| 73 | if (swap_offset == ext->end + 1) { | ||
| 74 | ext->end++; | ||
| 75 | return 0; | ||
| 76 | } | ||
| 77 | new = &((*new)->rb_right); | ||
| 78 | } else { | ||
| 79 | /* It already is in the tree */ | ||
| 80 | return -EINVAL; | ||
| 81 | } | ||
| 82 | } | ||
| 83 | /* Add the new node and rebalance the tree. */ | ||
| 84 | ext = kzalloc(sizeof(struct swsusp_extent), GFP_KERNEL); | ||
| 85 | if (!ext) | ||
| 86 | return -ENOMEM; | ||
| 87 | |||
| 88 | ext->start = swap_offset; | ||
| 89 | ext->end = swap_offset; | ||
| 90 | rb_link_node(&ext->node, parent, new); | ||
| 91 | rb_insert_color(&ext->node, &swsusp_extents); | ||
| 92 | return 0; | ||
| 93 | } | ||
| 94 | |||
| 95 | /** | ||
| 96 | * alloc_swapdev_block - allocate a swap page and register that it has | ||
| 97 | * been allocated, so that it can be freed in case of an error. | ||
| 98 | */ | ||
| 99 | |||
| 100 | sector_t alloc_swapdev_block(int swap) | ||
| 101 | { | ||
| 102 | unsigned long offset; | ||
| 103 | |||
| 104 | offset = swp_offset(get_swap_page_of_type(swap)); | ||
| 105 | if (offset) { | ||
| 106 | if (swsusp_extents_insert(offset)) | ||
| 107 | swap_free(swp_entry(swap, offset)); | ||
| 108 | else | ||
| 109 | return swapdev_block(swap, offset); | ||
| 110 | } | ||
| 111 | return 0; | ||
| 112 | } | ||
| 113 | |||
| 114 | /** | ||
| 115 | * free_all_swap_pages - free swap pages allocated for saving image data. | ||
| 116 | * It also frees the extents used to register which swap entres had been | ||
| 117 | * allocated. | ||
| 118 | */ | ||
| 119 | |||
| 120 | void free_all_swap_pages(int swap) | ||
| 121 | { | ||
| 122 | struct rb_node *node; | ||
| 123 | |||
| 124 | while ((node = swsusp_extents.rb_node)) { | ||
| 125 | struct swsusp_extent *ext; | ||
| 126 | unsigned long offset; | ||
| 127 | |||
| 128 | ext = container_of(node, struct swsusp_extent, node); | ||
| 129 | rb_erase(node, &swsusp_extents); | ||
| 130 | for (offset = ext->start; offset <= ext->end; offset++) | ||
| 131 | swap_free(swp_entry(swap, offset)); | ||
| 132 | |||
| 133 | kfree(ext); | ||
| 134 | } | ||
| 135 | } | ||
| 136 | |||
| 137 | int swsusp_swap_in_use(void) | ||
| 138 | { | ||
| 139 | return (swsusp_extents.rb_node != NULL); | ||
| 140 | } | ||
| 141 | |||
| 41 | /* | 142 | /* |
| 42 | * General things | 143 | * General things |
| 43 | */ | 144 | */ |
| @@ -336,7 +437,7 @@ static int save_image(struct swap_map_handle *handle, | |||
| 336 | if (ret) | 437 | if (ret) |
| 337 | break; | 438 | break; |
| 338 | if (!(nr_pages % m)) | 439 | if (!(nr_pages % m)) |
| 339 | printk("\b\b\b\b%3d%%", nr_pages / m); | 440 | printk(KERN_CONT "\b\b\b\b%3d%%", nr_pages / m); |
| 340 | nr_pages++; | 441 | nr_pages++; |
| 341 | } | 442 | } |
| 342 | err2 = wait_on_bio_chain(&bio); | 443 | err2 = wait_on_bio_chain(&bio); |
| @@ -344,9 +445,9 @@ static int save_image(struct swap_map_handle *handle, | |||
| 344 | if (!ret) | 445 | if (!ret) |
| 345 | ret = err2; | 446 | ret = err2; |
| 346 | if (!ret) | 447 | if (!ret) |
| 347 | printk("\b\b\b\bdone\n"); | 448 | printk(KERN_CONT "\b\b\b\bdone\n"); |
| 348 | else | 449 | else |
| 349 | printk("\n"); | 450 | printk(KERN_CONT "\n"); |
| 350 | swsusp_show_speed(&start, &stop, nr_to_write, "Wrote"); | 451 | swsusp_show_speed(&start, &stop, nr_to_write, "Wrote"); |
| 351 | return ret; | 452 | return ret; |
| 352 | } | 453 | } |
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c index 6a07f4dbf2f8..5b3601bd1893 100644 --- a/kernel/power/swsusp.c +++ b/kernel/power/swsusp.c | |||
| @@ -56,133 +56,3 @@ | |||
| 56 | #include "power.h" | 56 | #include "power.h" |
| 57 | 57 | ||
| 58 | int in_suspend __nosavedata = 0; | 58 | int in_suspend __nosavedata = 0; |
| 59 | |||
| 60 | /** | ||
| 61 | * The following functions are used for tracing the allocated | ||
| 62 | * swap pages, so that they can be freed in case of an error. | ||
| 63 | */ | ||
| 64 | |||
| 65 | struct swsusp_extent { | ||
| 66 | struct rb_node node; | ||
| 67 | unsigned long start; | ||
| 68 | unsigned long end; | ||
| 69 | }; | ||
| 70 | |||
| 71 | static struct rb_root swsusp_extents = RB_ROOT; | ||
| 72 | |||
| 73 | static int swsusp_extents_insert(unsigned long swap_offset) | ||
| 74 | { | ||
| 75 | struct rb_node **new = &(swsusp_extents.rb_node); | ||
| 76 | struct rb_node *parent = NULL; | ||
| 77 | struct swsusp_extent *ext; | ||
| 78 | |||
| 79 | /* Figure out where to put the new node */ | ||
| 80 | while (*new) { | ||
| 81 | ext = container_of(*new, struct swsusp_extent, node); | ||
| 82 | parent = *new; | ||
| 83 | if (swap_offset < ext->start) { | ||
| 84 | /* Try to merge */ | ||
| 85 | if (swap_offset == ext->start - 1) { | ||
| 86 | ext->start--; | ||
| 87 | return 0; | ||
| 88 | } | ||
| 89 | new = &((*new)->rb_left); | ||
| 90 | } else if (swap_offset > ext->end) { | ||
| 91 | /* Try to merge */ | ||
| 92 | if (swap_offset == ext->end + 1) { | ||
| 93 | ext->end++; | ||
| 94 | return 0; | ||
| 95 | } | ||
| 96 | new = &((*new)->rb_right); | ||
| 97 | } else { | ||
| 98 | /* It already is in the tree */ | ||
| 99 | return -EINVAL; | ||
| 100 | } | ||
| 101 | } | ||
| 102 | /* Add the new node and rebalance the tree. */ | ||
| 103 | ext = kzalloc(sizeof(struct swsusp_extent), GFP_KERNEL); | ||
| 104 | if (!ext) | ||
| 105 | return -ENOMEM; | ||
| 106 | |||
| 107 | ext->start = swap_offset; | ||
| 108 | ext->end = swap_offset; | ||
| 109 | rb_link_node(&ext->node, parent, new); | ||
| 110 | rb_insert_color(&ext->node, &swsusp_extents); | ||
| 111 | return 0; | ||
| 112 | } | ||
| 113 | |||
| 114 | /** | ||
| 115 | * alloc_swapdev_block - allocate a swap page and register that it has | ||
| 116 | * been allocated, so that it can be freed in case of an error. | ||
| 117 | */ | ||
| 118 | |||
| 119 | sector_t alloc_swapdev_block(int swap) | ||
| 120 | { | ||
| 121 | unsigned long offset; | ||
| 122 | |||
| 123 | offset = swp_offset(get_swap_page_of_type(swap)); | ||
| 124 | if (offset) { | ||
| 125 | if (swsusp_extents_insert(offset)) | ||
| 126 | swap_free(swp_entry(swap, offset)); | ||
| 127 | else | ||
| 128 | return swapdev_block(swap, offset); | ||
| 129 | } | ||
| 130 | return 0; | ||
| 131 | } | ||
| 132 | |||
| 133 | /** | ||
| 134 | * free_all_swap_pages - free swap pages allocated for saving image data. | ||
| 135 | * It also frees the extents used to register which swap entres had been | ||
| 136 | * allocated. | ||
| 137 | */ | ||
| 138 | |||
| 139 | void free_all_swap_pages(int swap) | ||
| 140 | { | ||
| 141 | struct rb_node *node; | ||
| 142 | |||
| 143 | while ((node = swsusp_extents.rb_node)) { | ||
| 144 | struct swsusp_extent *ext; | ||
| 145 | unsigned long offset; | ||
| 146 | |||
| 147 | ext = container_of(node, struct swsusp_extent, node); | ||
| 148 | rb_erase(node, &swsusp_extents); | ||
| 149 | for (offset = ext->start; offset <= ext->end; offset++) | ||
| 150 | swap_free(swp_entry(swap, offset)); | ||
| 151 | |||
| 152 | kfree(ext); | ||
| 153 | } | ||
| 154 | } | ||
| 155 | |||
| 156 | int swsusp_swap_in_use(void) | ||
| 157 | { | ||
| 158 | return (swsusp_extents.rb_node != NULL); | ||
| 159 | } | ||
| 160 | |||
| 161 | /** | ||
| 162 | * swsusp_show_speed - print the time elapsed between two events represented by | ||
| 163 | * @start and @stop | ||
| 164 | * | ||
| 165 | * @nr_pages - number of pages processed between @start and @stop | ||
| 166 | * @msg - introductory message to print | ||
| 167 | */ | ||
| 168 | |||
| 169 | void swsusp_show_speed(struct timeval *start, struct timeval *stop, | ||
| 170 | unsigned nr_pages, char *msg) | ||
| 171 | { | ||
| 172 | s64 elapsed_centisecs64; | ||
| 173 | int centisecs; | ||
| 174 | int k; | ||
| 175 | int kps; | ||
| 176 | |||
| 177 | elapsed_centisecs64 = timeval_to_ns(stop) - timeval_to_ns(start); | ||
| 178 | do_div(elapsed_centisecs64, NSEC_PER_SEC / 100); | ||
| 179 | centisecs = elapsed_centisecs64; | ||
| 180 | if (centisecs == 0) | ||
| 181 | centisecs = 1; /* avoid div-by-zero */ | ||
| 182 | k = nr_pages * (PAGE_SIZE / 1024); | ||
| 183 | kps = (k * 100) / centisecs; | ||
| 184 | printk(KERN_INFO "PM: %s %d kbytes in %d.%02d seconds (%d.%02d MB/s)\n", | ||
| 185 | msg, k, | ||
| 186 | centisecs / 100, centisecs % 100, | ||
| 187 | kps / 1000, (kps % 1000) / 10); | ||
| 188 | } | ||
diff --git a/kernel/sched.c b/kernel/sched.c index aa31244caa9f..e7f2cfa6a257 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
| @@ -7444,17 +7444,16 @@ static struct ctl_table sd_ctl_dir[] = { | |||
| 7444 | .procname = "sched_domain", | 7444 | .procname = "sched_domain", |
| 7445 | .mode = 0555, | 7445 | .mode = 0555, |
| 7446 | }, | 7446 | }, |
| 7447 | {0, }, | 7447 | {} |
| 7448 | }; | 7448 | }; |
| 7449 | 7449 | ||
| 7450 | static struct ctl_table sd_ctl_root[] = { | 7450 | static struct ctl_table sd_ctl_root[] = { |
| 7451 | { | 7451 | { |
| 7452 | .ctl_name = CTL_KERN, | ||
| 7453 | .procname = "kernel", | 7452 | .procname = "kernel", |
| 7454 | .mode = 0555, | 7453 | .mode = 0555, |
| 7455 | .child = sd_ctl_dir, | 7454 | .child = sd_ctl_dir, |
| 7456 | }, | 7455 | }, |
| 7457 | {0, }, | 7456 | {} |
| 7458 | }; | 7457 | }; |
| 7459 | 7458 | ||
| 7460 | static struct ctl_table *sd_alloc_ctl_entry(int n) | 7459 | static struct ctl_table *sd_alloc_ctl_entry(int n) |
diff --git a/kernel/slow-work.c b/kernel/slow-work.c index 00889bd3c590..7494bbf5a270 100644 --- a/kernel/slow-work.c +++ b/kernel/slow-work.c | |||
| @@ -49,7 +49,6 @@ static const int slow_work_max_vslow = 99; | |||
| 49 | 49 | ||
| 50 | ctl_table slow_work_sysctls[] = { | 50 | ctl_table slow_work_sysctls[] = { |
| 51 | { | 51 | { |
| 52 | .ctl_name = CTL_UNNUMBERED, | ||
| 53 | .procname = "min-threads", | 52 | .procname = "min-threads", |
| 54 | .data = &slow_work_min_threads, | 53 | .data = &slow_work_min_threads, |
| 55 | .maxlen = sizeof(unsigned), | 54 | .maxlen = sizeof(unsigned), |
| @@ -59,7 +58,6 @@ ctl_table slow_work_sysctls[] = { | |||
| 59 | .extra2 = &slow_work_max_threads, | 58 | .extra2 = &slow_work_max_threads, |
| 60 | }, | 59 | }, |
| 61 | { | 60 | { |
| 62 | .ctl_name = CTL_UNNUMBERED, | ||
| 63 | .procname = "max-threads", | 61 | .procname = "max-threads", |
| 64 | .data = &slow_work_max_threads, | 62 | .data = &slow_work_max_threads, |
| 65 | .maxlen = sizeof(unsigned), | 63 | .maxlen = sizeof(unsigned), |
| @@ -69,16 +67,15 @@ ctl_table slow_work_sysctls[] = { | |||
| 69 | .extra2 = (void *) &slow_work_max_max_threads, | 67 | .extra2 = (void *) &slow_work_max_max_threads, |
| 70 | }, | 68 | }, |
| 71 | { | 69 | { |
| 72 | .ctl_name = CTL_UNNUMBERED, | ||
| 73 | .procname = "vslow-percentage", | 70 | .procname = "vslow-percentage", |
| 74 | .data = &vslow_work_proportion, | 71 | .data = &vslow_work_proportion, |
| 75 | .maxlen = sizeof(unsigned), | 72 | .maxlen = sizeof(unsigned), |
| 76 | .mode = 0644, | 73 | .mode = 0644, |
| 77 | .proc_handler = &proc_dointvec_minmax, | 74 | .proc_handler = proc_dointvec_minmax, |
| 78 | .extra1 = (void *) &slow_work_min_vslow, | 75 | .extra1 = (void *) &slow_work_min_vslow, |
| 79 | .extra2 = (void *) &slow_work_max_vslow, | 76 | .extra2 = (void *) &slow_work_max_vslow, |
| 80 | }, | 77 | }, |
| 81 | { .ctl_name = 0 } | 78 | {} |
| 82 | }; | 79 | }; |
| 83 | #endif | 80 | #endif |
| 84 | 81 | ||
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c index e06d0b8d1951..695384f12a7d 100644 --- a/kernel/sys_ni.c +++ b/kernel/sys_ni.c | |||
| @@ -48,8 +48,10 @@ cond_syscall(sys_shutdown); | |||
| 48 | cond_syscall(sys_sendmsg); | 48 | cond_syscall(sys_sendmsg); |
| 49 | cond_syscall(compat_sys_sendmsg); | 49 | cond_syscall(compat_sys_sendmsg); |
| 50 | cond_syscall(sys_recvmsg); | 50 | cond_syscall(sys_recvmsg); |
| 51 | cond_syscall(sys_recvmmsg); | ||
| 51 | cond_syscall(compat_sys_recvmsg); | 52 | cond_syscall(compat_sys_recvmsg); |
| 52 | cond_syscall(compat_sys_recvfrom); | 53 | cond_syscall(compat_sys_recvfrom); |
| 54 | cond_syscall(compat_sys_recvmmsg); | ||
| 53 | cond_syscall(sys_socketcall); | 55 | cond_syscall(sys_socketcall); |
| 54 | cond_syscall(sys_futex); | 56 | cond_syscall(sys_futex); |
| 55 | cond_syscall(compat_sys_futex); | 57 | cond_syscall(compat_sys_futex); |
| @@ -139,7 +141,6 @@ cond_syscall(sys_pciconfig_read); | |||
| 139 | cond_syscall(sys_pciconfig_write); | 141 | cond_syscall(sys_pciconfig_write); |
| 140 | cond_syscall(sys_pciconfig_iobase); | 142 | cond_syscall(sys_pciconfig_iobase); |
| 141 | cond_syscall(sys32_ipc); | 143 | cond_syscall(sys32_ipc); |
| 142 | cond_syscall(sys32_sysctl); | ||
| 143 | cond_syscall(ppc_rtas); | 144 | cond_syscall(ppc_rtas); |
| 144 | cond_syscall(sys_spu_run); | 145 | cond_syscall(sys_spu_run); |
| 145 | cond_syscall(sys_spu_create); | 146 | cond_syscall(sys_spu_create); |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 4dbf93a52ee9..9327a26765c5 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> |
| @@ -61,7 +60,6 @@ | |||
| 61 | #include <asm/io.h> | 60 | #include <asm/io.h> |
| 62 | #endif | 61 | #endif |
| 63 | 62 | ||
| 64 | static int deprecated_sysctl_warning(struct __sysctl_args *args); | ||
| 65 | 63 | ||
| 66 | #if defined(CONFIG_SYSCTL) | 64 | #if defined(CONFIG_SYSCTL) |
| 67 | 65 | ||
| @@ -210,31 +208,26 @@ extern int lock_stat; | |||
| 210 | 208 | ||
| 211 | static struct ctl_table root_table[] = { | 209 | static struct ctl_table root_table[] = { |
| 212 | { | 210 | { |
| 213 | .ctl_name = CTL_KERN, | ||
| 214 | .procname = "kernel", | 211 | .procname = "kernel", |
| 215 | .mode = 0555, | 212 | .mode = 0555, |
| 216 | .child = kern_table, | 213 | .child = kern_table, |
| 217 | }, | 214 | }, |
| 218 | { | 215 | { |
| 219 | .ctl_name = CTL_VM, | ||
| 220 | .procname = "vm", | 216 | .procname = "vm", |
| 221 | .mode = 0555, | 217 | .mode = 0555, |
| 222 | .child = vm_table, | 218 | .child = vm_table, |
| 223 | }, | 219 | }, |
| 224 | { | 220 | { |
| 225 | .ctl_name = CTL_FS, | ||
| 226 | .procname = "fs", | 221 | .procname = "fs", |
| 227 | .mode = 0555, | 222 | .mode = 0555, |
| 228 | .child = fs_table, | 223 | .child = fs_table, |
| 229 | }, | 224 | }, |
| 230 | { | 225 | { |
| 231 | .ctl_name = CTL_DEBUG, | ||
| 232 | .procname = "debug", | 226 | .procname = "debug", |
| 233 | .mode = 0555, | 227 | .mode = 0555, |
| 234 | .child = debug_table, | 228 | .child = debug_table, |
| 235 | }, | 229 | }, |
| 236 | { | 230 | { |
| 237 | .ctl_name = CTL_DEV, | ||
| 238 | .procname = "dev", | 231 | .procname = "dev", |
| 239 | .mode = 0555, | 232 | .mode = 0555, |
| 240 | .child = dev_table, | 233 | .child = dev_table, |
| @@ -243,7 +236,7 @@ static struct ctl_table root_table[] = { | |||
| 243 | * NOTE: do not add new entries to this table unless you have read | 236 | * NOTE: do not add new entries to this table unless you have read |
| 244 | * Documentation/sysctl/ctl_unnumbered.txt | 237 | * Documentation/sysctl/ctl_unnumbered.txt |
| 245 | */ | 238 | */ |
| 246 | { .ctl_name = 0 } | 239 | { } |
| 247 | }; | 240 | }; |
| 248 | 241 | ||
| 249 | #ifdef CONFIG_SCHED_DEBUG | 242 | #ifdef CONFIG_SCHED_DEBUG |
| @@ -255,192 +248,166 @@ static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ | |||
| 255 | 248 | ||
| 256 | static struct ctl_table kern_table[] = { | 249 | static struct ctl_table kern_table[] = { |
| 257 | { | 250 | { |
| 258 | .ctl_name = CTL_UNNUMBERED, | ||
| 259 | .procname = "sched_child_runs_first", | 251 | .procname = "sched_child_runs_first", |
| 260 | .data = &sysctl_sched_child_runs_first, | 252 | .data = &sysctl_sched_child_runs_first, |
| 261 | .maxlen = sizeof(unsigned int), | 253 | .maxlen = sizeof(unsigned int), |
| 262 | .mode = 0644, | 254 | .mode = 0644, |
| 263 | .proc_handler = &proc_dointvec, | 255 | .proc_handler = proc_dointvec, |
| 264 | }, | 256 | }, |
| 265 | #ifdef CONFIG_SCHED_DEBUG | 257 | #ifdef CONFIG_SCHED_DEBUG |
| 266 | { | 258 | { |
| 267 | .ctl_name = CTL_UNNUMBERED, | ||
| 268 | .procname = "sched_min_granularity_ns", | 259 | .procname = "sched_min_granularity_ns", |
| 269 | .data = &sysctl_sched_min_granularity, | 260 | .data = &sysctl_sched_min_granularity, |
| 270 | .maxlen = sizeof(unsigned int), | 261 | .maxlen = sizeof(unsigned int), |
| 271 | .mode = 0644, | 262 | .mode = 0644, |
| 272 | .proc_handler = &sched_nr_latency_handler, | 263 | .proc_handler = sched_nr_latency_handler, |
| 273 | .strategy = &sysctl_intvec, | ||
| 274 | .extra1 = &min_sched_granularity_ns, | 264 | .extra1 = &min_sched_granularity_ns, |
| 275 | .extra2 = &max_sched_granularity_ns, | 265 | .extra2 = &max_sched_granularity_ns, |
| 276 | }, | 266 | }, |
| 277 | { | 267 | { |
| 278 | .ctl_name = CTL_UNNUMBERED, | ||
| 279 | .procname = "sched_latency_ns", | 268 | .procname = "sched_latency_ns", |
| 280 | .data = &sysctl_sched_latency, | 269 | .data = &sysctl_sched_latency, |
| 281 | .maxlen = sizeof(unsigned int), | 270 | .maxlen = sizeof(unsigned int), |
| 282 | .mode = 0644, | 271 | .mode = 0644, |
| 283 | .proc_handler = &sched_nr_latency_handler, | 272 | .proc_handler = sched_nr_latency_handler, |
| 284 | .strategy = &sysctl_intvec, | ||
| 285 | .extra1 = &min_sched_granularity_ns, | 273 | .extra1 = &min_sched_granularity_ns, |
| 286 | .extra2 = &max_sched_granularity_ns, | 274 | .extra2 = &max_sched_granularity_ns, |
| 287 | }, | 275 | }, |
| 288 | { | 276 | { |
| 289 | .ctl_name = CTL_UNNUMBERED, | ||
| 290 | .procname = "sched_wakeup_granularity_ns", | 277 | .procname = "sched_wakeup_granularity_ns", |
| 291 | .data = &sysctl_sched_wakeup_granularity, | 278 | .data = &sysctl_sched_wakeup_granularity, |
| 292 | .maxlen = sizeof(unsigned int), | 279 | .maxlen = sizeof(unsigned int), |
| 293 | .mode = 0644, | 280 | .mode = 0644, |
| 294 | .proc_handler = &proc_dointvec_minmax, | 281 | .proc_handler = proc_dointvec_minmax, |
| 295 | .strategy = &sysctl_intvec, | ||
| 296 | .extra1 = &min_wakeup_granularity_ns, | 282 | .extra1 = &min_wakeup_granularity_ns, |
| 297 | .extra2 = &max_wakeup_granularity_ns, | 283 | .extra2 = &max_wakeup_granularity_ns, |
| 298 | }, | 284 | }, |
| 299 | { | 285 | { |
| 300 | .ctl_name = CTL_UNNUMBERED, | ||
| 301 | .procname = "sched_shares_ratelimit", | 286 | .procname = "sched_shares_ratelimit", |
| 302 | .data = &sysctl_sched_shares_ratelimit, | 287 | .data = &sysctl_sched_shares_ratelimit, |
| 303 | .maxlen = sizeof(unsigned int), | 288 | .maxlen = sizeof(unsigned int), |
| 304 | .mode = 0644, | 289 | .mode = 0644, |
| 305 | .proc_handler = &proc_dointvec, | 290 | .proc_handler = proc_dointvec, |
| 306 | }, | 291 | }, |
| 307 | { | 292 | { |
| 308 | .ctl_name = CTL_UNNUMBERED, | ||
| 309 | .procname = "sched_shares_thresh", | 293 | .procname = "sched_shares_thresh", |
| 310 | .data = &sysctl_sched_shares_thresh, | 294 | .data = &sysctl_sched_shares_thresh, |
| 311 | .maxlen = sizeof(unsigned int), | 295 | .maxlen = sizeof(unsigned int), |
| 312 | .mode = 0644, | 296 | .mode = 0644, |
| 313 | .proc_handler = &proc_dointvec_minmax, | 297 | .proc_handler = proc_dointvec_minmax, |
| 314 | .strategy = &sysctl_intvec, | ||
| 315 | .extra1 = &zero, | 298 | .extra1 = &zero, |
| 316 | }, | 299 | }, |
| 317 | { | 300 | { |
| 318 | .ctl_name = CTL_UNNUMBERED, | ||
| 319 | .procname = "sched_features", | 301 | .procname = "sched_features", |
| 320 | .data = &sysctl_sched_features, | 302 | .data = &sysctl_sched_features, |
| 321 | .maxlen = sizeof(unsigned int), | 303 | .maxlen = sizeof(unsigned int), |
| 322 | .mode = 0644, | 304 | .mode = 0644, |
| 323 | .proc_handler = &proc_dointvec, | 305 | .proc_handler = proc_dointvec, |
| 324 | }, | 306 | }, |
| 325 | { | 307 | { |
| 326 | .ctl_name = CTL_UNNUMBERED, | ||
| 327 | .procname = "sched_migration_cost", | 308 | .procname = "sched_migration_cost", |
| 328 | .data = &sysctl_sched_migration_cost, | 309 | .data = &sysctl_sched_migration_cost, |
| 329 | .maxlen = sizeof(unsigned int), | 310 | .maxlen = sizeof(unsigned int), |
| 330 | .mode = 0644, | 311 | .mode = 0644, |
| 331 | .proc_handler = &proc_dointvec, | 312 | .proc_handler = proc_dointvec, |
| 332 | }, | 313 | }, |
| 333 | { | 314 | { |
| 334 | .ctl_name = CTL_UNNUMBERED, | ||
| 335 | .procname = "sched_nr_migrate", | 315 | .procname = "sched_nr_migrate", |
| 336 | .data = &sysctl_sched_nr_migrate, | 316 | .data = &sysctl_sched_nr_migrate, |
| 337 | .maxlen = sizeof(unsigned int), | 317 | .maxlen = sizeof(unsigned int), |
| 338 | .mode = 0644, | 318 | .mode = 0644, |
| 339 | .proc_handler = &proc_dointvec, | 319 | .proc_handler = proc_dointvec, |
| 340 | }, | 320 | }, |
| 341 | { | 321 | { |
| 342 | .ctl_name = CTL_UNNUMBERED, | ||
| 343 | .procname = "sched_time_avg", | 322 | .procname = "sched_time_avg", |
| 344 | .data = &sysctl_sched_time_avg, | 323 | .data = &sysctl_sched_time_avg, |
| 345 | .maxlen = sizeof(unsigned int), | 324 | .maxlen = sizeof(unsigned int), |
| 346 | .mode = 0644, | 325 | .mode = 0644, |
| 347 | .proc_handler = &proc_dointvec, | 326 | .proc_handler = proc_dointvec, |
| 348 | }, | 327 | }, |
| 349 | { | 328 | { |
| 350 | .ctl_name = CTL_UNNUMBERED, | ||
| 351 | .procname = "timer_migration", | 329 | .procname = "timer_migration", |
| 352 | .data = &sysctl_timer_migration, | 330 | .data = &sysctl_timer_migration, |
| 353 | .maxlen = sizeof(unsigned int), | 331 | .maxlen = sizeof(unsigned int), |
| 354 | .mode = 0644, | 332 | .mode = 0644, |
| 355 | .proc_handler = &proc_dointvec_minmax, | 333 | .proc_handler = proc_dointvec_minmax, |
| 356 | .strategy = &sysctl_intvec, | ||
| 357 | .extra1 = &zero, | 334 | .extra1 = &zero, |
| 358 | .extra2 = &one, | 335 | .extra2 = &one, |
| 359 | }, | 336 | }, |
| 360 | #endif | 337 | #endif |
| 361 | { | 338 | { |
| 362 | .ctl_name = CTL_UNNUMBERED, | ||
| 363 | .procname = "sched_rt_period_us", | 339 | .procname = "sched_rt_period_us", |
| 364 | .data = &sysctl_sched_rt_period, | 340 | .data = &sysctl_sched_rt_period, |
| 365 | .maxlen = sizeof(unsigned int), | 341 | .maxlen = sizeof(unsigned int), |
| 366 | .mode = 0644, | 342 | .mode = 0644, |
| 367 | .proc_handler = &sched_rt_handler, | 343 | .proc_handler = sched_rt_handler, |
| 368 | }, | 344 | }, |
| 369 | { | 345 | { |
| 370 | .ctl_name = CTL_UNNUMBERED, | ||
| 371 | .procname = "sched_rt_runtime_us", | 346 | .procname = "sched_rt_runtime_us", |
| 372 | .data = &sysctl_sched_rt_runtime, | 347 | .data = &sysctl_sched_rt_runtime, |
| 373 | .maxlen = sizeof(int), | 348 | .maxlen = sizeof(int), |
| 374 | .mode = 0644, | 349 | .mode = 0644, |
| 375 | .proc_handler = &sched_rt_handler, | 350 | .proc_handler = sched_rt_handler, |
| 376 | }, | 351 | }, |
| 377 | { | 352 | { |
| 378 | .ctl_name = CTL_UNNUMBERED, | ||
| 379 | .procname = "sched_compat_yield", | 353 | .procname = "sched_compat_yield", |
| 380 | .data = &sysctl_sched_compat_yield, | 354 | .data = &sysctl_sched_compat_yield, |
| 381 | .maxlen = sizeof(unsigned int), | 355 | .maxlen = sizeof(unsigned int), |
| 382 | .mode = 0644, | 356 | .mode = 0644, |
| 383 | .proc_handler = &proc_dointvec, | 357 | .proc_handler = proc_dointvec, |
| 384 | }, | 358 | }, |
| 385 | #ifdef CONFIG_PROVE_LOCKING | 359 | #ifdef CONFIG_PROVE_LOCKING |
| 386 | { | 360 | { |
| 387 | .ctl_name = CTL_UNNUMBERED, | ||
| 388 | .procname = "prove_locking", | 361 | .procname = "prove_locking", |
| 389 | .data = &prove_locking, | 362 | .data = &prove_locking, |
| 390 | .maxlen = sizeof(int), | 363 | .maxlen = sizeof(int), |
| 391 | .mode = 0644, | 364 | .mode = 0644, |
| 392 | .proc_handler = &proc_dointvec, | 365 | .proc_handler = proc_dointvec, |
| 393 | }, | 366 | }, |
| 394 | #endif | 367 | #endif |
| 395 | #ifdef CONFIG_LOCK_STAT | 368 | #ifdef CONFIG_LOCK_STAT |
| 396 | { | 369 | { |
| 397 | .ctl_name = CTL_UNNUMBERED, | ||
| 398 | .procname = "lock_stat", | 370 | .procname = "lock_stat", |
| 399 | .data = &lock_stat, | 371 | .data = &lock_stat, |
| 400 | .maxlen = sizeof(int), | 372 | .maxlen = sizeof(int), |
| 401 | .mode = 0644, | 373 | .mode = 0644, |
| 402 | .proc_handler = &proc_dointvec, | 374 | .proc_handler = proc_dointvec, |
| 403 | }, | 375 | }, |
| 404 | #endif | 376 | #endif |
| 405 | { | 377 | { |
| 406 | .ctl_name = KERN_PANIC, | ||
| 407 | .procname = "panic", | 378 | .procname = "panic", |
| 408 | .data = &panic_timeout, | 379 | .data = &panic_timeout, |
| 409 | .maxlen = sizeof(int), | 380 | .maxlen = sizeof(int), |
| 410 | .mode = 0644, | 381 | .mode = 0644, |
| 411 | .proc_handler = &proc_dointvec, | 382 | .proc_handler = proc_dointvec, |
| 412 | }, | 383 | }, |
| 413 | { | 384 | { |
| 414 | .ctl_name = KERN_CORE_USES_PID, | ||
| 415 | .procname = "core_uses_pid", | 385 | .procname = "core_uses_pid", |
| 416 | .data = &core_uses_pid, | 386 | .data = &core_uses_pid, |
| 417 | .maxlen = sizeof(int), | 387 | .maxlen = sizeof(int), |
| 418 | .mode = 0644, | 388 | .mode = 0644, |
| 419 | .proc_handler = &proc_dointvec, | 389 | .proc_handler = proc_dointvec, |
| 420 | }, | 390 | }, |
| 421 | { | 391 | { |
| 422 | .ctl_name = KERN_CORE_PATTERN, | ||
| 423 | .procname = "core_pattern", | 392 | .procname = "core_pattern", |
| 424 | .data = core_pattern, | 393 | .data = core_pattern, |
| 425 | .maxlen = CORENAME_MAX_SIZE, | 394 | .maxlen = CORENAME_MAX_SIZE, |
| 426 | .mode = 0644, | 395 | .mode = 0644, |
| 427 | .proc_handler = &proc_dostring, | 396 | .proc_handler = proc_dostring, |
| 428 | .strategy = &sysctl_string, | ||
| 429 | }, | 397 | }, |
| 430 | { | 398 | { |
| 431 | .ctl_name = CTL_UNNUMBERED, | ||
| 432 | .procname = "core_pipe_limit", | 399 | .procname = "core_pipe_limit", |
| 433 | .data = &core_pipe_limit, | 400 | .data = &core_pipe_limit, |
| 434 | .maxlen = sizeof(unsigned int), | 401 | .maxlen = sizeof(unsigned int), |
| 435 | .mode = 0644, | 402 | .mode = 0644, |
| 436 | .proc_handler = &proc_dointvec, | 403 | .proc_handler = proc_dointvec, |
| 437 | }, | 404 | }, |
| 438 | #ifdef CONFIG_PROC_SYSCTL | 405 | #ifdef CONFIG_PROC_SYSCTL |
| 439 | { | 406 | { |
| 440 | .procname = "tainted", | 407 | .procname = "tainted", |
| 441 | .maxlen = sizeof(long), | 408 | .maxlen = sizeof(long), |
| 442 | .mode = 0644, | 409 | .mode = 0644, |
| 443 | .proc_handler = &proc_taint, | 410 | .proc_handler = proc_taint, |
| 444 | }, | 411 | }, |
| 445 | #endif | 412 | #endif |
| 446 | #ifdef CONFIG_LATENCYTOP | 413 | #ifdef CONFIG_LATENCYTOP |
| @@ -449,181 +416,160 @@ static struct ctl_table kern_table[] = { | |||
| 449 | .data = &latencytop_enabled, | 416 | .data = &latencytop_enabled, |
| 450 | .maxlen = sizeof(int), | 417 | .maxlen = sizeof(int), |
| 451 | .mode = 0644, | 418 | .mode = 0644, |
| 452 | .proc_handler = &proc_dointvec, | 419 | .proc_handler = proc_dointvec, |
| 453 | }, | 420 | }, |
| 454 | #endif | 421 | #endif |
| 455 | #ifdef CONFIG_BLK_DEV_INITRD | 422 | #ifdef CONFIG_BLK_DEV_INITRD |
| 456 | { | 423 | { |
| 457 | .ctl_name = KERN_REALROOTDEV, | ||
| 458 | .procname = "real-root-dev", | 424 | .procname = "real-root-dev", |
| 459 | .data = &real_root_dev, | 425 | .data = &real_root_dev, |
| 460 | .maxlen = sizeof(int), | 426 | .maxlen = sizeof(int), |
| 461 | .mode = 0644, | 427 | .mode = 0644, |
| 462 | .proc_handler = &proc_dointvec, | 428 | .proc_handler = proc_dointvec, |
| 463 | }, | 429 | }, |
| 464 | #endif | 430 | #endif |
| 465 | { | 431 | { |
| 466 | .ctl_name = CTL_UNNUMBERED, | ||
| 467 | .procname = "print-fatal-signals", | 432 | .procname = "print-fatal-signals", |
| 468 | .data = &print_fatal_signals, | 433 | .data = &print_fatal_signals, |
| 469 | .maxlen = sizeof(int), | 434 | .maxlen = sizeof(int), |
| 470 | .mode = 0644, | 435 | .mode = 0644, |
| 471 | .proc_handler = &proc_dointvec, | 436 | .proc_handler = proc_dointvec, |
| 472 | }, | 437 | }, |
| 473 | #ifdef CONFIG_SPARC | 438 | #ifdef CONFIG_SPARC |
| 474 | { | 439 | { |
| 475 | .ctl_name = KERN_SPARC_REBOOT, | ||
| 476 | .procname = "reboot-cmd", | 440 | .procname = "reboot-cmd", |
| 477 | .data = reboot_command, | 441 | .data = reboot_command, |
| 478 | .maxlen = 256, | 442 | .maxlen = 256, |
| 479 | .mode = 0644, | 443 | .mode = 0644, |
| 480 | .proc_handler = &proc_dostring, | 444 | .proc_handler = proc_dostring, |
| 481 | .strategy = &sysctl_string, | ||
| 482 | }, | 445 | }, |
| 483 | { | 446 | { |
| 484 | .ctl_name = KERN_SPARC_STOP_A, | ||
| 485 | .procname = "stop-a", | 447 | .procname = "stop-a", |
| 486 | .data = &stop_a_enabled, | 448 | .data = &stop_a_enabled, |
| 487 | .maxlen = sizeof (int), | 449 | .maxlen = sizeof (int), |
| 488 | .mode = 0644, | 450 | .mode = 0644, |
| 489 | .proc_handler = &proc_dointvec, | 451 | .proc_handler = proc_dointvec, |
| 490 | }, | 452 | }, |
| 491 | { | 453 | { |
| 492 | .ctl_name = KERN_SPARC_SCONS_PWROFF, | ||
| 493 | .procname = "scons-poweroff", | 454 | .procname = "scons-poweroff", |
| 494 | .data = &scons_pwroff, | 455 | .data = &scons_pwroff, |
| 495 | .maxlen = sizeof (int), | 456 | .maxlen = sizeof (int), |
| 496 | .mode = 0644, | 457 | .mode = 0644, |
| 497 | .proc_handler = &proc_dointvec, | 458 | .proc_handler = proc_dointvec, |
| 498 | }, | 459 | }, |
| 499 | #endif | 460 | #endif |
| 500 | #ifdef CONFIG_SPARC64 | 461 | #ifdef CONFIG_SPARC64 |
| 501 | { | 462 | { |
| 502 | .ctl_name = CTL_UNNUMBERED, | ||
| 503 | .procname = "tsb-ratio", | 463 | .procname = "tsb-ratio", |
| 504 | .data = &sysctl_tsb_ratio, | 464 | .data = &sysctl_tsb_ratio, |
| 505 | .maxlen = sizeof (int), | 465 | .maxlen = sizeof (int), |
| 506 | .mode = 0644, | 466 | .mode = 0644, |
| 507 | .proc_handler = &proc_dointvec, | 467 | .proc_handler = proc_dointvec, |
| 508 | }, | 468 | }, |
| 509 | #endif | 469 | #endif |
| 510 | #ifdef __hppa__ | 470 | #ifdef __hppa__ |
| 511 | { | 471 | { |
| 512 | .ctl_name = KERN_HPPA_PWRSW, | ||
| 513 | .procname = "soft-power", | 472 | .procname = "soft-power", |
| 514 | .data = &pwrsw_enabled, | 473 | .data = &pwrsw_enabled, |
| 515 | .maxlen = sizeof (int), | 474 | .maxlen = sizeof (int), |
| 516 | .mode = 0644, | 475 | .mode = 0644, |
| 517 | .proc_handler = &proc_dointvec, | 476 | .proc_handler = proc_dointvec, |
| 518 | }, | 477 | }, |
| 519 | { | 478 | { |
| 520 | .ctl_name = KERN_HPPA_UNALIGNED, | ||
| 521 | .procname = "unaligned-trap", | 479 | .procname = "unaligned-trap", |
| 522 | .data = &unaligned_enabled, | 480 | .data = &unaligned_enabled, |
| 523 | .maxlen = sizeof (int), | 481 | .maxlen = sizeof (int), |
| 524 | .mode = 0644, | 482 | .mode = 0644, |
| 525 | .proc_handler = &proc_dointvec, | 483 | .proc_handler = proc_dointvec, |
| 526 | }, | 484 | }, |
| 527 | #endif | 485 | #endif |
| 528 | { | 486 | { |
| 529 | .ctl_name = KERN_CTLALTDEL, | ||
| 530 | .procname = "ctrl-alt-del", | 487 | .procname = "ctrl-alt-del", |
| 531 | .data = &C_A_D, | 488 | .data = &C_A_D, |
| 532 | .maxlen = sizeof(int), | 489 | .maxlen = sizeof(int), |
| 533 | .mode = 0644, | 490 | .mode = 0644, |
| 534 | .proc_handler = &proc_dointvec, | 491 | .proc_handler = proc_dointvec, |
| 535 | }, | 492 | }, |
| 536 | #ifdef CONFIG_FUNCTION_TRACER | 493 | #ifdef CONFIG_FUNCTION_TRACER |
| 537 | { | 494 | { |
| 538 | .ctl_name = CTL_UNNUMBERED, | ||
| 539 | .procname = "ftrace_enabled", | 495 | .procname = "ftrace_enabled", |
| 540 | .data = &ftrace_enabled, | 496 | .data = &ftrace_enabled, |
| 541 | .maxlen = sizeof(int), | 497 | .maxlen = sizeof(int), |
| 542 | .mode = 0644, | 498 | .mode = 0644, |
| 543 | .proc_handler = &ftrace_enable_sysctl, | 499 | .proc_handler = ftrace_enable_sysctl, |
| 544 | }, | 500 | }, |
| 545 | #endif | 501 | #endif |
| 546 | #ifdef CONFIG_STACK_TRACER | 502 | #ifdef CONFIG_STACK_TRACER |
| 547 | { | 503 | { |
| 548 | .ctl_name = CTL_UNNUMBERED, | ||
| 549 | .procname = "stack_tracer_enabled", | 504 | .procname = "stack_tracer_enabled", |
| 550 | .data = &stack_tracer_enabled, | 505 | .data = &stack_tracer_enabled, |
| 551 | .maxlen = sizeof(int), | 506 | .maxlen = sizeof(int), |
| 552 | .mode = 0644, | 507 | .mode = 0644, |
| 553 | .proc_handler = &stack_trace_sysctl, | 508 | .proc_handler = stack_trace_sysctl, |
| 554 | }, | 509 | }, |
| 555 | #endif | 510 | #endif |
| 556 | #ifdef CONFIG_TRACING | 511 | #ifdef CONFIG_TRACING |
| 557 | { | 512 | { |
| 558 | .ctl_name = CTL_UNNUMBERED, | ||
| 559 | .procname = "ftrace_dump_on_oops", | 513 | .procname = "ftrace_dump_on_oops", |
| 560 | .data = &ftrace_dump_on_oops, | 514 | .data = &ftrace_dump_on_oops, |
| 561 | .maxlen = sizeof(int), | 515 | .maxlen = sizeof(int), |
| 562 | .mode = 0644, | 516 | .mode = 0644, |
| 563 | .proc_handler = &proc_dointvec, | 517 | .proc_handler = proc_dointvec, |
| 564 | }, | 518 | }, |
| 565 | #endif | 519 | #endif |
| 566 | #ifdef CONFIG_MODULES | 520 | #ifdef CONFIG_MODULES |
| 567 | { | 521 | { |
| 568 | .ctl_name = KERN_MODPROBE, | ||
| 569 | .procname = "modprobe", | 522 | .procname = "modprobe", |
| 570 | .data = &modprobe_path, | 523 | .data = &modprobe_path, |
| 571 | .maxlen = KMOD_PATH_LEN, | 524 | .maxlen = KMOD_PATH_LEN, |
| 572 | .mode = 0644, | 525 | .mode = 0644, |
| 573 | .proc_handler = &proc_dostring, | 526 | .proc_handler = proc_dostring, |
| 574 | .strategy = &sysctl_string, | ||
| 575 | }, | 527 | }, |
| 576 | { | 528 | { |
| 577 | .ctl_name = CTL_UNNUMBERED, | ||
| 578 | .procname = "modules_disabled", | 529 | .procname = "modules_disabled", |
| 579 | .data = &modules_disabled, | 530 | .data = &modules_disabled, |
| 580 | .maxlen = sizeof(int), | 531 | .maxlen = sizeof(int), |
| 581 | .mode = 0644, | 532 | .mode = 0644, |
| 582 | /* only handle a transition from default "0" to "1" */ | 533 | /* only handle a transition from default "0" to "1" */ |
| 583 | .proc_handler = &proc_dointvec_minmax, | 534 | .proc_handler = proc_dointvec_minmax, |
| 584 | .extra1 = &one, | 535 | .extra1 = &one, |
| 585 | .extra2 = &one, | 536 | .extra2 = &one, |
| 586 | }, | 537 | }, |
| 587 | #endif | 538 | #endif |
| 588 | #if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) | 539 | #if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) |
| 589 | { | 540 | { |
| 590 | .ctl_name = KERN_HOTPLUG, | ||
| 591 | .procname = "hotplug", | 541 | .procname = "hotplug", |
| 592 | .data = &uevent_helper, | 542 | .data = &uevent_helper, |
| 593 | .maxlen = UEVENT_HELPER_PATH_LEN, | 543 | .maxlen = UEVENT_HELPER_PATH_LEN, |
| 594 | .mode = 0644, | 544 | .mode = 0644, |
| 595 | .proc_handler = &proc_dostring, | 545 | .proc_handler = proc_dostring, |
| 596 | .strategy = &sysctl_string, | ||
| 597 | }, | 546 | }, |
| 598 | #endif | 547 | #endif |
| 599 | #ifdef CONFIG_CHR_DEV_SG | 548 | #ifdef CONFIG_CHR_DEV_SG |
| 600 | { | 549 | { |
| 601 | .ctl_name = KERN_SG_BIG_BUFF, | ||
| 602 | .procname = "sg-big-buff", | 550 | .procname = "sg-big-buff", |
| 603 | .data = &sg_big_buff, | 551 | .data = &sg_big_buff, |
| 604 | .maxlen = sizeof (int), | 552 | .maxlen = sizeof (int), |
| 605 | .mode = 0444, | 553 | .mode = 0444, |
| 606 | .proc_handler = &proc_dointvec, | 554 | .proc_handler = proc_dointvec, |
| 607 | }, | 555 | }, |
| 608 | #endif | 556 | #endif |
| 609 | #ifdef CONFIG_BSD_PROCESS_ACCT | 557 | #ifdef CONFIG_BSD_PROCESS_ACCT |
| 610 | { | 558 | { |
| 611 | .ctl_name = KERN_ACCT, | ||
| 612 | .procname = "acct", | 559 | .procname = "acct", |
| 613 | .data = &acct_parm, | 560 | .data = &acct_parm, |
| 614 | .maxlen = 3*sizeof(int), | 561 | .maxlen = 3*sizeof(int), |
| 615 | .mode = 0644, | 562 | .mode = 0644, |
| 616 | .proc_handler = &proc_dointvec, | 563 | .proc_handler = proc_dointvec, |
| 617 | }, | 564 | }, |
| 618 | #endif | 565 | #endif |
| 619 | #ifdef CONFIG_MAGIC_SYSRQ | 566 | #ifdef CONFIG_MAGIC_SYSRQ |
| 620 | { | 567 | { |
| 621 | .ctl_name = KERN_SYSRQ, | ||
| 622 | .procname = "sysrq", | 568 | .procname = "sysrq", |
| 623 | .data = &__sysrq_enabled, | 569 | .data = &__sysrq_enabled, |
| 624 | .maxlen = sizeof (int), | 570 | .maxlen = sizeof (int), |
| 625 | .mode = 0644, | 571 | .mode = 0644, |
| 626 | .proc_handler = &proc_dointvec, | 572 | .proc_handler = proc_dointvec, |
| 627 | }, | 573 | }, |
| 628 | #endif | 574 | #endif |
| 629 | #ifdef CONFIG_PROC_SYSCTL | 575 | #ifdef CONFIG_PROC_SYSCTL |
| @@ -632,215 +578,188 @@ static struct ctl_table kern_table[] = { | |||
| 632 | .data = NULL, | 578 | .data = NULL, |
| 633 | .maxlen = sizeof (int), | 579 | .maxlen = sizeof (int), |
| 634 | .mode = 0600, | 580 | .mode = 0600, |
| 635 | .proc_handler = &proc_do_cad_pid, | 581 | .proc_handler = proc_do_cad_pid, |
| 636 | }, | 582 | }, |
| 637 | #endif | 583 | #endif |
| 638 | { | 584 | { |
| 639 | .ctl_name = KERN_MAX_THREADS, | ||
| 640 | .procname = "threads-max", | 585 | .procname = "threads-max", |
| 641 | .data = &max_threads, | 586 | .data = &max_threads, |
| 642 | .maxlen = sizeof(int), | 587 | .maxlen = sizeof(int), |
| 643 | .mode = 0644, | 588 | .mode = 0644, |
| 644 | .proc_handler = &proc_dointvec, | 589 | .proc_handler = proc_dointvec, |
| 645 | }, | 590 | }, |
| 646 | { | 591 | { |
| 647 | .ctl_name = KERN_RANDOM, | ||
| 648 | .procname = "random", | 592 | .procname = "random", |
| 649 | .mode = 0555, | 593 | .mode = 0555, |
| 650 | .child = random_table, | 594 | .child = random_table, |
| 651 | }, | 595 | }, |
| 652 | { | 596 | { |
| 653 | .ctl_name = KERN_OVERFLOWUID, | ||
| 654 | .procname = "overflowuid", | 597 | .procname = "overflowuid", |
| 655 | .data = &overflowuid, | 598 | .data = &overflowuid, |
| 656 | .maxlen = sizeof(int), | 599 | .maxlen = sizeof(int), |
| 657 | .mode = 0644, | 600 | .mode = 0644, |
| 658 | .proc_handler = &proc_dointvec_minmax, | 601 | .proc_handler = proc_dointvec_minmax, |
| 659 | .strategy = &sysctl_intvec, | ||
| 660 | .extra1 = &minolduid, | 602 | .extra1 = &minolduid, |
| 661 | .extra2 = &maxolduid, | 603 | .extra2 = &maxolduid, |
| 662 | }, | 604 | }, |
| 663 | { | 605 | { |
| 664 | .ctl_name = KERN_OVERFLOWGID, | ||
| 665 | .procname = "overflowgid", | 606 | .procname = "overflowgid", |
| 666 | .data = &overflowgid, | 607 | .data = &overflowgid, |
| 667 | .maxlen = sizeof(int), | 608 | .maxlen = sizeof(int), |
| 668 | .mode = 0644, | 609 | .mode = 0644, |
| 669 | .proc_handler = &proc_dointvec_minmax, | 610 | .proc_handler = proc_dointvec_minmax, |
| 670 | .strategy = &sysctl_intvec, | ||
| 671 | .extra1 = &minolduid, | 611 | .extra1 = &minolduid, |
| 672 | .extra2 = &maxolduid, | 612 | .extra2 = &maxolduid, |
| 673 | }, | 613 | }, |
| 674 | #ifdef CONFIG_S390 | 614 | #ifdef CONFIG_S390 |
| 675 | #ifdef CONFIG_MATHEMU | 615 | #ifdef CONFIG_MATHEMU |
| 676 | { | 616 | { |
| 677 | .ctl_name = KERN_IEEE_EMULATION_WARNINGS, | ||
| 678 | .procname = "ieee_emulation_warnings", | 617 | .procname = "ieee_emulation_warnings", |
| 679 | .data = &sysctl_ieee_emulation_warnings, | 618 | .data = &sysctl_ieee_emulation_warnings, |
| 680 | .maxlen = sizeof(int), | 619 | .maxlen = sizeof(int), |
| 681 | .mode = 0644, | 620 | .mode = 0644, |
| 682 | .proc_handler = &proc_dointvec, | 621 | .proc_handler = proc_dointvec, |
| 683 | }, | 622 | }, |
| 684 | #endif | 623 | #endif |
| 685 | { | 624 | { |
| 686 | .ctl_name = KERN_S390_USER_DEBUG_LOGGING, | ||
| 687 | .procname = "userprocess_debug", | 625 | .procname = "userprocess_debug", |
| 688 | .data = &sysctl_userprocess_debug, | 626 | .data = &sysctl_userprocess_debug, |
| 689 | .maxlen = sizeof(int), | 627 | .maxlen = sizeof(int), |
| 690 | .mode = 0644, | 628 | .mode = 0644, |
| 691 | .proc_handler = &proc_dointvec, | 629 | .proc_handler = proc_dointvec, |
| 692 | }, | 630 | }, |
| 693 | #endif | 631 | #endif |
| 694 | { | 632 | { |
| 695 | .ctl_name = KERN_PIDMAX, | ||
| 696 | .procname = "pid_max", | 633 | .procname = "pid_max", |
| 697 | .data = &pid_max, | 634 | .data = &pid_max, |
| 698 | .maxlen = sizeof (int), | 635 | .maxlen = sizeof (int), |
| 699 | .mode = 0644, | 636 | .mode = 0644, |
| 700 | .proc_handler = &proc_dointvec_minmax, | 637 | .proc_handler = proc_dointvec_minmax, |
| 701 | .strategy = sysctl_intvec, | ||
| 702 | .extra1 = &pid_max_min, | 638 | .extra1 = &pid_max_min, |
| 703 | .extra2 = &pid_max_max, | 639 | .extra2 = &pid_max_max, |
| 704 | }, | 640 | }, |
| 705 | { | 641 | { |
| 706 | .ctl_name = KERN_PANIC_ON_OOPS, | ||
| 707 | .procname = "panic_on_oops", | 642 | .procname = "panic_on_oops", |
| 708 | .data = &panic_on_oops, | 643 | .data = &panic_on_oops, |
| 709 | .maxlen = sizeof(int), | 644 | .maxlen = sizeof(int), |
| 710 | .mode = 0644, | 645 | .mode = 0644, |
| 711 | .proc_handler = &proc_dointvec, | 646 | .proc_handler = proc_dointvec, |
| 712 | }, | 647 | }, |
| 713 | #if defined CONFIG_PRINTK | 648 | #if defined CONFIG_PRINTK |
| 714 | { | 649 | { |
| 715 | .ctl_name = KERN_PRINTK, | ||
| 716 | .procname = "printk", | 650 | .procname = "printk", |
| 717 | .data = &console_loglevel, | 651 | .data = &console_loglevel, |
| 718 | .maxlen = 4*sizeof(int), | 652 | .maxlen = 4*sizeof(int), |
| 719 | .mode = 0644, | 653 | .mode = 0644, |
| 720 | .proc_handler = &proc_dointvec, | 654 | .proc_handler = proc_dointvec, |
| 721 | }, | 655 | }, |
| 722 | { | 656 | { |
| 723 | .ctl_name = KERN_PRINTK_RATELIMIT, | ||
| 724 | .procname = "printk_ratelimit", | 657 | .procname = "printk_ratelimit", |
| 725 | .data = &printk_ratelimit_state.interval, | 658 | .data = &printk_ratelimit_state.interval, |
| 726 | .maxlen = sizeof(int), | 659 | .maxlen = sizeof(int), |
| 727 | .mode = 0644, | 660 | .mode = 0644, |
| 728 | .proc_handler = &proc_dointvec_jiffies, | 661 | .proc_handler = proc_dointvec_jiffies, |
| 729 | .strategy = &sysctl_jiffies, | ||
| 730 | }, | 662 | }, |
| 731 | { | 663 | { |
| 732 | .ctl_name = KERN_PRINTK_RATELIMIT_BURST, | ||
| 733 | .procname = "printk_ratelimit_burst", | 664 | .procname = "printk_ratelimit_burst", |
| 734 | .data = &printk_ratelimit_state.burst, | 665 | .data = &printk_ratelimit_state.burst, |
| 735 | .maxlen = sizeof(int), | 666 | .maxlen = sizeof(int), |
| 736 | .mode = 0644, | 667 | .mode = 0644, |
| 737 | .proc_handler = &proc_dointvec, | 668 | .proc_handler = proc_dointvec, |
| 738 | }, | 669 | }, |
| 739 | { | 670 | { |
| 740 | .ctl_name = CTL_UNNUMBERED, | ||
| 741 | .procname = "printk_delay", | 671 | .procname = "printk_delay", |
| 742 | .data = &printk_delay_msec, | 672 | .data = &printk_delay_msec, |
| 743 | .maxlen = sizeof(int), | 673 | .maxlen = sizeof(int), |
| 744 | .mode = 0644, | 674 | .mode = 0644, |
| 745 | .proc_handler = &proc_dointvec_minmax, | 675 | .proc_handler = proc_dointvec_minmax, |
| 746 | .strategy = &sysctl_intvec, | ||
| 747 | .extra1 = &zero, | 676 | .extra1 = &zero, |
| 748 | .extra2 = &ten_thousand, | 677 | .extra2 = &ten_thousand, |
| 749 | }, | 678 | }, |
| 750 | #endif | 679 | #endif |
| 751 | { | 680 | { |
| 752 | .ctl_name = KERN_NGROUPS_MAX, | ||
| 753 | .procname = "ngroups_max", | 681 | .procname = "ngroups_max", |
| 754 | .data = &ngroups_max, | 682 | .data = &ngroups_max, |
| 755 | .maxlen = sizeof (int), | 683 | .maxlen = sizeof (int), |
| 756 | .mode = 0444, | 684 | .mode = 0444, |
| 757 | .proc_handler = &proc_dointvec, | 685 | .proc_handler = proc_dointvec, |
| 758 | }, | 686 | }, |
| 759 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) | 687 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) |
| 760 | { | 688 | { |
| 761 | .ctl_name = KERN_UNKNOWN_NMI_PANIC, | ||
| 762 | .procname = "unknown_nmi_panic", | 689 | .procname = "unknown_nmi_panic", |
| 763 | .data = &unknown_nmi_panic, | 690 | .data = &unknown_nmi_panic, |
| 764 | .maxlen = sizeof (int), | 691 | .maxlen = sizeof (int), |
| 765 | .mode = 0644, | 692 | .mode = 0644, |
| 766 | .proc_handler = &proc_dointvec, | 693 | .proc_handler = proc_dointvec, |
| 767 | }, | 694 | }, |
| 768 | { | 695 | { |
| 769 | .procname = "nmi_watchdog", | 696 | .procname = "nmi_watchdog", |
| 770 | .data = &nmi_watchdog_enabled, | 697 | .data = &nmi_watchdog_enabled, |
| 771 | .maxlen = sizeof (int), | 698 | .maxlen = sizeof (int), |
| 772 | .mode = 0644, | 699 | .mode = 0644, |
| 773 | .proc_handler = &proc_nmi_enabled, | 700 | .proc_handler = proc_nmi_enabled, |
| 774 | }, | 701 | }, |
| 775 | #endif | 702 | #endif |
| 776 | #if defined(CONFIG_X86) | 703 | #if defined(CONFIG_X86) |
| 777 | { | 704 | { |
| 778 | .ctl_name = KERN_PANIC_ON_NMI, | ||
| 779 | .procname = "panic_on_unrecovered_nmi", | 705 | .procname = "panic_on_unrecovered_nmi", |
| 780 | .data = &panic_on_unrecovered_nmi, | 706 | .data = &panic_on_unrecovered_nmi, |
| 781 | .maxlen = sizeof(int), | 707 | .maxlen = sizeof(int), |
| 782 | .mode = 0644, | 708 | .mode = 0644, |
| 783 | .proc_handler = &proc_dointvec, | 709 | .proc_handler = proc_dointvec, |
| 784 | }, | 710 | }, |
| 785 | { | 711 | { |
| 786 | .ctl_name = CTL_UNNUMBERED, | ||
| 787 | .procname = "panic_on_io_nmi", | 712 | .procname = "panic_on_io_nmi", |
| 788 | .data = &panic_on_io_nmi, | 713 | .data = &panic_on_io_nmi, |
| 789 | .maxlen = sizeof(int), | 714 | .maxlen = sizeof(int), |
| 790 | .mode = 0644, | 715 | .mode = 0644, |
| 791 | .proc_handler = &proc_dointvec, | 716 | .proc_handler = proc_dointvec, |
| 792 | }, | 717 | }, |
| 793 | { | 718 | { |
| 794 | .ctl_name = KERN_BOOTLOADER_TYPE, | ||
| 795 | .procname = "bootloader_type", | 719 | .procname = "bootloader_type", |
| 796 | .data = &bootloader_type, | 720 | .data = &bootloader_type, |
| 797 | .maxlen = sizeof (int), | 721 | .maxlen = sizeof (int), |
| 798 | .mode = 0444, | 722 | .mode = 0444, |
| 799 | .proc_handler = &proc_dointvec, | 723 | .proc_handler = proc_dointvec, |
| 800 | }, | 724 | }, |
| 801 | { | 725 | { |
| 802 | .ctl_name = CTL_UNNUMBERED, | ||
| 803 | .procname = "bootloader_version", | 726 | .procname = "bootloader_version", |
| 804 | .data = &bootloader_version, | 727 | .data = &bootloader_version, |
| 805 | .maxlen = sizeof (int), | 728 | .maxlen = sizeof (int), |
| 806 | .mode = 0444, | 729 | .mode = 0444, |
| 807 | .proc_handler = &proc_dointvec, | 730 | .proc_handler = proc_dointvec, |
| 808 | }, | 731 | }, |
| 809 | { | 732 | { |
| 810 | .ctl_name = CTL_UNNUMBERED, | ||
| 811 | .procname = "kstack_depth_to_print", | 733 | .procname = "kstack_depth_to_print", |
| 812 | .data = &kstack_depth_to_print, | 734 | .data = &kstack_depth_to_print, |
| 813 | .maxlen = sizeof(int), | 735 | .maxlen = sizeof(int), |
| 814 | .mode = 0644, | 736 | .mode = 0644, |
| 815 | .proc_handler = &proc_dointvec, | 737 | .proc_handler = proc_dointvec, |
| 816 | }, | 738 | }, |
| 817 | { | 739 | { |
| 818 | .ctl_name = CTL_UNNUMBERED, | ||
| 819 | .procname = "io_delay_type", | 740 | .procname = "io_delay_type", |
| 820 | .data = &io_delay_type, | 741 | .data = &io_delay_type, |
| 821 | .maxlen = sizeof(int), | 742 | .maxlen = sizeof(int), |
| 822 | .mode = 0644, | 743 | .mode = 0644, |
| 823 | .proc_handler = &proc_dointvec, | 744 | .proc_handler = proc_dointvec, |
| 824 | }, | 745 | }, |
| 825 | #endif | 746 | #endif |
| 826 | #if defined(CONFIG_MMU) | 747 | #if defined(CONFIG_MMU) |
| 827 | { | 748 | { |
| 828 | .ctl_name = KERN_RANDOMIZE, | ||
| 829 | .procname = "randomize_va_space", | 749 | .procname = "randomize_va_space", |
| 830 | .data = &randomize_va_space, | 750 | .data = &randomize_va_space, |
| 831 | .maxlen = sizeof(int), | 751 | .maxlen = sizeof(int), |
| 832 | .mode = 0644, | 752 | .mode = 0644, |
| 833 | .proc_handler = &proc_dointvec, | 753 | .proc_handler = proc_dointvec, |
| 834 | }, | 754 | }, |
| 835 | #endif | 755 | #endif |
| 836 | #if defined(CONFIG_S390) && defined(CONFIG_SMP) | 756 | #if defined(CONFIG_S390) && defined(CONFIG_SMP) |
| 837 | { | 757 | { |
| 838 | .ctl_name = KERN_SPIN_RETRY, | ||
| 839 | .procname = "spin_retry", | 758 | .procname = "spin_retry", |
| 840 | .data = &spin_retry, | 759 | .data = &spin_retry, |
| 841 | .maxlen = sizeof (int), | 760 | .maxlen = sizeof (int), |
| 842 | .mode = 0644, | 761 | .mode = 0644, |
| 843 | .proc_handler = &proc_dointvec, | 762 | .proc_handler = proc_dointvec, |
| 844 | }, | 763 | }, |
| 845 | #endif | 764 | #endif |
| 846 | #if defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86) | 765 | #if defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86) |
| @@ -849,123 +768,104 @@ static struct ctl_table kern_table[] = { | |||
| 849 | .data = &acpi_realmode_flags, | 768 | .data = &acpi_realmode_flags, |
| 850 | .maxlen = sizeof (unsigned long), | 769 | .maxlen = sizeof (unsigned long), |
| 851 | .mode = 0644, | 770 | .mode = 0644, |
| 852 | .proc_handler = &proc_doulongvec_minmax, | 771 | .proc_handler = proc_doulongvec_minmax, |
| 853 | }, | 772 | }, |
| 854 | #endif | 773 | #endif |
| 855 | #ifdef CONFIG_IA64 | 774 | #ifdef CONFIG_IA64 |
| 856 | { | 775 | { |
| 857 | .ctl_name = KERN_IA64_UNALIGNED, | ||
| 858 | .procname = "ignore-unaligned-usertrap", | 776 | .procname = "ignore-unaligned-usertrap", |
| 859 | .data = &no_unaligned_warning, | 777 | .data = &no_unaligned_warning, |
| 860 | .maxlen = sizeof (int), | 778 | .maxlen = sizeof (int), |
| 861 | .mode = 0644, | 779 | .mode = 0644, |
| 862 | .proc_handler = &proc_dointvec, | 780 | .proc_handler = proc_dointvec, |
| 863 | }, | 781 | }, |
| 864 | { | 782 | { |
| 865 | .ctl_name = CTL_UNNUMBERED, | ||
| 866 | .procname = "unaligned-dump-stack", | 783 | .procname = "unaligned-dump-stack", |
| 867 | .data = &unaligned_dump_stack, | 784 | .data = &unaligned_dump_stack, |
| 868 | .maxlen = sizeof (int), | 785 | .maxlen = sizeof (int), |
| 869 | .mode = 0644, | 786 | .mode = 0644, |
| 870 | .proc_handler = &proc_dointvec, | 787 | .proc_handler = proc_dointvec, |
| 871 | }, | 788 | }, |
| 872 | #endif | 789 | #endif |
| 873 | #ifdef CONFIG_DETECT_SOFTLOCKUP | 790 | #ifdef CONFIG_DETECT_SOFTLOCKUP |
| 874 | { | 791 | { |
| 875 | .ctl_name = CTL_UNNUMBERED, | ||
| 876 | .procname = "softlockup_panic", | 792 | .procname = "softlockup_panic", |
| 877 | .data = &softlockup_panic, | 793 | .data = &softlockup_panic, |
| 878 | .maxlen = sizeof(int), | 794 | .maxlen = sizeof(int), |
| 879 | .mode = 0644, | 795 | .mode = 0644, |
| 880 | .proc_handler = &proc_dointvec_minmax, | 796 | .proc_handler = proc_dointvec_minmax, |
| 881 | .strategy = &sysctl_intvec, | ||
| 882 | .extra1 = &zero, | 797 | .extra1 = &zero, |
| 883 | .extra2 = &one, | 798 | .extra2 = &one, |
| 884 | }, | 799 | }, |
| 885 | { | 800 | { |
| 886 | .ctl_name = CTL_UNNUMBERED, | ||
| 887 | .procname = "softlockup_thresh", | 801 | .procname = "softlockup_thresh", |
| 888 | .data = &softlockup_thresh, | 802 | .data = &softlockup_thresh, |
| 889 | .maxlen = sizeof(int), | 803 | .maxlen = sizeof(int), |
| 890 | .mode = 0644, | 804 | .mode = 0644, |
| 891 | .proc_handler = &proc_dosoftlockup_thresh, | 805 | .proc_handler = proc_dosoftlockup_thresh, |
| 892 | .strategy = &sysctl_intvec, | ||
| 893 | .extra1 = &neg_one, | 806 | .extra1 = &neg_one, |
| 894 | .extra2 = &sixty, | 807 | .extra2 = &sixty, |
| 895 | }, | 808 | }, |
| 896 | #endif | 809 | #endif |
| 897 | #ifdef CONFIG_DETECT_HUNG_TASK | 810 | #ifdef CONFIG_DETECT_HUNG_TASK |
| 898 | { | 811 | { |
| 899 | .ctl_name = CTL_UNNUMBERED, | ||
| 900 | .procname = "hung_task_panic", | 812 | .procname = "hung_task_panic", |
| 901 | .data = &sysctl_hung_task_panic, | 813 | .data = &sysctl_hung_task_panic, |
| 902 | .maxlen = sizeof(int), | 814 | .maxlen = sizeof(int), |
| 903 | .mode = 0644, | 815 | .mode = 0644, |
| 904 | .proc_handler = &proc_dointvec_minmax, | 816 | .proc_handler = proc_dointvec_minmax, |
| 905 | .strategy = &sysctl_intvec, | ||
| 906 | .extra1 = &zero, | 817 | .extra1 = &zero, |
| 907 | .extra2 = &one, | 818 | .extra2 = &one, |
| 908 | }, | 819 | }, |
| 909 | { | 820 | { |
| 910 | .ctl_name = CTL_UNNUMBERED, | ||
| 911 | .procname = "hung_task_check_count", | 821 | .procname = "hung_task_check_count", |
| 912 | .data = &sysctl_hung_task_check_count, | 822 | .data = &sysctl_hung_task_check_count, |
| 913 | .maxlen = sizeof(unsigned long), | 823 | .maxlen = sizeof(unsigned long), |
| 914 | .mode = 0644, | 824 | .mode = 0644, |
| 915 | .proc_handler = &proc_doulongvec_minmax, | 825 | .proc_handler = proc_doulongvec_minmax, |
| 916 | .strategy = &sysctl_intvec, | ||
| 917 | }, | 826 | }, |
| 918 | { | 827 | { |
| 919 | .ctl_name = CTL_UNNUMBERED, | ||
| 920 | .procname = "hung_task_timeout_secs", | 828 | .procname = "hung_task_timeout_secs", |
| 921 | .data = &sysctl_hung_task_timeout_secs, | 829 | .data = &sysctl_hung_task_timeout_secs, |
| 922 | .maxlen = sizeof(unsigned long), | 830 | .maxlen = sizeof(unsigned long), |
| 923 | .mode = 0644, | 831 | .mode = 0644, |
| 924 | .proc_handler = &proc_dohung_task_timeout_secs, | 832 | .proc_handler = proc_dohung_task_timeout_secs, |
| 925 | .strategy = &sysctl_intvec, | ||
| 926 | }, | 833 | }, |
| 927 | { | 834 | { |
| 928 | .ctl_name = CTL_UNNUMBERED, | ||
| 929 | .procname = "hung_task_warnings", | 835 | .procname = "hung_task_warnings", |
| 930 | .data = &sysctl_hung_task_warnings, | 836 | .data = &sysctl_hung_task_warnings, |
| 931 | .maxlen = sizeof(unsigned long), | 837 | .maxlen = sizeof(unsigned long), |
| 932 | .mode = 0644, | 838 | .mode = 0644, |
| 933 | .proc_handler = &proc_doulongvec_minmax, | 839 | .proc_handler = proc_doulongvec_minmax, |
| 934 | .strategy = &sysctl_intvec, | ||
| 935 | }, | 840 | }, |
| 936 | #endif | 841 | #endif |
| 937 | #ifdef CONFIG_COMPAT | 842 | #ifdef CONFIG_COMPAT |
| 938 | { | 843 | { |
| 939 | .ctl_name = KERN_COMPAT_LOG, | ||
| 940 | .procname = "compat-log", | 844 | .procname = "compat-log", |
| 941 | .data = &compat_log, | 845 | .data = &compat_log, |
| 942 | .maxlen = sizeof (int), | 846 | .maxlen = sizeof (int), |
| 943 | .mode = 0644, | 847 | .mode = 0644, |
| 944 | .proc_handler = &proc_dointvec, | 848 | .proc_handler = proc_dointvec, |
| 945 | }, | 849 | }, |
| 946 | #endif | 850 | #endif |
| 947 | #ifdef CONFIG_RT_MUTEXES | 851 | #ifdef CONFIG_RT_MUTEXES |
| 948 | { | 852 | { |
| 949 | .ctl_name = KERN_MAX_LOCK_DEPTH, | ||
| 950 | .procname = "max_lock_depth", | 853 | .procname = "max_lock_depth", |
| 951 | .data = &max_lock_depth, | 854 | .data = &max_lock_depth, |
| 952 | .maxlen = sizeof(int), | 855 | .maxlen = sizeof(int), |
| 953 | .mode = 0644, | 856 | .mode = 0644, |
| 954 | .proc_handler = &proc_dointvec, | 857 | .proc_handler = proc_dointvec, |
| 955 | }, | 858 | }, |
| 956 | #endif | 859 | #endif |
| 957 | { | 860 | { |
| 958 | .ctl_name = CTL_UNNUMBERED, | ||
| 959 | .procname = "poweroff_cmd", | 861 | .procname = "poweroff_cmd", |
| 960 | .data = &poweroff_cmd, | 862 | .data = &poweroff_cmd, |
| 961 | .maxlen = POWEROFF_CMD_PATH_LEN, | 863 | .maxlen = POWEROFF_CMD_PATH_LEN, |
| 962 | .mode = 0644, | 864 | .mode = 0644, |
| 963 | .proc_handler = &proc_dostring, | 865 | .proc_handler = proc_dostring, |
| 964 | .strategy = &sysctl_string, | ||
| 965 | }, | 866 | }, |
| 966 | #ifdef CONFIG_KEYS | 867 | #ifdef CONFIG_KEYS |
| 967 | { | 868 | { |
| 968 | .ctl_name = CTL_UNNUMBERED, | ||
| 969 | .procname = "keys", | 869 | .procname = "keys", |
| 970 | .mode = 0555, | 870 | .mode = 0555, |
| 971 | .child = key_sysctls, | 871 | .child = key_sysctls, |
| @@ -973,17 +873,15 @@ static struct ctl_table kern_table[] = { | |||
| 973 | #endif | 873 | #endif |
| 974 | #ifdef CONFIG_RCU_TORTURE_TEST | 874 | #ifdef CONFIG_RCU_TORTURE_TEST |
| 975 | { | 875 | { |
| 976 | .ctl_name = CTL_UNNUMBERED, | ||
| 977 | .procname = "rcutorture_runnable", | 876 | .procname = "rcutorture_runnable", |
| 978 | .data = &rcutorture_runnable, | 877 | .data = &rcutorture_runnable, |
| 979 | .maxlen = sizeof(int), | 878 | .maxlen = sizeof(int), |
| 980 | .mode = 0644, | 879 | .mode = 0644, |
| 981 | .proc_handler = &proc_dointvec, | 880 | .proc_handler = proc_dointvec, |
| 982 | }, | 881 | }, |
| 983 | #endif | 882 | #endif |
| 984 | #ifdef CONFIG_SLOW_WORK | 883 | #ifdef CONFIG_SLOW_WORK |
| 985 | { | 884 | { |
| 986 | .ctl_name = CTL_UNNUMBERED, | ||
| 987 | .procname = "slow-work", | 885 | .procname = "slow-work", |
| 988 | .mode = 0555, | 886 | .mode = 0555, |
| 989 | .child = slow_work_sysctls, | 887 | .child = slow_work_sysctls, |
| @@ -991,146 +889,127 @@ static struct ctl_table kern_table[] = { | |||
| 991 | #endif | 889 | #endif |
| 992 | #ifdef CONFIG_PERF_EVENTS | 890 | #ifdef CONFIG_PERF_EVENTS |
| 993 | { | 891 | { |
| 994 | .ctl_name = CTL_UNNUMBERED, | ||
| 995 | .procname = "perf_event_paranoid", | 892 | .procname = "perf_event_paranoid", |
| 996 | .data = &sysctl_perf_event_paranoid, | 893 | .data = &sysctl_perf_event_paranoid, |
| 997 | .maxlen = sizeof(sysctl_perf_event_paranoid), | 894 | .maxlen = sizeof(sysctl_perf_event_paranoid), |
| 998 | .mode = 0644, | 895 | .mode = 0644, |
| 999 | .proc_handler = &proc_dointvec, | 896 | .proc_handler = proc_dointvec, |
| 1000 | }, | 897 | }, |
| 1001 | { | 898 | { |
| 1002 | .ctl_name = CTL_UNNUMBERED, | ||
| 1003 | .procname = "perf_event_mlock_kb", | 899 | .procname = "perf_event_mlock_kb", |
| 1004 | .data = &sysctl_perf_event_mlock, | 900 | .data = &sysctl_perf_event_mlock, |
| 1005 | .maxlen = sizeof(sysctl_perf_event_mlock), | 901 | .maxlen = sizeof(sysctl_perf_event_mlock), |
| 1006 | .mode = 0644, | 902 | .mode = 0644, |
| 1007 | .proc_handler = &proc_dointvec, | 903 | .proc_handler = proc_dointvec, |
| 1008 | }, | 904 | }, |
| 1009 | { | 905 | { |
| 1010 | .ctl_name = CTL_UNNUMBERED, | ||
| 1011 | .procname = "perf_event_max_sample_rate", | 906 | .procname = "perf_event_max_sample_rate", |
| 1012 | .data = &sysctl_perf_event_sample_rate, | 907 | .data = &sysctl_perf_event_sample_rate, |
| 1013 | .maxlen = sizeof(sysctl_perf_event_sample_rate), | 908 | .maxlen = sizeof(sysctl_perf_event_sample_rate), |
| 1014 | .mode = 0644, | 909 | .mode = 0644, |
| 1015 | .proc_handler = &proc_dointvec, | 910 | .proc_handler = proc_dointvec, |
| 1016 | }, | 911 | }, |
| 1017 | #endif | 912 | #endif |
| 1018 | #ifdef CONFIG_KMEMCHECK | 913 | #ifdef CONFIG_KMEMCHECK |
| 1019 | { | 914 | { |
| 1020 | .ctl_name = CTL_UNNUMBERED, | ||
| 1021 | .procname = "kmemcheck", | 915 | .procname = "kmemcheck", |
| 1022 | .data = &kmemcheck_enabled, | 916 | .data = &kmemcheck_enabled, |
| 1023 | .maxlen = sizeof(int), | 917 | .maxlen = sizeof(int), |
| 1024 | .mode = 0644, | 918 | .mode = 0644, |
| 1025 | .proc_handler = &proc_dointvec, | 919 | .proc_handler = proc_dointvec, |
| 1026 | }, | 920 | }, |
| 1027 | #endif | 921 | #endif |
| 1028 | #ifdef CONFIG_BLOCK | 922 | #ifdef CONFIG_BLOCK |
| 1029 | { | 923 | { |
| 1030 | .ctl_name = CTL_UNNUMBERED, | ||
| 1031 | .procname = "blk_iopoll", | 924 | .procname = "blk_iopoll", |
| 1032 | .data = &blk_iopoll_enabled, | 925 | .data = &blk_iopoll_enabled, |
| 1033 | .maxlen = sizeof(int), | 926 | .maxlen = sizeof(int), |
| 1034 | .mode = 0644, | 927 | .mode = 0644, |
| 1035 | .proc_handler = &proc_dointvec, | 928 | .proc_handler = proc_dointvec, |
| 1036 | }, | 929 | }, |
| 1037 | #endif | 930 | #endif |
| 1038 | /* | 931 | /* |
| 1039 | * NOTE: do not add new entries to this table unless you have read | 932 | * NOTE: do not add new entries to this table unless you have read |
| 1040 | * Documentation/sysctl/ctl_unnumbered.txt | 933 | * Documentation/sysctl/ctl_unnumbered.txt |
| 1041 | */ | 934 | */ |
| 1042 | { .ctl_name = 0 } | 935 | { } |
| 1043 | }; | 936 | }; |
| 1044 | 937 | ||
| 1045 | static struct ctl_table vm_table[] = { | 938 | static struct ctl_table vm_table[] = { |
| 1046 | { | 939 | { |
| 1047 | .ctl_name = VM_OVERCOMMIT_MEMORY, | ||
| 1048 | .procname = "overcommit_memory", | 940 | .procname = "overcommit_memory", |
| 1049 | .data = &sysctl_overcommit_memory, | 941 | .data = &sysctl_overcommit_memory, |
| 1050 | .maxlen = sizeof(sysctl_overcommit_memory), | 942 | .maxlen = sizeof(sysctl_overcommit_memory), |
| 1051 | .mode = 0644, | 943 | .mode = 0644, |
| 1052 | .proc_handler = &proc_dointvec, | 944 | .proc_handler = proc_dointvec, |
| 1053 | }, | 945 | }, |
| 1054 | { | 946 | { |
| 1055 | .ctl_name = VM_PANIC_ON_OOM, | ||
| 1056 | .procname = "panic_on_oom", | 947 | .procname = "panic_on_oom", |
| 1057 | .data = &sysctl_panic_on_oom, | 948 | .data = &sysctl_panic_on_oom, |
| 1058 | .maxlen = sizeof(sysctl_panic_on_oom), | 949 | .maxlen = sizeof(sysctl_panic_on_oom), |
| 1059 | .mode = 0644, | 950 | .mode = 0644, |
| 1060 | .proc_handler = &proc_dointvec, | 951 | .proc_handler = proc_dointvec, |
| 1061 | }, | 952 | }, |
| 1062 | { | 953 | { |
| 1063 | .ctl_name = CTL_UNNUMBERED, | ||
| 1064 | .procname = "oom_kill_allocating_task", | 954 | .procname = "oom_kill_allocating_task", |
| 1065 | .data = &sysctl_oom_kill_allocating_task, | 955 | .data = &sysctl_oom_kill_allocating_task, |
| 1066 | .maxlen = sizeof(sysctl_oom_kill_allocating_task), | 956 | .maxlen = sizeof(sysctl_oom_kill_allocating_task), |
| 1067 | .mode = 0644, | 957 | .mode = 0644, |
| 1068 | .proc_handler = &proc_dointvec, | 958 | .proc_handler = proc_dointvec, |
| 1069 | }, | 959 | }, |
| 1070 | { | 960 | { |
| 1071 | .ctl_name = CTL_UNNUMBERED, | ||
| 1072 | .procname = "oom_dump_tasks", | 961 | .procname = "oom_dump_tasks", |
| 1073 | .data = &sysctl_oom_dump_tasks, | 962 | .data = &sysctl_oom_dump_tasks, |
| 1074 | .maxlen = sizeof(sysctl_oom_dump_tasks), | 963 | .maxlen = sizeof(sysctl_oom_dump_tasks), |
| 1075 | .mode = 0644, | 964 | .mode = 0644, |
| 1076 | .proc_handler = &proc_dointvec, | 965 | .proc_handler = proc_dointvec, |
| 1077 | }, | 966 | }, |
| 1078 | { | 967 | { |
| 1079 | .ctl_name = VM_OVERCOMMIT_RATIO, | ||
| 1080 | .procname = "overcommit_ratio", | 968 | .procname = "overcommit_ratio", |
| 1081 | .data = &sysctl_overcommit_ratio, | 969 | .data = &sysctl_overcommit_ratio, |
| 1082 | .maxlen = sizeof(sysctl_overcommit_ratio), | 970 | .maxlen = sizeof(sysctl_overcommit_ratio), |
| 1083 | .mode = 0644, | 971 | .mode = 0644, |
| 1084 | .proc_handler = &proc_dointvec, | 972 | .proc_handler = proc_dointvec, |
| 1085 | }, | 973 | }, |
| 1086 | { | 974 | { |
| 1087 | .ctl_name = VM_PAGE_CLUSTER, | ||
| 1088 | .procname = "page-cluster", | 975 | .procname = "page-cluster", |
| 1089 | .data = &page_cluster, | 976 | .data = &page_cluster, |
| 1090 | .maxlen = sizeof(int), | 977 | .maxlen = sizeof(int), |
| 1091 | .mode = 0644, | 978 | .mode = 0644, |
| 1092 | .proc_handler = &proc_dointvec, | 979 | .proc_handler = proc_dointvec, |
| 1093 | }, | 980 | }, |
| 1094 | { | 981 | { |
| 1095 | .ctl_name = VM_DIRTY_BACKGROUND, | ||
| 1096 | .procname = "dirty_background_ratio", | 982 | .procname = "dirty_background_ratio", |
| 1097 | .data = &dirty_background_ratio, | 983 | .data = &dirty_background_ratio, |
| 1098 | .maxlen = sizeof(dirty_background_ratio), | 984 | .maxlen = sizeof(dirty_background_ratio), |
| 1099 | .mode = 0644, | 985 | .mode = 0644, |
| 1100 | .proc_handler = &dirty_background_ratio_handler, | 986 | .proc_handler = dirty_background_ratio_handler, |
| 1101 | .strategy = &sysctl_intvec, | ||
| 1102 | .extra1 = &zero, | 987 | .extra1 = &zero, |
| 1103 | .extra2 = &one_hundred, | 988 | .extra2 = &one_hundred, |
| 1104 | }, | 989 | }, |
| 1105 | { | 990 | { |
| 1106 | .ctl_name = CTL_UNNUMBERED, | ||
| 1107 | .procname = "dirty_background_bytes", | 991 | .procname = "dirty_background_bytes", |
| 1108 | .data = &dirty_background_bytes, | 992 | .data = &dirty_background_bytes, |
| 1109 | .maxlen = sizeof(dirty_background_bytes), | 993 | .maxlen = sizeof(dirty_background_bytes), |
| 1110 | .mode = 0644, | 994 | .mode = 0644, |
| 1111 | .proc_handler = &dirty_background_bytes_handler, | 995 | .proc_handler = dirty_background_bytes_handler, |
| 1112 | .strategy = &sysctl_intvec, | ||
| 1113 | .extra1 = &one_ul, | 996 | .extra1 = &one_ul, |
| 1114 | }, | 997 | }, |
| 1115 | { | 998 | { |
| 1116 | .ctl_name = VM_DIRTY_RATIO, | ||
| 1117 | .procname = "dirty_ratio", | 999 | .procname = "dirty_ratio", |
| 1118 | .data = &vm_dirty_ratio, | 1000 | .data = &vm_dirty_ratio, |
| 1119 | .maxlen = sizeof(vm_dirty_ratio), | 1001 | .maxlen = sizeof(vm_dirty_ratio), |
| 1120 | .mode = 0644, | 1002 | .mode = 0644, |
| 1121 | .proc_handler = &dirty_ratio_handler, | 1003 | .proc_handler = dirty_ratio_handler, |
| 1122 | .strategy = &sysctl_intvec, | ||
| 1123 | .extra1 = &zero, | 1004 | .extra1 = &zero, |
| 1124 | .extra2 = &one_hundred, | 1005 | .extra2 = &one_hundred, |
| 1125 | }, | 1006 | }, |
| 1126 | { | 1007 | { |
| 1127 | .ctl_name = CTL_UNNUMBERED, | ||
| 1128 | .procname = "dirty_bytes", | 1008 | .procname = "dirty_bytes", |
| 1129 | .data = &vm_dirty_bytes, | 1009 | .data = &vm_dirty_bytes, |
| 1130 | .maxlen = sizeof(vm_dirty_bytes), | 1010 | .maxlen = sizeof(vm_dirty_bytes), |
| 1131 | .mode = 0644, | 1011 | .mode = 0644, |
| 1132 | .proc_handler = &dirty_bytes_handler, | 1012 | .proc_handler = dirty_bytes_handler, |
| 1133 | .strategy = &sysctl_intvec, | ||
| 1134 | .extra1 = &dirty_bytes_min, | 1013 | .extra1 = &dirty_bytes_min, |
| 1135 | }, | 1014 | }, |
| 1136 | { | 1015 | { |
| @@ -1138,31 +1017,28 @@ static struct ctl_table vm_table[] = { | |||
| 1138 | .data = &dirty_writeback_interval, | 1017 | .data = &dirty_writeback_interval, |
| 1139 | .maxlen = sizeof(dirty_writeback_interval), | 1018 | .maxlen = sizeof(dirty_writeback_interval), |
| 1140 | .mode = 0644, | 1019 | .mode = 0644, |
| 1141 | .proc_handler = &dirty_writeback_centisecs_handler, | 1020 | .proc_handler = dirty_writeback_centisecs_handler, |
| 1142 | }, | 1021 | }, |
| 1143 | { | 1022 | { |
| 1144 | .procname = "dirty_expire_centisecs", | 1023 | .procname = "dirty_expire_centisecs", |
| 1145 | .data = &dirty_expire_interval, | 1024 | .data = &dirty_expire_interval, |
| 1146 | .maxlen = sizeof(dirty_expire_interval), | 1025 | .maxlen = sizeof(dirty_expire_interval), |
| 1147 | .mode = 0644, | 1026 | .mode = 0644, |
| 1148 | .proc_handler = &proc_dointvec, | 1027 | .proc_handler = proc_dointvec, |
| 1149 | }, | 1028 | }, |
| 1150 | { | 1029 | { |
| 1151 | .ctl_name = VM_NR_PDFLUSH_THREADS, | ||
| 1152 | .procname = "nr_pdflush_threads", | 1030 | .procname = "nr_pdflush_threads", |
| 1153 | .data = &nr_pdflush_threads, | 1031 | .data = &nr_pdflush_threads, |
| 1154 | .maxlen = sizeof nr_pdflush_threads, | 1032 | .maxlen = sizeof nr_pdflush_threads, |
| 1155 | .mode = 0444 /* read-only*/, | 1033 | .mode = 0444 /* read-only*/, |
| 1156 | .proc_handler = &proc_dointvec, | 1034 | .proc_handler = proc_dointvec, |
| 1157 | }, | 1035 | }, |
| 1158 | { | 1036 | { |
| 1159 | .ctl_name = VM_SWAPPINESS, | ||
| 1160 | .procname = "swappiness", | 1037 | .procname = "swappiness", |
| 1161 | .data = &vm_swappiness, | 1038 | .data = &vm_swappiness, |
| 1162 | .maxlen = sizeof(vm_swappiness), | 1039 | .maxlen = sizeof(vm_swappiness), |
| 1163 | .mode = 0644, | 1040 | .mode = 0644, |
| 1164 | .proc_handler = &proc_dointvec_minmax, | 1041 | .proc_handler = proc_dointvec_minmax, |
| 1165 | .strategy = &sysctl_intvec, | ||
| 1166 | .extra1 = &zero, | 1042 | .extra1 = &zero, |
| 1167 | .extra2 = &one_hundred, | 1043 | .extra2 = &one_hundred, |
| 1168 | }, | 1044 | }, |
| @@ -1172,255 +1048,213 @@ static struct ctl_table vm_table[] = { | |||
| 1172 | .data = NULL, | 1048 | .data = NULL, |
| 1173 | .maxlen = sizeof(unsigned long), | 1049 | .maxlen = sizeof(unsigned long), |
| 1174 | .mode = 0644, | 1050 | .mode = 0644, |
| 1175 | .proc_handler = &hugetlb_sysctl_handler, | 1051 | .proc_handler = hugetlb_sysctl_handler, |
| 1176 | .extra1 = (void *)&hugetlb_zero, | 1052 | .extra1 = (void *)&hugetlb_zero, |
| 1177 | .extra2 = (void *)&hugetlb_infinity, | 1053 | .extra2 = (void *)&hugetlb_infinity, |
| 1178 | }, | 1054 | }, |
| 1179 | { | 1055 | { |
| 1180 | .ctl_name = VM_HUGETLB_GROUP, | ||
| 1181 | .procname = "hugetlb_shm_group", | 1056 | .procname = "hugetlb_shm_group", |
| 1182 | .data = &sysctl_hugetlb_shm_group, | 1057 | .data = &sysctl_hugetlb_shm_group, |
| 1183 | .maxlen = sizeof(gid_t), | 1058 | .maxlen = sizeof(gid_t), |
| 1184 | .mode = 0644, | 1059 | .mode = 0644, |
| 1185 | .proc_handler = &proc_dointvec, | 1060 | .proc_handler = proc_dointvec, |
| 1186 | }, | 1061 | }, |
| 1187 | { | 1062 | { |
| 1188 | .ctl_name = CTL_UNNUMBERED, | ||
| 1189 | .procname = "hugepages_treat_as_movable", | 1063 | .procname = "hugepages_treat_as_movable", |
| 1190 | .data = &hugepages_treat_as_movable, | 1064 | .data = &hugepages_treat_as_movable, |
| 1191 | .maxlen = sizeof(int), | 1065 | .maxlen = sizeof(int), |
| 1192 | .mode = 0644, | 1066 | .mode = 0644, |
| 1193 | .proc_handler = &hugetlb_treat_movable_handler, | 1067 | .proc_handler = hugetlb_treat_movable_handler, |
| 1194 | }, | 1068 | }, |
| 1195 | { | 1069 | { |
| 1196 | .ctl_name = CTL_UNNUMBERED, | ||
| 1197 | .procname = "nr_overcommit_hugepages", | 1070 | .procname = "nr_overcommit_hugepages", |
| 1198 | .data = NULL, | 1071 | .data = NULL, |
| 1199 | .maxlen = sizeof(unsigned long), | 1072 | .maxlen = sizeof(unsigned long), |
| 1200 | .mode = 0644, | 1073 | .mode = 0644, |
| 1201 | .proc_handler = &hugetlb_overcommit_handler, | 1074 | .proc_handler = hugetlb_overcommit_handler, |
| 1202 | .extra1 = (void *)&hugetlb_zero, | 1075 | .extra1 = (void *)&hugetlb_zero, |
| 1203 | .extra2 = (void *)&hugetlb_infinity, | 1076 | .extra2 = (void *)&hugetlb_infinity, |
| 1204 | }, | 1077 | }, |
| 1205 | #endif | 1078 | #endif |
| 1206 | { | 1079 | { |
| 1207 | .ctl_name = VM_LOWMEM_RESERVE_RATIO, | ||
| 1208 | .procname = "lowmem_reserve_ratio", | 1080 | .procname = "lowmem_reserve_ratio", |
| 1209 | .data = &sysctl_lowmem_reserve_ratio, | 1081 | .data = &sysctl_lowmem_reserve_ratio, |
| 1210 | .maxlen = sizeof(sysctl_lowmem_reserve_ratio), | 1082 | .maxlen = sizeof(sysctl_lowmem_reserve_ratio), |
| 1211 | .mode = 0644, | 1083 | .mode = 0644, |
| 1212 | .proc_handler = &lowmem_reserve_ratio_sysctl_handler, | 1084 | .proc_handler = lowmem_reserve_ratio_sysctl_handler, |
| 1213 | .strategy = &sysctl_intvec, | ||
| 1214 | }, | 1085 | }, |
| 1215 | { | 1086 | { |
| 1216 | .ctl_name = VM_DROP_PAGECACHE, | ||
| 1217 | .procname = "drop_caches", | 1087 | .procname = "drop_caches", |
| 1218 | .data = &sysctl_drop_caches, | 1088 | .data = &sysctl_drop_caches, |
| 1219 | .maxlen = sizeof(int), | 1089 | .maxlen = sizeof(int), |
| 1220 | .mode = 0644, | 1090 | .mode = 0644, |
| 1221 | .proc_handler = drop_caches_sysctl_handler, | 1091 | .proc_handler = drop_caches_sysctl_handler, |
| 1222 | .strategy = &sysctl_intvec, | ||
| 1223 | }, | 1092 | }, |
| 1224 | { | 1093 | { |
| 1225 | .ctl_name = VM_MIN_FREE_KBYTES, | ||
| 1226 | .procname = "min_free_kbytes", | 1094 | .procname = "min_free_kbytes", |
| 1227 | .data = &min_free_kbytes, | 1095 | .data = &min_free_kbytes, |
| 1228 | .maxlen = sizeof(min_free_kbytes), | 1096 | .maxlen = sizeof(min_free_kbytes), |
| 1229 | .mode = 0644, | 1097 | .mode = 0644, |
| 1230 | .proc_handler = &min_free_kbytes_sysctl_handler, | 1098 | .proc_handler = min_free_kbytes_sysctl_handler, |
| 1231 | .strategy = &sysctl_intvec, | ||
| 1232 | .extra1 = &zero, | 1099 | .extra1 = &zero, |
| 1233 | }, | 1100 | }, |
| 1234 | { | 1101 | { |
| 1235 | .ctl_name = VM_PERCPU_PAGELIST_FRACTION, | ||
| 1236 | .procname = "percpu_pagelist_fraction", | 1102 | .procname = "percpu_pagelist_fraction", |
| 1237 | .data = &percpu_pagelist_fraction, | 1103 | .data = &percpu_pagelist_fraction, |
| 1238 | .maxlen = sizeof(percpu_pagelist_fraction), | 1104 | .maxlen = sizeof(percpu_pagelist_fraction), |
| 1239 | .mode = 0644, | 1105 | .mode = 0644, |
| 1240 | .proc_handler = &percpu_pagelist_fraction_sysctl_handler, | 1106 | .proc_handler = percpu_pagelist_fraction_sysctl_handler, |
| 1241 | .strategy = &sysctl_intvec, | ||
| 1242 | .extra1 = &min_percpu_pagelist_fract, | 1107 | .extra1 = &min_percpu_pagelist_fract, |
| 1243 | }, | 1108 | }, |
| 1244 | #ifdef CONFIG_MMU | 1109 | #ifdef CONFIG_MMU |
| 1245 | { | 1110 | { |
| 1246 | .ctl_name = VM_MAX_MAP_COUNT, | ||
| 1247 | .procname = "max_map_count", | 1111 | .procname = "max_map_count", |
| 1248 | .data = &sysctl_max_map_count, | 1112 | .data = &sysctl_max_map_count, |
| 1249 | .maxlen = sizeof(sysctl_max_map_count), | 1113 | .maxlen = sizeof(sysctl_max_map_count), |
| 1250 | .mode = 0644, | 1114 | .mode = 0644, |
| 1251 | .proc_handler = &proc_dointvec | 1115 | .proc_handler = proc_dointvec |
| 1252 | }, | 1116 | }, |
| 1253 | #else | 1117 | #else |
| 1254 | { | 1118 | { |
| 1255 | .ctl_name = CTL_UNNUMBERED, | ||
| 1256 | .procname = "nr_trim_pages", | 1119 | .procname = "nr_trim_pages", |
| 1257 | .data = &sysctl_nr_trim_pages, | 1120 | .data = &sysctl_nr_trim_pages, |
| 1258 | .maxlen = sizeof(sysctl_nr_trim_pages), | 1121 | .maxlen = sizeof(sysctl_nr_trim_pages), |
| 1259 | .mode = 0644, | 1122 | .mode = 0644, |
| 1260 | .proc_handler = &proc_dointvec_minmax, | 1123 | .proc_handler = proc_dointvec_minmax, |
| 1261 | .strategy = &sysctl_intvec, | ||
| 1262 | .extra1 = &zero, | 1124 | .extra1 = &zero, |
| 1263 | }, | 1125 | }, |
| 1264 | #endif | 1126 | #endif |
| 1265 | { | 1127 | { |
| 1266 | .ctl_name = VM_LAPTOP_MODE, | ||
| 1267 | .procname = "laptop_mode", | 1128 | .procname = "laptop_mode", |
| 1268 | .data = &laptop_mode, | 1129 | .data = &laptop_mode, |
| 1269 | .maxlen = sizeof(laptop_mode), | 1130 | .maxlen = sizeof(laptop_mode), |
| 1270 | .mode = 0644, | 1131 | .mode = 0644, |
| 1271 | .proc_handler = &proc_dointvec_jiffies, | 1132 | .proc_handler = proc_dointvec_jiffies, |
| 1272 | .strategy = &sysctl_jiffies, | ||
| 1273 | }, | 1133 | }, |
| 1274 | { | 1134 | { |
| 1275 | .ctl_name = VM_BLOCK_DUMP, | ||
| 1276 | .procname = "block_dump", | 1135 | .procname = "block_dump", |
| 1277 | .data = &block_dump, | 1136 | .data = &block_dump, |
| 1278 | .maxlen = sizeof(block_dump), | 1137 | .maxlen = sizeof(block_dump), |
| 1279 | .mode = 0644, | 1138 | .mode = 0644, |
| 1280 | .proc_handler = &proc_dointvec, | 1139 | .proc_handler = proc_dointvec, |
| 1281 | .strategy = &sysctl_intvec, | ||
| 1282 | .extra1 = &zero, | 1140 | .extra1 = &zero, |
| 1283 | }, | 1141 | }, |
| 1284 | { | 1142 | { |
| 1285 | .ctl_name = VM_VFS_CACHE_PRESSURE, | ||
| 1286 | .procname = "vfs_cache_pressure", | 1143 | .procname = "vfs_cache_pressure", |
| 1287 | .data = &sysctl_vfs_cache_pressure, | 1144 | .data = &sysctl_vfs_cache_pressure, |
| 1288 | .maxlen = sizeof(sysctl_vfs_cache_pressure), | 1145 | .maxlen = sizeof(sysctl_vfs_cache_pressure), |
| 1289 | .mode = 0644, | 1146 | .mode = 0644, |
| 1290 | .proc_handler = &proc_dointvec, | 1147 | .proc_handler = proc_dointvec, |
| 1291 | .strategy = &sysctl_intvec, | ||
| 1292 | .extra1 = &zero, | 1148 | .extra1 = &zero, |
| 1293 | }, | 1149 | }, |
| 1294 | #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT | 1150 | #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT |
| 1295 | { | 1151 | { |
| 1296 | .ctl_name = VM_LEGACY_VA_LAYOUT, | ||
| 1297 | .procname = "legacy_va_layout", | 1152 | .procname = "legacy_va_layout", |
| 1298 | .data = &sysctl_legacy_va_layout, | 1153 | .data = &sysctl_legacy_va_layout, |
| 1299 | .maxlen = sizeof(sysctl_legacy_va_layout), | 1154 | .maxlen = sizeof(sysctl_legacy_va_layout), |
| 1300 | .mode = 0644, | 1155 | .mode = 0644, |
| 1301 | .proc_handler = &proc_dointvec, | 1156 | .proc_handler = proc_dointvec, |
| 1302 | .strategy = &sysctl_intvec, | ||
| 1303 | .extra1 = &zero, | 1157 | .extra1 = &zero, |
| 1304 | }, | 1158 | }, |
| 1305 | #endif | 1159 | #endif |
| 1306 | #ifdef CONFIG_NUMA | 1160 | #ifdef CONFIG_NUMA |
| 1307 | { | 1161 | { |
| 1308 | .ctl_name = VM_ZONE_RECLAIM_MODE, | ||
| 1309 | .procname = "zone_reclaim_mode", | 1162 | .procname = "zone_reclaim_mode", |
| 1310 | .data = &zone_reclaim_mode, | 1163 | .data = &zone_reclaim_mode, |
| 1311 | .maxlen = sizeof(zone_reclaim_mode), | 1164 | .maxlen = sizeof(zone_reclaim_mode), |
| 1312 | .mode = 0644, | 1165 | .mode = 0644, |
| 1313 | .proc_handler = &proc_dointvec, | 1166 | .proc_handler = proc_dointvec, |
| 1314 | .strategy = &sysctl_intvec, | ||
| 1315 | .extra1 = &zero, | 1167 | .extra1 = &zero, |
| 1316 | }, | 1168 | }, |
| 1317 | { | 1169 | { |
| 1318 | .ctl_name = VM_MIN_UNMAPPED, | ||
| 1319 | .procname = "min_unmapped_ratio", | 1170 | .procname = "min_unmapped_ratio", |
| 1320 | .data = &sysctl_min_unmapped_ratio, | 1171 | .data = &sysctl_min_unmapped_ratio, |
| 1321 | .maxlen = sizeof(sysctl_min_unmapped_ratio), | 1172 | .maxlen = sizeof(sysctl_min_unmapped_ratio), |
| 1322 | .mode = 0644, | 1173 | .mode = 0644, |
| 1323 | .proc_handler = &sysctl_min_unmapped_ratio_sysctl_handler, | 1174 | .proc_handler = sysctl_min_unmapped_ratio_sysctl_handler, |
| 1324 | .strategy = &sysctl_intvec, | ||
| 1325 | .extra1 = &zero, | 1175 | .extra1 = &zero, |
| 1326 | .extra2 = &one_hundred, | 1176 | .extra2 = &one_hundred, |
| 1327 | }, | 1177 | }, |
| 1328 | { | 1178 | { |
| 1329 | .ctl_name = VM_MIN_SLAB, | ||
| 1330 | .procname = "min_slab_ratio", | 1179 | .procname = "min_slab_ratio", |
| 1331 | .data = &sysctl_min_slab_ratio, | 1180 | .data = &sysctl_min_slab_ratio, |
| 1332 | .maxlen = sizeof(sysctl_min_slab_ratio), | 1181 | .maxlen = sizeof(sysctl_min_slab_ratio), |
| 1333 | .mode = 0644, | 1182 | .mode = 0644, |
| 1334 | .proc_handler = &sysctl_min_slab_ratio_sysctl_handler, | 1183 | .proc_handler = sysctl_min_slab_ratio_sysctl_handler, |
| 1335 | .strategy = &sysctl_intvec, | ||
| 1336 | .extra1 = &zero, | 1184 | .extra1 = &zero, |
| 1337 | .extra2 = &one_hundred, | 1185 | .extra2 = &one_hundred, |
| 1338 | }, | 1186 | }, |
| 1339 | #endif | 1187 | #endif |
| 1340 | #ifdef CONFIG_SMP | 1188 | #ifdef CONFIG_SMP |
| 1341 | { | 1189 | { |
| 1342 | .ctl_name = CTL_UNNUMBERED, | ||
| 1343 | .procname = "stat_interval", | 1190 | .procname = "stat_interval", |
| 1344 | .data = &sysctl_stat_interval, | 1191 | .data = &sysctl_stat_interval, |
| 1345 | .maxlen = sizeof(sysctl_stat_interval), | 1192 | .maxlen = sizeof(sysctl_stat_interval), |
| 1346 | .mode = 0644, | 1193 | .mode = 0644, |
| 1347 | .proc_handler = &proc_dointvec_jiffies, | 1194 | .proc_handler = proc_dointvec_jiffies, |
| 1348 | .strategy = &sysctl_jiffies, | ||
| 1349 | }, | 1195 | }, |
| 1350 | #endif | 1196 | #endif |
| 1351 | { | 1197 | { |
| 1352 | .ctl_name = CTL_UNNUMBERED, | ||
| 1353 | .procname = "mmap_min_addr", | 1198 | .procname = "mmap_min_addr", |
| 1354 | .data = &dac_mmap_min_addr, | 1199 | .data = &dac_mmap_min_addr, |
| 1355 | .maxlen = sizeof(unsigned long), | 1200 | .maxlen = sizeof(unsigned long), |
| 1356 | .mode = 0644, | 1201 | .mode = 0644, |
| 1357 | .proc_handler = &mmap_min_addr_handler, | 1202 | .proc_handler = mmap_min_addr_handler, |
| 1358 | }, | 1203 | }, |
| 1359 | #ifdef CONFIG_NUMA | 1204 | #ifdef CONFIG_NUMA |
| 1360 | { | 1205 | { |
| 1361 | .ctl_name = CTL_UNNUMBERED, | ||
| 1362 | .procname = "numa_zonelist_order", | 1206 | .procname = "numa_zonelist_order", |
| 1363 | .data = &numa_zonelist_order, | 1207 | .data = &numa_zonelist_order, |
| 1364 | .maxlen = NUMA_ZONELIST_ORDER_LEN, | 1208 | .maxlen = NUMA_ZONELIST_ORDER_LEN, |
| 1365 | .mode = 0644, | 1209 | .mode = 0644, |
| 1366 | .proc_handler = &numa_zonelist_order_handler, | 1210 | .proc_handler = numa_zonelist_order_handler, |
| 1367 | .strategy = &sysctl_string, | ||
| 1368 | }, | 1211 | }, |
| 1369 | #endif | 1212 | #endif |
| 1370 | #if (defined(CONFIG_X86_32) && !defined(CONFIG_UML))|| \ | 1213 | #if (defined(CONFIG_X86_32) && !defined(CONFIG_UML))|| \ |
| 1371 | (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL)) | 1214 | (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL)) |
| 1372 | { | 1215 | { |
| 1373 | .ctl_name = VM_VDSO_ENABLED, | ||
| 1374 | .procname = "vdso_enabled", | 1216 | .procname = "vdso_enabled", |
| 1375 | .data = &vdso_enabled, | 1217 | .data = &vdso_enabled, |
| 1376 | .maxlen = sizeof(vdso_enabled), | 1218 | .maxlen = sizeof(vdso_enabled), |
| 1377 | .mode = 0644, | 1219 | .mode = 0644, |
| 1378 | .proc_handler = &proc_dointvec, | 1220 | .proc_handler = proc_dointvec, |
| 1379 | .strategy = &sysctl_intvec, | ||
| 1380 | .extra1 = &zero, | 1221 | .extra1 = &zero, |
| 1381 | }, | 1222 | }, |
| 1382 | #endif | 1223 | #endif |
| 1383 | #ifdef CONFIG_HIGHMEM | 1224 | #ifdef CONFIG_HIGHMEM |
| 1384 | { | 1225 | { |
| 1385 | .ctl_name = CTL_UNNUMBERED, | ||
| 1386 | .procname = "highmem_is_dirtyable", | 1226 | .procname = "highmem_is_dirtyable", |
| 1387 | .data = &vm_highmem_is_dirtyable, | 1227 | .data = &vm_highmem_is_dirtyable, |
| 1388 | .maxlen = sizeof(vm_highmem_is_dirtyable), | 1228 | .maxlen = sizeof(vm_highmem_is_dirtyable), |
| 1389 | .mode = 0644, | 1229 | .mode = 0644, |
| 1390 | .proc_handler = &proc_dointvec_minmax, | 1230 | .proc_handler = proc_dointvec_minmax, |
| 1391 | .strategy = &sysctl_intvec, | ||
| 1392 | .extra1 = &zero, | 1231 | .extra1 = &zero, |
| 1393 | .extra2 = &one, | 1232 | .extra2 = &one, |
| 1394 | }, | 1233 | }, |
| 1395 | #endif | 1234 | #endif |
| 1396 | { | 1235 | { |
| 1397 | .ctl_name = CTL_UNNUMBERED, | ||
| 1398 | .procname = "scan_unevictable_pages", | 1236 | .procname = "scan_unevictable_pages", |
| 1399 | .data = &scan_unevictable_pages, | 1237 | .data = &scan_unevictable_pages, |
| 1400 | .maxlen = sizeof(scan_unevictable_pages), | 1238 | .maxlen = sizeof(scan_unevictable_pages), |
| 1401 | .mode = 0644, | 1239 | .mode = 0644, |
| 1402 | .proc_handler = &scan_unevictable_handler, | 1240 | .proc_handler = scan_unevictable_handler, |
| 1403 | }, | 1241 | }, |
| 1404 | #ifdef CONFIG_MEMORY_FAILURE | 1242 | #ifdef CONFIG_MEMORY_FAILURE |
| 1405 | { | 1243 | { |
| 1406 | .ctl_name = CTL_UNNUMBERED, | ||
| 1407 | .procname = "memory_failure_early_kill", | 1244 | .procname = "memory_failure_early_kill", |
| 1408 | .data = &sysctl_memory_failure_early_kill, | 1245 | .data = &sysctl_memory_failure_early_kill, |
| 1409 | .maxlen = sizeof(sysctl_memory_failure_early_kill), | 1246 | .maxlen = sizeof(sysctl_memory_failure_early_kill), |
| 1410 | .mode = 0644, | 1247 | .mode = 0644, |
| 1411 | .proc_handler = &proc_dointvec_minmax, | 1248 | .proc_handler = proc_dointvec_minmax, |
| 1412 | .strategy = &sysctl_intvec, | ||
| 1413 | .extra1 = &zero, | 1249 | .extra1 = &zero, |
| 1414 | .extra2 = &one, | 1250 | .extra2 = &one, |
| 1415 | }, | 1251 | }, |
| 1416 | { | 1252 | { |
| 1417 | .ctl_name = CTL_UNNUMBERED, | ||
| 1418 | .procname = "memory_failure_recovery", | 1253 | .procname = "memory_failure_recovery", |
| 1419 | .data = &sysctl_memory_failure_recovery, | 1254 | .data = &sysctl_memory_failure_recovery, |
| 1420 | .maxlen = sizeof(sysctl_memory_failure_recovery), | 1255 | .maxlen = sizeof(sysctl_memory_failure_recovery), |
| 1421 | .mode = 0644, | 1256 | .mode = 0644, |
| 1422 | .proc_handler = &proc_dointvec_minmax, | 1257 | .proc_handler = proc_dointvec_minmax, |
| 1423 | .strategy = &sysctl_intvec, | ||
| 1424 | .extra1 = &zero, | 1258 | .extra1 = &zero, |
| 1425 | .extra2 = &one, | 1259 | .extra2 = &one, |
| 1426 | }, | 1260 | }, |
| @@ -1430,116 +1264,104 @@ static struct ctl_table vm_table[] = { | |||
| 1430 | * NOTE: do not add new entries to this table unless you have read | 1264 | * NOTE: do not add new entries to this table unless you have read |
| 1431 | * Documentation/sysctl/ctl_unnumbered.txt | 1265 | * Documentation/sysctl/ctl_unnumbered.txt |
| 1432 | */ | 1266 | */ |
| 1433 | { .ctl_name = 0 } | 1267 | { } |
| 1434 | }; | 1268 | }; |
| 1435 | 1269 | ||
| 1436 | #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) | 1270 | #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) |
| 1437 | static struct ctl_table binfmt_misc_table[] = { | 1271 | static struct ctl_table binfmt_misc_table[] = { |
| 1438 | { .ctl_name = 0 } | 1272 | { } |
| 1439 | }; | 1273 | }; |
| 1440 | #endif | 1274 | #endif |
| 1441 | 1275 | ||
| 1442 | static struct ctl_table fs_table[] = { | 1276 | static struct ctl_table fs_table[] = { |
| 1443 | { | 1277 | { |
| 1444 | .ctl_name = FS_NRINODE, | ||
| 1445 | .procname = "inode-nr", | 1278 | .procname = "inode-nr", |
| 1446 | .data = &inodes_stat, | 1279 | .data = &inodes_stat, |
| 1447 | .maxlen = 2*sizeof(int), | 1280 | .maxlen = 2*sizeof(int), |
| 1448 | .mode = 0444, | 1281 | .mode = 0444, |
| 1449 | .proc_handler = &proc_dointvec, | 1282 | .proc_handler = proc_dointvec, |
| 1450 | }, | 1283 | }, |
| 1451 | { | 1284 | { |
| 1452 | .ctl_name = FS_STATINODE, | ||
| 1453 | .procname = "inode-state", | 1285 | .procname = "inode-state", |
| 1454 | .data = &inodes_stat, | 1286 | .data = &inodes_stat, |
| 1455 | .maxlen = 7*sizeof(int), | 1287 | .maxlen = 7*sizeof(int), |
| 1456 | .mode = 0444, | 1288 | .mode = 0444, |
| 1457 | .proc_handler = &proc_dointvec, | 1289 | .proc_handler = proc_dointvec, |
| 1458 | }, | 1290 | }, |
| 1459 | { | 1291 | { |
| 1460 | .procname = "file-nr", | 1292 | .procname = "file-nr", |
| 1461 | .data = &files_stat, | 1293 | .data = &files_stat, |
| 1462 | .maxlen = 3*sizeof(int), | 1294 | .maxlen = 3*sizeof(int), |
| 1463 | .mode = 0444, | 1295 | .mode = 0444, |
| 1464 | .proc_handler = &proc_nr_files, | 1296 | .proc_handler = proc_nr_files, |
| 1465 | }, | 1297 | }, |
| 1466 | { | 1298 | { |
| 1467 | .ctl_name = FS_MAXFILE, | ||
| 1468 | .procname = "file-max", | 1299 | .procname = "file-max", |
| 1469 | .data = &files_stat.max_files, | 1300 | .data = &files_stat.max_files, |
| 1470 | .maxlen = sizeof(int), | 1301 | .maxlen = sizeof(int), |
| 1471 | .mode = 0644, | 1302 | .mode = 0644, |
| 1472 | .proc_handler = &proc_dointvec, | 1303 | .proc_handler = proc_dointvec, |
| 1473 | }, | 1304 | }, |
| 1474 | { | 1305 | { |
| 1475 | .ctl_name = CTL_UNNUMBERED, | ||
| 1476 | .procname = "nr_open", | 1306 | .procname = "nr_open", |
| 1477 | .data = &sysctl_nr_open, | 1307 | .data = &sysctl_nr_open, |
| 1478 | .maxlen = sizeof(int), | 1308 | .maxlen = sizeof(int), |
| 1479 | .mode = 0644, | 1309 | .mode = 0644, |
| 1480 | .proc_handler = &proc_dointvec_minmax, | 1310 | .proc_handler = proc_dointvec_minmax, |
| 1481 | .extra1 = &sysctl_nr_open_min, | 1311 | .extra1 = &sysctl_nr_open_min, |
| 1482 | .extra2 = &sysctl_nr_open_max, | 1312 | .extra2 = &sysctl_nr_open_max, |
| 1483 | }, | 1313 | }, |
| 1484 | { | 1314 | { |
| 1485 | .ctl_name = FS_DENTRY, | ||
| 1486 | .procname = "dentry-state", | 1315 | .procname = "dentry-state", |
| 1487 | .data = &dentry_stat, | 1316 | .data = &dentry_stat, |
| 1488 | .maxlen = 6*sizeof(int), | 1317 | .maxlen = 6*sizeof(int), |
| 1489 | .mode = 0444, | 1318 | .mode = 0444, |
| 1490 | .proc_handler = &proc_dointvec, | 1319 | .proc_handler = proc_dointvec, |
| 1491 | }, | 1320 | }, |
| 1492 | { | 1321 | { |
| 1493 | .ctl_name = FS_OVERFLOWUID, | ||
| 1494 | .procname = "overflowuid", | 1322 | .procname = "overflowuid", |
| 1495 | .data = &fs_overflowuid, | 1323 | .data = &fs_overflowuid, |
| 1496 | .maxlen = sizeof(int), | 1324 | .maxlen = sizeof(int), |
| 1497 | .mode = 0644, | 1325 | .mode = 0644, |
| 1498 | .proc_handler = &proc_dointvec_minmax, | 1326 | .proc_handler = proc_dointvec_minmax, |
| 1499 | .strategy = &sysctl_intvec, | ||
| 1500 | .extra1 = &minolduid, | 1327 | .extra1 = &minolduid, |
| 1501 | .extra2 = &maxolduid, | 1328 | .extra2 = &maxolduid, |
| 1502 | }, | 1329 | }, |
| 1503 | { | 1330 | { |
| 1504 | .ctl_name = FS_OVERFLOWGID, | ||
| 1505 | .procname = "overflowgid", | 1331 | .procname = "overflowgid", |
| 1506 | .data = &fs_overflowgid, | 1332 | .data = &fs_overflowgid, |
| 1507 | .maxlen = sizeof(int), | 1333 | .maxlen = sizeof(int), |
| 1508 | .mode = 0644, | 1334 | .mode = 0644, |
| 1509 | .proc_handler = &proc_dointvec_minmax, | 1335 | .proc_handler = proc_dointvec_minmax, |
| 1510 | .strategy = &sysctl_intvec, | ||
| 1511 | .extra1 = &minolduid, | 1336 | .extra1 = &minolduid, |
| 1512 | .extra2 = &maxolduid, | 1337 | .extra2 = &maxolduid, |
| 1513 | }, | 1338 | }, |
| 1514 | #ifdef CONFIG_FILE_LOCKING | 1339 | #ifdef CONFIG_FILE_LOCKING |
| 1515 | { | 1340 | { |
| 1516 | .ctl_name = FS_LEASES, | ||
| 1517 | .procname = "leases-enable", | 1341 | .procname = "leases-enable", |
| 1518 | .data = &leases_enable, | 1342 | .data = &leases_enable, |
| 1519 | .maxlen = sizeof(int), | 1343 | .maxlen = sizeof(int), |
| 1520 | .mode = 0644, | 1344 | .mode = 0644, |
| 1521 | .proc_handler = &proc_dointvec, | 1345 | .proc_handler = proc_dointvec, |
| 1522 | }, | 1346 | }, |
| 1523 | #endif | 1347 | #endif |
| 1524 | #ifdef CONFIG_DNOTIFY | 1348 | #ifdef CONFIG_DNOTIFY |
| 1525 | { | 1349 | { |
| 1526 | .ctl_name = FS_DIR_NOTIFY, | ||
| 1527 | .procname = "dir-notify-enable", | 1350 | .procname = "dir-notify-enable", |
| 1528 | .data = &dir_notify_enable, | 1351 | .data = &dir_notify_enable, |
| 1529 | .maxlen = sizeof(int), | 1352 | .maxlen = sizeof(int), |
| 1530 | .mode = 0644, | 1353 | .mode = 0644, |
| 1531 | .proc_handler = &proc_dointvec, | 1354 | .proc_handler = proc_dointvec, |
| 1532 | }, | 1355 | }, |
| 1533 | #endif | 1356 | #endif |
| 1534 | #ifdef CONFIG_MMU | 1357 | #ifdef CONFIG_MMU |
| 1535 | #ifdef CONFIG_FILE_LOCKING | 1358 | #ifdef CONFIG_FILE_LOCKING |
| 1536 | { | 1359 | { |
| 1537 | .ctl_name = FS_LEASE_TIME, | ||
| 1538 | .procname = "lease-break-time", | 1360 | .procname = "lease-break-time", |
| 1539 | .data = &lease_break_time, | 1361 | .data = &lease_break_time, |
| 1540 | .maxlen = sizeof(int), | 1362 | .maxlen = sizeof(int), |
| 1541 | .mode = 0644, | 1363 | .mode = 0644, |
| 1542 | .proc_handler = &proc_dointvec, | 1364 | .proc_handler = proc_dointvec, |
| 1543 | }, | 1365 | }, |
| 1544 | #endif | 1366 | #endif |
| 1545 | #ifdef CONFIG_AIO | 1367 | #ifdef CONFIG_AIO |
| @@ -1548,19 +1370,18 @@ static struct ctl_table fs_table[] = { | |||
| 1548 | .data = &aio_nr, | 1370 | .data = &aio_nr, |
| 1549 | .maxlen = sizeof(aio_nr), | 1371 | .maxlen = sizeof(aio_nr), |
| 1550 | .mode = 0444, | 1372 | .mode = 0444, |
| 1551 | .proc_handler = &proc_doulongvec_minmax, | 1373 | .proc_handler = proc_doulongvec_minmax, |
| 1552 | }, | 1374 | }, |
| 1553 | { | 1375 | { |
| 1554 | .procname = "aio-max-nr", | 1376 | .procname = "aio-max-nr", |
| 1555 | .data = &aio_max_nr, | 1377 | .data = &aio_max_nr, |
| 1556 | .maxlen = sizeof(aio_max_nr), | 1378 | .maxlen = sizeof(aio_max_nr), |
| 1557 | .mode = 0644, | 1379 | .mode = 0644, |
| 1558 | .proc_handler = &proc_doulongvec_minmax, | 1380 | .proc_handler = proc_doulongvec_minmax, |
| 1559 | }, | 1381 | }, |
| 1560 | #endif /* CONFIG_AIO */ | 1382 | #endif /* CONFIG_AIO */ |
| 1561 | #ifdef CONFIG_INOTIFY_USER | 1383 | #ifdef CONFIG_INOTIFY_USER |
| 1562 | { | 1384 | { |
| 1563 | .ctl_name = FS_INOTIFY, | ||
| 1564 | .procname = "inotify", | 1385 | .procname = "inotify", |
| 1565 | .mode = 0555, | 1386 | .mode = 0555, |
| 1566 | .child = inotify_table, | 1387 | .child = inotify_table, |
| @@ -1575,19 +1396,16 @@ static struct ctl_table fs_table[] = { | |||
| 1575 | #endif | 1396 | #endif |
| 1576 | #endif | 1397 | #endif |
| 1577 | { | 1398 | { |
| 1578 | .ctl_name = KERN_SETUID_DUMPABLE, | ||
| 1579 | .procname = "suid_dumpable", | 1399 | .procname = "suid_dumpable", |
| 1580 | .data = &suid_dumpable, | 1400 | .data = &suid_dumpable, |
| 1581 | .maxlen = sizeof(int), | 1401 | .maxlen = sizeof(int), |
| 1582 | .mode = 0644, | 1402 | .mode = 0644, |
| 1583 | .proc_handler = &proc_dointvec_minmax, | 1403 | .proc_handler = proc_dointvec_minmax, |
| 1584 | .strategy = &sysctl_intvec, | ||
| 1585 | .extra1 = &zero, | 1404 | .extra1 = &zero, |
| 1586 | .extra2 = &two, | 1405 | .extra2 = &two, |
| 1587 | }, | 1406 | }, |
| 1588 | #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) | 1407 | #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) |
| 1589 | { | 1408 | { |
| 1590 | .ctl_name = CTL_UNNUMBERED, | ||
| 1591 | .procname = "binfmt_misc", | 1409 | .procname = "binfmt_misc", |
| 1592 | .mode = 0555, | 1410 | .mode = 0555, |
| 1593 | .child = binfmt_misc_table, | 1411 | .child = binfmt_misc_table, |
| @@ -1597,13 +1415,12 @@ static struct ctl_table fs_table[] = { | |||
| 1597 | * NOTE: do not add new entries to this table unless you have read | 1415 | * NOTE: do not add new entries to this table unless you have read |
| 1598 | * Documentation/sysctl/ctl_unnumbered.txt | 1416 | * Documentation/sysctl/ctl_unnumbered.txt |
| 1599 | */ | 1417 | */ |
| 1600 | { .ctl_name = 0 } | 1418 | { } |
| 1601 | }; | 1419 | }; |
| 1602 | 1420 | ||
| 1603 | static struct ctl_table debug_table[] = { | 1421 | static struct ctl_table debug_table[] = { |
| 1604 | #if defined(CONFIG_X86) || defined(CONFIG_PPC) | 1422 | #if defined(CONFIG_X86) || defined(CONFIG_PPC) |
| 1605 | { | 1423 | { |
| 1606 | .ctl_name = CTL_UNNUMBERED, | ||
| 1607 | .procname = "exception-trace", | 1424 | .procname = "exception-trace", |
| 1608 | .data = &show_unhandled_signals, | 1425 | .data = &show_unhandled_signals, |
| 1609 | .maxlen = sizeof(int), | 1426 | .maxlen = sizeof(int), |
| @@ -1611,11 +1428,11 @@ static struct ctl_table debug_table[] = { | |||
| 1611 | .proc_handler = proc_dointvec | 1428 | .proc_handler = proc_dointvec |
| 1612 | }, | 1429 | }, |
| 1613 | #endif | 1430 | #endif |
| 1614 | { .ctl_name = 0 } | 1431 | { } |
| 1615 | }; | 1432 | }; |
| 1616 | 1433 | ||
| 1617 | static struct ctl_table dev_table[] = { | 1434 | static struct ctl_table dev_table[] = { |
| 1618 | { .ctl_name = 0 } | 1435 | { } |
| 1619 | }; | 1436 | }; |
| 1620 | 1437 | ||
| 1621 | static DEFINE_SPINLOCK(sysctl_lock); | 1438 | static DEFINE_SPINLOCK(sysctl_lock); |
| @@ -1769,122 +1586,6 @@ void register_sysctl_root(struct ctl_table_root *root) | |||
| 1769 | spin_unlock(&sysctl_lock); | 1586 | spin_unlock(&sysctl_lock); |
| 1770 | } | 1587 | } |
| 1771 | 1588 | ||
| 1772 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
| 1773 | /* Perform the actual read/write of a sysctl table entry. */ | ||
| 1774 | static int do_sysctl_strategy(struct ctl_table_root *root, | ||
| 1775 | struct ctl_table *table, | ||
| 1776 | void __user *oldval, size_t __user *oldlenp, | ||
| 1777 | void __user *newval, size_t newlen) | ||
| 1778 | { | ||
| 1779 | int op = 0, rc; | ||
| 1780 | |||
| 1781 | if (oldval) | ||
| 1782 | op |= MAY_READ; | ||
| 1783 | if (newval) | ||
| 1784 | op |= MAY_WRITE; | ||
| 1785 | if (sysctl_perm(root, table, op)) | ||
| 1786 | return -EPERM; | ||
| 1787 | |||
| 1788 | if (table->strategy) { | ||
| 1789 | rc = table->strategy(table, oldval, oldlenp, newval, newlen); | ||
| 1790 | if (rc < 0) | ||
| 1791 | return rc; | ||
| 1792 | if (rc > 0) | ||
| 1793 | return 0; | ||
| 1794 | } | ||
| 1795 | |||
| 1796 | /* If there is no strategy routine, or if the strategy returns | ||
| 1797 | * zero, proceed with automatic r/w */ | ||
| 1798 | if (table->data && table->maxlen) { | ||
| 1799 | rc = sysctl_data(table, oldval, oldlenp, newval, newlen); | ||
| 1800 | if (rc < 0) | ||
| 1801 | return rc; | ||
| 1802 | } | ||
| 1803 | return 0; | ||
| 1804 | } | ||
| 1805 | |||
| 1806 | static int parse_table(int __user *name, int nlen, | ||
| 1807 | void __user *oldval, size_t __user *oldlenp, | ||
| 1808 | void __user *newval, size_t newlen, | ||
| 1809 | struct ctl_table_root *root, | ||
| 1810 | struct ctl_table *table) | ||
| 1811 | { | ||
| 1812 | int n; | ||
| 1813 | repeat: | ||
| 1814 | if (!nlen) | ||
| 1815 | return -ENOTDIR; | ||
| 1816 | if (get_user(n, name)) | ||
| 1817 | return -EFAULT; | ||
| 1818 | for ( ; table->ctl_name || table->procname; table++) { | ||
| 1819 | if (!table->ctl_name) | ||
| 1820 | continue; | ||
| 1821 | if (n == table->ctl_name) { | ||
| 1822 | int error; | ||
| 1823 | if (table->child) { | ||
| 1824 | if (sysctl_perm(root, table, MAY_EXEC)) | ||
| 1825 | return -EPERM; | ||
| 1826 | name++; | ||
| 1827 | nlen--; | ||
| 1828 | table = table->child; | ||
| 1829 | goto repeat; | ||
| 1830 | } | ||
| 1831 | error = do_sysctl_strategy(root, table, | ||
| 1832 | oldval, oldlenp, | ||
| 1833 | newval, newlen); | ||
| 1834 | return error; | ||
| 1835 | } | ||
| 1836 | } | ||
| 1837 | return -ENOTDIR; | ||
| 1838 | } | ||
| 1839 | |||
| 1840 | int do_sysctl(int __user *name, int nlen, void __user *oldval, size_t __user *oldlenp, | ||
| 1841 | void __user *newval, size_t newlen) | ||
| 1842 | { | ||
| 1843 | struct ctl_table_header *head; | ||
| 1844 | int error = -ENOTDIR; | ||
| 1845 | |||
| 1846 | if (nlen <= 0 || nlen >= CTL_MAXNAME) | ||
| 1847 | return -ENOTDIR; | ||
| 1848 | if (oldval) { | ||
| 1849 | int old_len; | ||
| 1850 | if (!oldlenp || get_user(old_len, oldlenp)) | ||
| 1851 | return -EFAULT; | ||
| 1852 | } | ||
| 1853 | |||
| 1854 | for (head = sysctl_head_next(NULL); head; | ||
| 1855 | head = sysctl_head_next(head)) { | ||
| 1856 | error = parse_table(name, nlen, oldval, oldlenp, | ||
| 1857 | newval, newlen, | ||
| 1858 | head->root, head->ctl_table); | ||
| 1859 | if (error != -ENOTDIR) { | ||
| 1860 | sysctl_head_finish(head); | ||
| 1861 | break; | ||
| 1862 | } | ||
| 1863 | } | ||
| 1864 | return error; | ||
| 1865 | } | ||
| 1866 | |||
| 1867 | SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args) | ||
| 1868 | { | ||
| 1869 | struct __sysctl_args tmp; | ||
| 1870 | int error; | ||
| 1871 | |||
| 1872 | if (copy_from_user(&tmp, args, sizeof(tmp))) | ||
| 1873 | return -EFAULT; | ||
| 1874 | |||
| 1875 | error = deprecated_sysctl_warning(&tmp); | ||
| 1876 | if (error) | ||
| 1877 | goto out; | ||
| 1878 | |||
| 1879 | lock_kernel(); | ||
| 1880 | error = do_sysctl(tmp.name, tmp.nlen, tmp.oldval, tmp.oldlenp, | ||
| 1881 | tmp.newval, tmp.newlen); | ||
| 1882 | unlock_kernel(); | ||
| 1883 | out: | ||
| 1884 | return error; | ||
| 1885 | } | ||
| 1886 | #endif /* CONFIG_SYSCTL_SYSCALL */ | ||
| 1887 | |||
| 1888 | /* | 1589 | /* |
| 1889 | * sysctl_perm does NOT grant the superuser all rights automatically, because | 1590 | * sysctl_perm does NOT grant the superuser all rights automatically, because |
| 1890 | * some sysctl variables are readonly even to root. | 1591 | * some sysctl variables are readonly even to root. |
| @@ -1920,7 +1621,7 @@ int sysctl_perm(struct ctl_table_root *root, struct ctl_table *table, int op) | |||
| 1920 | 1621 | ||
| 1921 | static void sysctl_set_parent(struct ctl_table *parent, struct ctl_table *table) | 1622 | static void sysctl_set_parent(struct ctl_table *parent, struct ctl_table *table) |
| 1922 | { | 1623 | { |
| 1923 | for (; table->ctl_name || table->procname; table++) { | 1624 | for (; table->procname; table++) { |
| 1924 | table->parent = parent; | 1625 | table->parent = parent; |
| 1925 | if (table->child) | 1626 | if (table->child) |
| 1926 | sysctl_set_parent(table, table->child); | 1627 | sysctl_set_parent(table, table->child); |
| @@ -1952,11 +1653,11 @@ static struct ctl_table *is_branch_in(struct ctl_table *branch, | |||
| 1952 | return NULL; | 1653 | return NULL; |
| 1953 | 1654 | ||
| 1954 | /* ... and nothing else */ | 1655 | /* ... and nothing else */ |
| 1955 | if (branch[1].procname || branch[1].ctl_name) | 1656 | if (branch[1].procname) |
| 1956 | return NULL; | 1657 | return NULL; |
| 1957 | 1658 | ||
| 1958 | /* table should contain subdirectory with the same name */ | 1659 | /* table should contain subdirectory with the same name */ |
| 1959 | for (p = table; p->procname || p->ctl_name; p++) { | 1660 | for (p = table; p->procname; p++) { |
| 1960 | if (!p->child) | 1661 | if (!p->child) |
| 1961 | continue; | 1662 | continue; |
| 1962 | if (p->procname && strcmp(p->procname, s) == 0) | 1663 | if (p->procname && strcmp(p->procname, s) == 0) |
| @@ -2001,9 +1702,6 @@ static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q) | |||
| 2001 | * | 1702 | * |
| 2002 | * The members of the &struct ctl_table structure are used as follows: | 1703 | * The members of the &struct ctl_table structure are used as follows: |
| 2003 | * | 1704 | * |
| 2004 | * ctl_name - This is the numeric sysctl value used by sysctl(2). The number | ||
| 2005 | * must be unique within that level of sysctl | ||
| 2006 | * | ||
| 2007 | * procname - the name of the sysctl file under /proc/sys. Set to %NULL to not | 1705 | * procname - the name of the sysctl file under /proc/sys. Set to %NULL to not |
| 2008 | * enter a sysctl file | 1706 | * enter a sysctl file |
| 2009 | * | 1707 | * |
| @@ -2018,8 +1716,6 @@ static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q) | |||
| 2018 | * | 1716 | * |
| 2019 | * proc_handler - the text handler routine (described below) | 1717 | * proc_handler - the text handler routine (described below) |
| 2020 | * | 1718 | * |
| 2021 | * strategy - the strategy routine (described below) | ||
| 2022 | * | ||
| 2023 | * de - for internal use by the sysctl routines | 1719 | * de - for internal use by the sysctl routines |
| 2024 | * | 1720 | * |
| 2025 | * extra1, extra2 - extra pointers usable by the proc handler routines | 1721 | * extra1, extra2 - extra pointers usable by the proc handler routines |
| @@ -2032,19 +1728,6 @@ static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q) | |||
| 2032 | * struct enable minimal validation of the values being written to be | 1728 | * struct enable minimal validation of the values being written to be |
| 2033 | * performed, and the mode field allows minimal authentication. | 1729 | * performed, and the mode field allows minimal authentication. |
| 2034 | * | 1730 | * |
| 2035 | * More sophisticated management can be enabled by the provision of a | ||
| 2036 | * strategy routine with the table entry. This will be called before | ||
| 2037 | * any automatic read or write of the data is performed. | ||
| 2038 | * | ||
| 2039 | * The strategy routine may return | ||
| 2040 | * | ||
| 2041 | * < 0 - Error occurred (error is passed to user process) | ||
| 2042 | * | ||
| 2043 | * 0 - OK - proceed with automatic read or write. | ||
| 2044 | * | ||
| 2045 | * > 0 - OK - read or write has been done by the strategy routine, so | ||
| 2046 | * return immediately. | ||
| 2047 | * | ||
| 2048 | * There must be a proc_handler routine for any terminal nodes | 1731 | * There must be a proc_handler routine for any terminal nodes |
| 2049 | * mirrored under /proc/sys (non-terminals are handled by a built-in | 1732 | * mirrored under /proc/sys (non-terminals are handled by a built-in |
| 2050 | * directory handler). Several default handlers are available to | 1733 | * directory handler). Several default handlers are available to |
| @@ -2071,13 +1754,13 @@ struct ctl_table_header *__register_sysctl_paths( | |||
| 2071 | struct ctl_table_set *set; | 1754 | struct ctl_table_set *set; |
| 2072 | 1755 | ||
| 2073 | /* Count the path components */ | 1756 | /* Count the path components */ |
| 2074 | for (npath = 0; path[npath].ctl_name || path[npath].procname; ++npath) | 1757 | for (npath = 0; path[npath].procname; ++npath) |
| 2075 | ; | 1758 | ; |
| 2076 | 1759 | ||
| 2077 | /* | 1760 | /* |
| 2078 | * For each path component, allocate a 2-element ctl_table array. | 1761 | * For each path component, allocate a 2-element ctl_table array. |
| 2079 | * The first array element will be filled with the sysctl entry | 1762 | * The first array element will be filled with the sysctl entry |
| 2080 | * for this, the second will be the sentinel (ctl_name == 0). | 1763 | * for this, the second will be the sentinel (procname == 0). |
| 2081 | * | 1764 | * |
| 2082 | * We allocate everything in one go so that we don't have to | 1765 | * We allocate everything in one go so that we don't have to |
| 2083 | * worry about freeing additional memory in unregister_sysctl_table. | 1766 | * worry about freeing additional memory in unregister_sysctl_table. |
| @@ -2094,7 +1777,6 @@ struct ctl_table_header *__register_sysctl_paths( | |||
| 2094 | for (n = 0; n < npath; ++n, ++path) { | 1777 | for (n = 0; n < npath; ++n, ++path) { |
| 2095 | /* Copy the procname */ | 1778 | /* Copy the procname */ |
| 2096 | new->procname = path->procname; | 1779 | new->procname = path->procname; |
| 2097 | new->ctl_name = path->ctl_name; | ||
| 2098 | new->mode = 0555; | 1780 | new->mode = 0555; |
| 2099 | 1781 | ||
| 2100 | *prevp = new; | 1782 | *prevp = new; |
| @@ -2956,286 +2638,6 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, | |||
| 2956 | 2638 | ||
| 2957 | #endif /* CONFIG_PROC_FS */ | 2639 | #endif /* CONFIG_PROC_FS */ |
| 2958 | 2640 | ||
| 2959 | |||
| 2960 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
| 2961 | /* | ||
| 2962 | * General sysctl support routines | ||
| 2963 | */ | ||
| 2964 | |||
| 2965 | /* The generic sysctl data routine (used if no strategy routine supplied) */ | ||
| 2966 | int sysctl_data(struct ctl_table *table, | ||
| 2967 | void __user *oldval, size_t __user *oldlenp, | ||
| 2968 | void __user *newval, size_t newlen) | ||
| 2969 | { | ||
| 2970 | size_t len; | ||
| 2971 | |||
| 2972 | /* Get out of I don't have a variable */ | ||
| 2973 | if (!table->data || !table->maxlen) | ||
| 2974 | return -ENOTDIR; | ||
| 2975 | |||
| 2976 | if (oldval && oldlenp) { | ||
| 2977 | if (get_user(len, oldlenp)) | ||
| 2978 | return -EFAULT; | ||
| 2979 | if (len) { | ||
| 2980 | if (len > table->maxlen) | ||
| 2981 | len = table->maxlen; | ||
| 2982 | if (copy_to_user(oldval, table->data, len)) | ||
| 2983 | return -EFAULT; | ||
| 2984 | if (put_user(len, oldlenp)) | ||
| 2985 | return -EFAULT; | ||
| 2986 | } | ||
| 2987 | } | ||
| 2988 | |||
| 2989 | if (newval && newlen) { | ||
| 2990 | if (newlen > table->maxlen) | ||
| 2991 | newlen = table->maxlen; | ||
| 2992 | |||
| 2993 | if (copy_from_user(table->data, newval, newlen)) | ||
| 2994 | return -EFAULT; | ||
| 2995 | } | ||
| 2996 | return 1; | ||
| 2997 | } | ||
| 2998 | |||
| 2999 | /* The generic string strategy routine: */ | ||
| 3000 | int sysctl_string(struct ctl_table *table, | ||
| 3001 | void __user *oldval, size_t __user *oldlenp, | ||
| 3002 | void __user *newval, size_t newlen) | ||
| 3003 | { | ||
| 3004 | if (!table->data || !table->maxlen) | ||
| 3005 | return -ENOTDIR; | ||
| 3006 | |||
| 3007 | if (oldval && oldlenp) { | ||
| 3008 | size_t bufsize; | ||
| 3009 | if (get_user(bufsize, oldlenp)) | ||
| 3010 | return -EFAULT; | ||
| 3011 | if (bufsize) { | ||
| 3012 | size_t len = strlen(table->data), copied; | ||
| 3013 | |||
| 3014 | /* This shouldn't trigger for a well-formed sysctl */ | ||
| 3015 | if (len > table->maxlen) | ||
| 3016 | len = table->maxlen; | ||
| 3017 | |||
| 3018 | /* Copy up to a max of bufsize-1 bytes of the string */ | ||
| 3019 | copied = (len >= bufsize) ? bufsize - 1 : len; | ||
| 3020 | |||
| 3021 | if (copy_to_user(oldval, table->data, copied) || | ||
| 3022 | put_user(0, (char __user *)(oldval + copied))) | ||
| 3023 | return -EFAULT; | ||
| 3024 | if (put_user(len, oldlenp)) | ||
| 3025 | return -EFAULT; | ||
| 3026 | } | ||
| 3027 | } | ||
| 3028 | if (newval && newlen) { | ||
| 3029 | size_t len = newlen; | ||
| 3030 | if (len > table->maxlen) | ||
| 3031 | len = table->maxlen; | ||
| 3032 | if(copy_from_user(table->data, newval, len)) | ||
| 3033 | return -EFAULT; | ||
| 3034 | if (len == table->maxlen) | ||
| 3035 | len--; | ||
| 3036 | ((char *) table->data)[len] = 0; | ||
| 3037 | } | ||
| 3038 | return 1; | ||
| 3039 | } | ||
| 3040 | |||
| 3041 | /* | ||
| 3042 | * This function makes sure that all of the integers in the vector | ||
| 3043 | * are between the minimum and maximum values given in the arrays | ||
| 3044 | * table->extra1 and table->extra2, respectively. | ||
| 3045 | */ | ||
| 3046 | int sysctl_intvec(struct ctl_table *table, | ||
| 3047 | void __user *oldval, size_t __user *oldlenp, | ||
| 3048 | void __user *newval, size_t newlen) | ||
| 3049 | { | ||
| 3050 | |||
| 3051 | if (newval && newlen) { | ||
| 3052 | int __user *vec = (int __user *) newval; | ||
| 3053 | int *min = (int *) table->extra1; | ||
| 3054 | int *max = (int *) table->extra2; | ||
| 3055 | size_t length; | ||
| 3056 | int i; | ||
| 3057 | |||
| 3058 | if (newlen % sizeof(int) != 0) | ||
| 3059 | return -EINVAL; | ||
| 3060 | |||
| 3061 | if (!table->extra1 && !table->extra2) | ||
| 3062 | return 0; | ||
| 3063 | |||
| 3064 | if (newlen > table->maxlen) | ||
| 3065 | newlen = table->maxlen; | ||
| 3066 | length = newlen / sizeof(int); | ||
| 3067 | |||
| 3068 | for (i = 0; i < length; i++) { | ||
| 3069 | int value; | ||
| 3070 | if (get_user(value, vec + i)) | ||
| 3071 | return -EFAULT; | ||
| 3072 | if (min && value < min[i]) | ||
| 3073 | return -EINVAL; | ||
| 3074 | if (max && value > max[i]) | ||
| 3075 | return -EINVAL; | ||
| 3076 | } | ||
| 3077 | } | ||
| 3078 | return 0; | ||
| 3079 | } | ||
| 3080 | |||
| 3081 | /* Strategy function to convert jiffies to seconds */ | ||
| 3082 | int sysctl_jiffies(struct ctl_table *table, | ||
| 3083 | void __user *oldval, size_t __user *oldlenp, | ||
| 3084 | void __user *newval, size_t newlen) | ||
| 3085 | { | ||
| 3086 | if (oldval && oldlenp) { | ||
| 3087 | size_t olen; | ||
| 3088 | |||
| 3089 | if (get_user(olen, oldlenp)) | ||
| 3090 | return -EFAULT; | ||
| 3091 | if (olen) { | ||
| 3092 | int val; | ||
| 3093 | |||
| 3094 | if (olen < sizeof(int)) | ||
| 3095 | return -EINVAL; | ||
| 3096 | |||
| 3097 | val = *(int *)(table->data) / HZ; | ||
| 3098 | if (put_user(val, (int __user *)oldval)) | ||
| 3099 | return -EFAULT; | ||
| 3100 | if (put_user(sizeof(int), oldlenp)) | ||
| 3101 | return -EFAULT; | ||
| 3102 | } | ||
| 3103 | } | ||
| 3104 | if (newval && newlen) { | ||
| 3105 | int new; | ||
| 3106 | if (newlen != sizeof(int)) | ||
| 3107 | return -EINVAL; | ||
| 3108 | if (get_user(new, (int __user *)newval)) | ||
| 3109 | return -EFAULT; | ||
| 3110 | *(int *)(table->data) = new*HZ; | ||
| 3111 | } | ||
| 3112 | return 1; | ||
| 3113 | } | ||
| 3114 | |||
| 3115 | /* Strategy function to convert jiffies to seconds */ | ||
| 3116 | int sysctl_ms_jiffies(struct ctl_table *table, | ||
| 3117 | void __user *oldval, size_t __user *oldlenp, | ||
| 3118 | void __user *newval, size_t newlen) | ||
| 3119 | { | ||
| 3120 | if (oldval && oldlenp) { | ||
| 3121 | size_t olen; | ||
| 3122 | |||
| 3123 | if (get_user(olen, oldlenp)) | ||
| 3124 | return -EFAULT; | ||
| 3125 | if (olen) { | ||
| 3126 | int val; | ||
| 3127 | |||
| 3128 | if (olen < sizeof(int)) | ||
| 3129 | return -EINVAL; | ||
| 3130 | |||
| 3131 | val = jiffies_to_msecs(*(int *)(table->data)); | ||
| 3132 | if (put_user(val, (int __user *)oldval)) | ||
| 3133 | return -EFAULT; | ||
| 3134 | if (put_user(sizeof(int), oldlenp)) | ||
| 3135 | return -EFAULT; | ||
| 3136 | } | ||
| 3137 | } | ||
| 3138 | if (newval && newlen) { | ||
| 3139 | int new; | ||
| 3140 | if (newlen != sizeof(int)) | ||
| 3141 | return -EINVAL; | ||
| 3142 | if (get_user(new, (int __user *)newval)) | ||
| 3143 | return -EFAULT; | ||
| 3144 | *(int *)(table->data) = msecs_to_jiffies(new); | ||
| 3145 | } | ||
| 3146 | return 1; | ||
| 3147 | } | ||
| 3148 | |||
| 3149 | |||
| 3150 | |||
| 3151 | #else /* CONFIG_SYSCTL_SYSCALL */ | ||
| 3152 | |||
| 3153 | |||
| 3154 | SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args) | ||
| 3155 | { | ||
| 3156 | struct __sysctl_args tmp; | ||
| 3157 | int error; | ||
| 3158 | |||
| 3159 | if (copy_from_user(&tmp, args, sizeof(tmp))) | ||
| 3160 | return -EFAULT; | ||
| 3161 | |||
| 3162 | error = deprecated_sysctl_warning(&tmp); | ||
| 3163 | |||
| 3164 | /* If no error reading the parameters then just -ENOSYS ... */ | ||
| 3165 | if (!error) | ||
| 3166 | error = -ENOSYS; | ||
| 3167 | |||
| 3168 | return error; | ||
| 3169 | } | ||
| 3170 | |||
| 3171 | int sysctl_data(struct ctl_table *table, | ||
| 3172 | void __user *oldval, size_t __user *oldlenp, | ||
| 3173 | void __user *newval, size_t newlen) | ||
| 3174 | { | ||
| 3175 | return -ENOSYS; | ||
| 3176 | } | ||
| 3177 | |||
| 3178 | int sysctl_string(struct ctl_table *table, | ||
| 3179 | void __user *oldval, size_t __user *oldlenp, | ||
| 3180 | void __user *newval, size_t newlen) | ||
| 3181 | { | ||
| 3182 | return -ENOSYS; | ||
| 3183 | } | ||
| 3184 | |||
| 3185 | int sysctl_intvec(struct ctl_table *table, | ||
| 3186 | void __user *oldval, size_t __user *oldlenp, | ||
| 3187 | void __user *newval, size_t newlen) | ||
| 3188 | { | ||
| 3189 | return -ENOSYS; | ||
| 3190 | } | ||
| 3191 | |||
| 3192 | int sysctl_jiffies(struct ctl_table *table, | ||
| 3193 | void __user *oldval, size_t __user *oldlenp, | ||
| 3194 | void __user *newval, size_t newlen) | ||
| 3195 | { | ||
| 3196 | return -ENOSYS; | ||
| 3197 | } | ||
| 3198 | |||
| 3199 | int sysctl_ms_jiffies(struct ctl_table *table, | ||
| 3200 | void __user *oldval, size_t __user *oldlenp, | ||
| 3201 | void __user *newval, size_t newlen) | ||
| 3202 | { | ||
| 3203 | return -ENOSYS; | ||
| 3204 | } | ||
| 3205 | |||
| 3206 | #endif /* CONFIG_SYSCTL_SYSCALL */ | ||
| 3207 | |||
| 3208 | static int deprecated_sysctl_warning(struct __sysctl_args *args) | ||
| 3209 | { | ||
| 3210 | static int msg_count; | ||
| 3211 | int name[CTL_MAXNAME]; | ||
| 3212 | int i; | ||
| 3213 | |||
| 3214 | /* Check args->nlen. */ | ||
| 3215 | if (args->nlen < 0 || args->nlen > CTL_MAXNAME) | ||
| 3216 | return -ENOTDIR; | ||
| 3217 | |||
| 3218 | /* Read in the sysctl name for better debug message logging */ | ||
| 3219 | for (i = 0; i < args->nlen; i++) | ||
| 3220 | if (get_user(name[i], args->name + i)) | ||
| 3221 | return -EFAULT; | ||
| 3222 | |||
| 3223 | /* Ignore accesses to kernel.version */ | ||
| 3224 | if ((args->nlen == 2) && (name[0] == CTL_KERN) && (name[1] == KERN_VERSION)) | ||
| 3225 | return 0; | ||
| 3226 | |||
| 3227 | if (msg_count < 5) { | ||
| 3228 | msg_count++; | ||
| 3229 | printk(KERN_INFO | ||
| 3230 | "warning: process `%s' used the deprecated sysctl " | ||
| 3231 | "system call with ", current->comm); | ||
| 3232 | for (i = 0; i < args->nlen; i++) | ||
| 3233 | printk("%d.", name[i]); | ||
| 3234 | printk("\n"); | ||
| 3235 | } | ||
| 3236 | return 0; | ||
| 3237 | } | ||
| 3238 | |||
| 3239 | /* | 2641 | /* |
| 3240 | * No sense putting this after each symbol definition, twice, | 2642 | * No sense putting this after each symbol definition, twice, |
| 3241 | * exception granted :-) | 2643 | * exception granted :-) |
| @@ -3250,9 +2652,4 @@ EXPORT_SYMBOL(proc_doulongvec_minmax); | |||
| 3250 | EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax); | 2652 | EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax); |
| 3251 | EXPORT_SYMBOL(register_sysctl_table); | 2653 | EXPORT_SYMBOL(register_sysctl_table); |
| 3252 | EXPORT_SYMBOL(register_sysctl_paths); | 2654 | EXPORT_SYMBOL(register_sysctl_paths); |
| 3253 | EXPORT_SYMBOL(sysctl_intvec); | ||
| 3254 | EXPORT_SYMBOL(sysctl_jiffies); | ||
| 3255 | EXPORT_SYMBOL(sysctl_ms_jiffies); | ||
| 3256 | EXPORT_SYMBOL(sysctl_string); | ||
| 3257 | EXPORT_SYMBOL(sysctl_data); | ||
| 3258 | EXPORT_SYMBOL(unregister_sysctl_table); | 2655 | EXPORT_SYMBOL(unregister_sysctl_table); |
diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c new file mode 100644 index 000000000000..b75dbf40f573 --- /dev/null +++ b/kernel/sysctl_binary.c | |||
| @@ -0,0 +1,1507 @@ | |||
| 1 | #include <linux/stat.h> | ||
| 2 | #include <linux/sysctl.h> | ||
| 3 | #include "../fs/xfs/linux-2.6/xfs_sysctl.h" | ||
| 4 | #include <linux/sunrpc/debug.h> | ||
| 5 | #include <linux/string.h> | ||
| 6 | #include <net/ip_vs.h> | ||
| 7 | #include <linux/syscalls.h> | ||
| 8 | #include <linux/namei.h> | ||
| 9 | #include <linux/mount.h> | ||
| 10 | #include <linux/fs.h> | ||
| 11 | #include <linux/nsproxy.h> | ||
| 12 | #include <linux/pid_namespace.h> | ||
| 13 | #include <linux/file.h> | ||
| 14 | #include <linux/ctype.h> | ||
| 15 | #include <linux/netdevice.h> | ||
| 16 | |||
| 17 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
| 18 | |||
| 19 | struct bin_table; | ||
| 20 | typedef ssize_t bin_convert_t(struct file *file, | ||
| 21 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen); | ||
| 22 | |||
| 23 | static bin_convert_t bin_dir; | ||
| 24 | static bin_convert_t bin_string; | ||
| 25 | static bin_convert_t bin_intvec; | ||
| 26 | static bin_convert_t bin_ulongvec; | ||
| 27 | static bin_convert_t bin_uuid; | ||
| 28 | static bin_convert_t bin_dn_node_address; | ||
| 29 | |||
| 30 | #define CTL_DIR bin_dir | ||
| 31 | #define CTL_STR bin_string | ||
| 32 | #define CTL_INT bin_intvec | ||
| 33 | #define CTL_ULONG bin_ulongvec | ||
| 34 | #define CTL_UUID bin_uuid | ||
| 35 | #define CTL_DNADR bin_dn_node_address | ||
| 36 | |||
| 37 | #define BUFSZ 256 | ||
| 38 | |||
| 39 | struct bin_table { | ||
| 40 | bin_convert_t *convert; | ||
| 41 | int ctl_name; | ||
| 42 | const char *procname; | ||
| 43 | const struct bin_table *child; | ||
| 44 | }; | ||
| 45 | |||
| 46 | static const struct bin_table bin_random_table[] = { | ||
| 47 | { CTL_INT, RANDOM_POOLSIZE, "poolsize" }, | ||
| 48 | { CTL_INT, RANDOM_ENTROPY_COUNT, "entropy_avail" }, | ||
| 49 | { CTL_INT, RANDOM_READ_THRESH, "read_wakeup_threshold" }, | ||
| 50 | { CTL_INT, RANDOM_WRITE_THRESH, "write_wakeup_threshold" }, | ||
| 51 | { CTL_UUID, RANDOM_BOOT_ID, "boot_id" }, | ||
| 52 | { CTL_UUID, RANDOM_UUID, "uuid" }, | ||
| 53 | {} | ||
| 54 | }; | ||
| 55 | |||
| 56 | static const struct bin_table bin_pty_table[] = { | ||
| 57 | { CTL_INT, PTY_MAX, "max" }, | ||
| 58 | { CTL_INT, PTY_NR, "nr" }, | ||
| 59 | {} | ||
| 60 | }; | ||
| 61 | |||
| 62 | static const struct bin_table bin_kern_table[] = { | ||
| 63 | { CTL_STR, KERN_OSTYPE, "ostype" }, | ||
| 64 | { CTL_STR, KERN_OSRELEASE, "osrelease" }, | ||
| 65 | /* KERN_OSREV not used */ | ||
| 66 | { CTL_STR, KERN_VERSION, "version" }, | ||
| 67 | /* KERN_SECUREMASK not used */ | ||
| 68 | /* KERN_PROF not used */ | ||
| 69 | { CTL_STR, KERN_NODENAME, "hostname" }, | ||
| 70 | { CTL_STR, KERN_DOMAINNAME, "domainname" }, | ||
| 71 | |||
| 72 | { CTL_INT, KERN_PANIC, "panic" }, | ||
| 73 | { CTL_INT, KERN_REALROOTDEV, "real-root-dev" }, | ||
| 74 | |||
| 75 | { CTL_STR, KERN_SPARC_REBOOT, "reboot-cmd" }, | ||
| 76 | { CTL_INT, KERN_CTLALTDEL, "ctrl-alt-del" }, | ||
| 77 | { CTL_INT, KERN_PRINTK, "printk" }, | ||
| 78 | |||
| 79 | /* KERN_NAMETRANS not used */ | ||
| 80 | /* KERN_PPC_HTABRECLAIM not used */ | ||
| 81 | /* KERN_PPC_ZEROPAGED not used */ | ||
| 82 | { CTL_INT, KERN_PPC_POWERSAVE_NAP, "powersave-nap" }, | ||
| 83 | |||
| 84 | { CTL_STR, KERN_MODPROBE, "modprobe" }, | ||
| 85 | { CTL_INT, KERN_SG_BIG_BUFF, "sg-big-buff" }, | ||
| 86 | { CTL_INT, KERN_ACCT, "acct" }, | ||
| 87 | /* KERN_PPC_L2CR "l2cr" no longer used */ | ||
| 88 | |||
| 89 | /* KERN_RTSIGNR not used */ | ||
| 90 | /* KERN_RTSIGMAX not used */ | ||
| 91 | |||
| 92 | { CTL_ULONG, KERN_SHMMAX, "shmmax" }, | ||
| 93 | { CTL_INT, KERN_MSGMAX, "msgmax" }, | ||
| 94 | { CTL_INT, KERN_MSGMNB, "msgmnb" }, | ||
| 95 | /* KERN_MSGPOOL not used*/ | ||
| 96 | { CTL_INT, KERN_SYSRQ, "sysrq" }, | ||
| 97 | { CTL_INT, KERN_MAX_THREADS, "threads-max" }, | ||
| 98 | { CTL_DIR, KERN_RANDOM, "random", bin_random_table }, | ||
| 99 | { CTL_ULONG, KERN_SHMALL, "shmall" }, | ||
| 100 | { CTL_INT, KERN_MSGMNI, "msgmni" }, | ||
| 101 | { CTL_INT, KERN_SEM, "sem" }, | ||
| 102 | { CTL_INT, KERN_SPARC_STOP_A, "stop-a" }, | ||
| 103 | { CTL_INT, KERN_SHMMNI, "shmmni" }, | ||
| 104 | |||
| 105 | { CTL_INT, KERN_OVERFLOWUID, "overflowuid" }, | ||
| 106 | { CTL_INT, KERN_OVERFLOWGID, "overflowgid" }, | ||
| 107 | |||
| 108 | { CTL_STR, KERN_HOTPLUG, "hotplug", }, | ||
| 109 | { CTL_INT, KERN_IEEE_EMULATION_WARNINGS, "ieee_emulation_warnings" }, | ||
| 110 | |||
| 111 | { CTL_INT, KERN_S390_USER_DEBUG_LOGGING, "userprocess_debug" }, | ||
| 112 | { CTL_INT, KERN_CORE_USES_PID, "core_uses_pid" }, | ||
| 113 | /* KERN_TAINTED "tainted" no longer used */ | ||
| 114 | { CTL_INT, KERN_CADPID, "cad_pid" }, | ||
| 115 | { CTL_INT, KERN_PIDMAX, "pid_max" }, | ||
| 116 | { CTL_STR, KERN_CORE_PATTERN, "core_pattern" }, | ||
| 117 | { CTL_INT, KERN_PANIC_ON_OOPS, "panic_on_oops" }, | ||
| 118 | { CTL_INT, KERN_HPPA_PWRSW, "soft-power" }, | ||
| 119 | { CTL_INT, KERN_HPPA_UNALIGNED, "unaligned-trap" }, | ||
| 120 | |||
| 121 | { CTL_INT, KERN_PRINTK_RATELIMIT, "printk_ratelimit" }, | ||
| 122 | { CTL_INT, KERN_PRINTK_RATELIMIT_BURST, "printk_ratelimit_burst" }, | ||
| 123 | |||
| 124 | { CTL_DIR, KERN_PTY, "pty", bin_pty_table }, | ||
| 125 | { CTL_INT, KERN_NGROUPS_MAX, "ngroups_max" }, | ||
| 126 | { CTL_INT, KERN_SPARC_SCONS_PWROFF, "scons-poweroff" }, | ||
| 127 | /* KERN_HZ_TIMER "hz_timer" no longer used */ | ||
| 128 | { CTL_INT, KERN_UNKNOWN_NMI_PANIC, "unknown_nmi_panic" }, | ||
| 129 | { CTL_INT, KERN_BOOTLOADER_TYPE, "bootloader_type" }, | ||
| 130 | { CTL_INT, KERN_RANDOMIZE, "randomize_va_space" }, | ||
| 131 | |||
| 132 | { CTL_INT, KERN_SPIN_RETRY, "spin_retry" }, | ||
| 133 | /* KERN_ACPI_VIDEO_FLAGS "acpi_video_flags" no longer used */ | ||
| 134 | { CTL_INT, KERN_IA64_UNALIGNED, "ignore-unaligned-usertrap" }, | ||
| 135 | { CTL_INT, KERN_COMPAT_LOG, "compat-log" }, | ||
| 136 | { CTL_INT, KERN_MAX_LOCK_DEPTH, "max_lock_depth" }, | ||
| 137 | { CTL_INT, KERN_NMI_WATCHDOG, "nmi_watchdog" }, | ||
| 138 | { CTL_INT, KERN_PANIC_ON_NMI, "panic_on_unrecovered_nmi" }, | ||
| 139 | {} | ||
| 140 | }; | ||
| 141 | |||
| 142 | static const struct bin_table bin_vm_table[] = { | ||
| 143 | { CTL_INT, VM_OVERCOMMIT_MEMORY, "overcommit_memory" }, | ||
| 144 | { CTL_INT, VM_PAGE_CLUSTER, "page-cluster" }, | ||
| 145 | { CTL_INT, VM_DIRTY_BACKGROUND, "dirty_background_ratio" }, | ||
| 146 | { CTL_INT, VM_DIRTY_RATIO, "dirty_ratio" }, | ||
| 147 | /* VM_DIRTY_WB_CS "dirty_writeback_centisecs" no longer used */ | ||
| 148 | /* VM_DIRTY_EXPIRE_CS "dirty_expire_centisecs" no longer used */ | ||
| 149 | { CTL_INT, VM_NR_PDFLUSH_THREADS, "nr_pdflush_threads" }, | ||
| 150 | { CTL_INT, VM_OVERCOMMIT_RATIO, "overcommit_ratio" }, | ||
| 151 | /* VM_PAGEBUF unused */ | ||
| 152 | /* VM_HUGETLB_PAGES "nr_hugepages" no longer used */ | ||
| 153 | { CTL_INT, VM_SWAPPINESS, "swappiness" }, | ||
| 154 | { CTL_INT, VM_LOWMEM_RESERVE_RATIO, "lowmem_reserve_ratio" }, | ||
| 155 | { CTL_INT, VM_MIN_FREE_KBYTES, "min_free_kbytes" }, | ||
| 156 | { CTL_INT, VM_MAX_MAP_COUNT, "max_map_count" }, | ||
| 157 | { CTL_INT, VM_LAPTOP_MODE, "laptop_mode" }, | ||
| 158 | { CTL_INT, VM_BLOCK_DUMP, "block_dump" }, | ||
| 159 | { CTL_INT, VM_HUGETLB_GROUP, "hugetlb_shm_group" }, | ||
| 160 | { CTL_INT, VM_VFS_CACHE_PRESSURE, "vfs_cache_pressure" }, | ||
| 161 | { CTL_INT, VM_LEGACY_VA_LAYOUT, "legacy_va_layout" }, | ||
| 162 | /* VM_SWAP_TOKEN_TIMEOUT unused */ | ||
| 163 | { CTL_INT, VM_DROP_PAGECACHE, "drop_caches" }, | ||
| 164 | { CTL_INT, VM_PERCPU_PAGELIST_FRACTION, "percpu_pagelist_fraction" }, | ||
| 165 | { CTL_INT, VM_ZONE_RECLAIM_MODE, "zone_reclaim_mode" }, | ||
| 166 | { CTL_INT, VM_MIN_UNMAPPED, "min_unmapped_ratio" }, | ||
| 167 | { CTL_INT, VM_PANIC_ON_OOM, "panic_on_oom" }, | ||
| 168 | { CTL_INT, VM_VDSO_ENABLED, "vdso_enabled" }, | ||
| 169 | { CTL_INT, VM_MIN_SLAB, "min_slab_ratio" }, | ||
| 170 | |||
| 171 | {} | ||
| 172 | }; | ||
| 173 | |||
| 174 | static const struct bin_table bin_net_core_table[] = { | ||
| 175 | { CTL_INT, NET_CORE_WMEM_MAX, "wmem_max" }, | ||
| 176 | { CTL_INT, NET_CORE_RMEM_MAX, "rmem_max" }, | ||
| 177 | { CTL_INT, NET_CORE_WMEM_DEFAULT, "wmem_default" }, | ||
| 178 | { CTL_INT, NET_CORE_RMEM_DEFAULT, "rmem_default" }, | ||
| 179 | /* NET_CORE_DESTROY_DELAY unused */ | ||
| 180 | { CTL_INT, NET_CORE_MAX_BACKLOG, "netdev_max_backlog" }, | ||
| 181 | /* NET_CORE_FASTROUTE unused */ | ||
| 182 | { CTL_INT, NET_CORE_MSG_COST, "message_cost" }, | ||
| 183 | { CTL_INT, NET_CORE_MSG_BURST, "message_burst" }, | ||
| 184 | { CTL_INT, NET_CORE_OPTMEM_MAX, "optmem_max" }, | ||
| 185 | /* NET_CORE_HOT_LIST_LENGTH unused */ | ||
| 186 | /* NET_CORE_DIVERT_VERSION unused */ | ||
| 187 | /* NET_CORE_NO_CONG_THRESH unused */ | ||
| 188 | /* NET_CORE_NO_CONG unused */ | ||
| 189 | /* NET_CORE_LO_CONG unused */ | ||
| 190 | /* NET_CORE_MOD_CONG unused */ | ||
| 191 | { CTL_INT, NET_CORE_DEV_WEIGHT, "dev_weight" }, | ||
| 192 | { CTL_INT, NET_CORE_SOMAXCONN, "somaxconn" }, | ||
| 193 | { CTL_INT, NET_CORE_BUDGET, "netdev_budget" }, | ||
| 194 | { CTL_INT, NET_CORE_AEVENT_ETIME, "xfrm_aevent_etime" }, | ||
| 195 | { CTL_INT, NET_CORE_AEVENT_RSEQTH, "xfrm_aevent_rseqth" }, | ||
| 196 | { CTL_INT, NET_CORE_WARNINGS, "warnings" }, | ||
| 197 | {}, | ||
| 198 | }; | ||
| 199 | |||
| 200 | static const struct bin_table bin_net_unix_table[] = { | ||
| 201 | /* NET_UNIX_DESTROY_DELAY unused */ | ||
| 202 | /* NET_UNIX_DELETE_DELAY unused */ | ||
| 203 | { CTL_INT, NET_UNIX_MAX_DGRAM_QLEN, "max_dgram_qlen" }, | ||
| 204 | {} | ||
| 205 | }; | ||
| 206 | |||
| 207 | static const struct bin_table bin_net_ipv4_route_table[] = { | ||
| 208 | { CTL_INT, NET_IPV4_ROUTE_FLUSH, "flush" }, | ||
| 209 | /* NET_IPV4_ROUTE_MIN_DELAY "min_delay" no longer used */ | ||
| 210 | /* NET_IPV4_ROUTE_MAX_DELAY "max_delay" no longer used */ | ||
| 211 | { CTL_INT, NET_IPV4_ROUTE_GC_THRESH, "gc_thresh" }, | ||
| 212 | { CTL_INT, NET_IPV4_ROUTE_MAX_SIZE, "max_size" }, | ||
| 213 | { CTL_INT, NET_IPV4_ROUTE_GC_MIN_INTERVAL, "gc_min_interval" }, | ||
| 214 | { CTL_INT, NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS, "gc_min_interval_ms" }, | ||
| 215 | { CTL_INT, NET_IPV4_ROUTE_GC_TIMEOUT, "gc_timeout" }, | ||
| 216 | { CTL_INT, NET_IPV4_ROUTE_GC_INTERVAL, "gc_interval" }, | ||
| 217 | { CTL_INT, NET_IPV4_ROUTE_REDIRECT_LOAD, "redirect_load" }, | ||
| 218 | { CTL_INT, NET_IPV4_ROUTE_REDIRECT_NUMBER, "redirect_number" }, | ||
| 219 | { CTL_INT, NET_IPV4_ROUTE_REDIRECT_SILENCE, "redirect_silence" }, | ||
| 220 | { CTL_INT, NET_IPV4_ROUTE_ERROR_COST, "error_cost" }, | ||
| 221 | { CTL_INT, NET_IPV4_ROUTE_ERROR_BURST, "error_burst" }, | ||
| 222 | { CTL_INT, NET_IPV4_ROUTE_GC_ELASTICITY, "gc_elasticity" }, | ||
| 223 | { CTL_INT, NET_IPV4_ROUTE_MTU_EXPIRES, "mtu_expires" }, | ||
| 224 | { CTL_INT, NET_IPV4_ROUTE_MIN_PMTU, "min_pmtu" }, | ||
| 225 | { CTL_INT, NET_IPV4_ROUTE_MIN_ADVMSS, "min_adv_mss" }, | ||
| 226 | { CTL_INT, NET_IPV4_ROUTE_SECRET_INTERVAL, "secret_interval" }, | ||
| 227 | {} | ||
| 228 | }; | ||
| 229 | |||
| 230 | static const struct bin_table bin_net_ipv4_conf_vars_table[] = { | ||
| 231 | { CTL_INT, NET_IPV4_CONF_FORWARDING, "forwarding" }, | ||
| 232 | { CTL_INT, NET_IPV4_CONF_MC_FORWARDING, "mc_forwarding" }, | ||
| 233 | |||
| 234 | { CTL_INT, NET_IPV4_CONF_ACCEPT_REDIRECTS, "accept_redirects" }, | ||
| 235 | { CTL_INT, NET_IPV4_CONF_SECURE_REDIRECTS, "secure_redirects" }, | ||
| 236 | { CTL_INT, NET_IPV4_CONF_SEND_REDIRECTS, "send_redirects" }, | ||
| 237 | { CTL_INT, NET_IPV4_CONF_SHARED_MEDIA, "shared_media" }, | ||
| 238 | { CTL_INT, NET_IPV4_CONF_RP_FILTER, "rp_filter" }, | ||
| 239 | { CTL_INT, NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE, "accept_source_route" }, | ||
| 240 | { CTL_INT, NET_IPV4_CONF_PROXY_ARP, "proxy_arp" }, | ||
| 241 | { CTL_INT, NET_IPV4_CONF_MEDIUM_ID, "medium_id" }, | ||
| 242 | { CTL_INT, NET_IPV4_CONF_BOOTP_RELAY, "bootp_relay" }, | ||
| 243 | { CTL_INT, NET_IPV4_CONF_LOG_MARTIANS, "log_martians" }, | ||
| 244 | { CTL_INT, NET_IPV4_CONF_TAG, "tag" }, | ||
| 245 | { CTL_INT, NET_IPV4_CONF_ARPFILTER, "arp_filter" }, | ||
| 246 | { CTL_INT, NET_IPV4_CONF_ARP_ANNOUNCE, "arp_announce" }, | ||
| 247 | { CTL_INT, NET_IPV4_CONF_ARP_IGNORE, "arp_ignore" }, | ||
| 248 | { CTL_INT, NET_IPV4_CONF_ARP_ACCEPT, "arp_accept" }, | ||
| 249 | { CTL_INT, NET_IPV4_CONF_ARP_NOTIFY, "arp_notify" }, | ||
| 250 | |||
| 251 | { CTL_INT, NET_IPV4_CONF_NOXFRM, "disable_xfrm" }, | ||
| 252 | { CTL_INT, NET_IPV4_CONF_NOPOLICY, "disable_policy" }, | ||
| 253 | { CTL_INT, NET_IPV4_CONF_FORCE_IGMP_VERSION, "force_igmp_version" }, | ||
| 254 | { CTL_INT, NET_IPV4_CONF_PROMOTE_SECONDARIES, "promote_secondaries" }, | ||
| 255 | {} | ||
| 256 | }; | ||
| 257 | |||
| 258 | static const struct bin_table bin_net_ipv4_conf_table[] = { | ||
| 259 | { CTL_DIR, NET_PROTO_CONF_ALL, "all", bin_net_ipv4_conf_vars_table }, | ||
| 260 | { CTL_DIR, NET_PROTO_CONF_DEFAULT, "default", bin_net_ipv4_conf_vars_table }, | ||
| 261 | { CTL_DIR, 0, NULL, bin_net_ipv4_conf_vars_table }, | ||
| 262 | {} | ||
| 263 | }; | ||
| 264 | |||
| 265 | static const struct bin_table bin_net_neigh_vars_table[] = { | ||
| 266 | { CTL_INT, NET_NEIGH_MCAST_SOLICIT, "mcast_solicit" }, | ||
| 267 | { CTL_INT, NET_NEIGH_UCAST_SOLICIT, "ucast_solicit" }, | ||
| 268 | { CTL_INT, NET_NEIGH_APP_SOLICIT, "app_solicit" }, | ||
| 269 | /* NET_NEIGH_RETRANS_TIME "retrans_time" no longer used */ | ||
| 270 | { CTL_INT, NET_NEIGH_REACHABLE_TIME, "base_reachable_time" }, | ||
| 271 | { CTL_INT, NET_NEIGH_DELAY_PROBE_TIME, "delay_first_probe_time" }, | ||
| 272 | { CTL_INT, NET_NEIGH_GC_STALE_TIME, "gc_stale_time" }, | ||
| 273 | { CTL_INT, NET_NEIGH_UNRES_QLEN, "unres_qlen" }, | ||
| 274 | { CTL_INT, NET_NEIGH_PROXY_QLEN, "proxy_qlen" }, | ||
| 275 | /* NET_NEIGH_ANYCAST_DELAY "anycast_delay" no longer used */ | ||
| 276 | /* NET_NEIGH_PROXY_DELAY "proxy_delay" no longer used */ | ||
| 277 | /* NET_NEIGH_LOCKTIME "locktime" no longer used */ | ||
| 278 | { CTL_INT, NET_NEIGH_GC_INTERVAL, "gc_interval" }, | ||
| 279 | { CTL_INT, NET_NEIGH_GC_THRESH1, "gc_thresh1" }, | ||
| 280 | { CTL_INT, NET_NEIGH_GC_THRESH2, "gc_thresh2" }, | ||
| 281 | { CTL_INT, NET_NEIGH_GC_THRESH3, "gc_thresh3" }, | ||
| 282 | { CTL_INT, NET_NEIGH_RETRANS_TIME_MS, "retrans_time_ms" }, | ||
| 283 | { CTL_INT, NET_NEIGH_REACHABLE_TIME_MS, "base_reachable_time_ms" }, | ||
| 284 | {} | ||
| 285 | }; | ||
| 286 | |||
| 287 | static const struct bin_table bin_net_neigh_table[] = { | ||
| 288 | { CTL_DIR, NET_PROTO_CONF_DEFAULT, "default", bin_net_neigh_vars_table }, | ||
| 289 | { CTL_DIR, 0, NULL, bin_net_neigh_vars_table }, | ||
| 290 | {} | ||
| 291 | }; | ||
| 292 | |||
| 293 | static const struct bin_table bin_net_ipv4_netfilter_table[] = { | ||
| 294 | { CTL_INT, NET_IPV4_NF_CONNTRACK_MAX, "ip_conntrack_max" }, | ||
| 295 | |||
| 296 | /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT "ip_conntrack_tcp_timeout_syn_sent" no longer used */ | ||
| 297 | /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV "ip_conntrack_tcp_timeout_syn_recv" no longer used */ | ||
| 298 | /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED "ip_conntrack_tcp_timeout_established" no longer used */ | ||
| 299 | /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT "ip_conntrack_tcp_timeout_fin_wait" no longer used */ | ||
| 300 | /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT "ip_conntrack_tcp_timeout_close_wait" no longer used */ | ||
| 301 | /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK "ip_conntrack_tcp_timeout_last_ack" no longer used */ | ||
| 302 | /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT "ip_conntrack_tcp_timeout_time_wait" no longer used */ | ||
| 303 | /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE "ip_conntrack_tcp_timeout_close" no longer used */ | ||
| 304 | |||
| 305 | /* NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT "ip_conntrack_udp_timeout" no longer used */ | ||
| 306 | /* NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM "ip_conntrack_udp_timeout_stream" no longer used */ | ||
| 307 | /* NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT "ip_conntrack_icmp_timeout" no longer used */ | ||
| 308 | /* NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT "ip_conntrack_generic_timeout" no longer used */ | ||
| 309 | |||
| 310 | { CTL_INT, NET_IPV4_NF_CONNTRACK_BUCKETS, "ip_conntrack_buckets" }, | ||
| 311 | { CTL_INT, NET_IPV4_NF_CONNTRACK_LOG_INVALID, "ip_conntrack_log_invalid" }, | ||
| 312 | /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS "ip_conntrack_tcp_timeout_max_retrans" no longer used */ | ||
| 313 | { CTL_INT, NET_IPV4_NF_CONNTRACK_TCP_LOOSE, "ip_conntrack_tcp_loose" }, | ||
| 314 | { CTL_INT, NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL, "ip_conntrack_tcp_be_liberal" }, | ||
| 315 | { CTL_INT, NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS, "ip_conntrack_tcp_max_retrans" }, | ||
| 316 | |||
| 317 | /* NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED "ip_conntrack_sctp_timeout_closed" no longer used */ | ||
| 318 | /* NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT "ip_conntrack_sctp_timeout_cookie_wait" no longer used */ | ||
| 319 | /* NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED "ip_conntrack_sctp_timeout_cookie_echoed" no longer used */ | ||
| 320 | /* NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED "ip_conntrack_sctp_timeout_established" no longer used */ | ||
| 321 | /* NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT "ip_conntrack_sctp_timeout_shutdown_sent" no longer used */ | ||
| 322 | /* NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD "ip_conntrack_sctp_timeout_shutdown_recd" no longer used */ | ||
| 323 | /* NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT "ip_conntrack_sctp_timeout_shutdown_ack_sent" no longer used */ | ||
| 324 | |||
| 325 | { CTL_INT, NET_IPV4_NF_CONNTRACK_COUNT, "ip_conntrack_count" }, | ||
| 326 | { CTL_INT, NET_IPV4_NF_CONNTRACK_CHECKSUM, "ip_conntrack_checksum" }, | ||
| 327 | {} | ||
| 328 | }; | ||
| 329 | |||
| 330 | static const struct bin_table bin_net_ipv4_table[] = { | ||
| 331 | {CTL_INT, NET_IPV4_FORWARD, "ip_forward" }, | ||
| 332 | |||
| 333 | { CTL_DIR, NET_IPV4_CONF, "conf", bin_net_ipv4_conf_table }, | ||
| 334 | { CTL_DIR, NET_IPV4_NEIGH, "neigh", bin_net_neigh_table }, | ||
| 335 | { CTL_DIR, NET_IPV4_ROUTE, "route", bin_net_ipv4_route_table }, | ||
| 336 | /* NET_IPV4_FIB_HASH unused */ | ||
| 337 | { CTL_DIR, NET_IPV4_NETFILTER, "netfilter", bin_net_ipv4_netfilter_table }, | ||
| 338 | |||
| 339 | { CTL_INT, NET_IPV4_TCP_TIMESTAMPS, "tcp_timestamps" }, | ||
| 340 | { CTL_INT, NET_IPV4_TCP_WINDOW_SCALING, "tcp_window_scaling" }, | ||
| 341 | { CTL_INT, NET_IPV4_TCP_SACK, "tcp_sack" }, | ||
| 342 | { CTL_INT, NET_IPV4_TCP_RETRANS_COLLAPSE, "tcp_retrans_collapse" }, | ||
| 343 | { CTL_INT, NET_IPV4_DEFAULT_TTL, "ip_default_ttl" }, | ||
| 344 | /* NET_IPV4_AUTOCONFIG unused */ | ||
| 345 | { CTL_INT, NET_IPV4_NO_PMTU_DISC, "ip_no_pmtu_disc" }, | ||
| 346 | { CTL_INT, NET_IPV4_NONLOCAL_BIND, "ip_nonlocal_bind" }, | ||
| 347 | { CTL_INT, NET_IPV4_TCP_SYN_RETRIES, "tcp_syn_retries" }, | ||
| 348 | { CTL_INT, NET_TCP_SYNACK_RETRIES, "tcp_synack_retries" }, | ||
| 349 | { CTL_INT, NET_TCP_MAX_ORPHANS, "tcp_max_orphans" }, | ||
| 350 | { CTL_INT, NET_TCP_MAX_TW_BUCKETS, "tcp_max_tw_buckets" }, | ||
| 351 | { CTL_INT, NET_IPV4_DYNADDR, "ip_dynaddr" }, | ||
| 352 | { CTL_INT, NET_IPV4_TCP_KEEPALIVE_TIME, "tcp_keepalive_time" }, | ||
| 353 | { CTL_INT, NET_IPV4_TCP_KEEPALIVE_PROBES, "tcp_keepalive_probes" }, | ||
| 354 | { CTL_INT, NET_IPV4_TCP_KEEPALIVE_INTVL, "tcp_keepalive_intvl" }, | ||
| 355 | { CTL_INT, NET_IPV4_TCP_RETRIES1, "tcp_retries1" }, | ||
| 356 | { CTL_INT, NET_IPV4_TCP_RETRIES2, "tcp_retries2" }, | ||
| 357 | { CTL_INT, NET_IPV4_TCP_FIN_TIMEOUT, "tcp_fin_timeout" }, | ||
| 358 | { CTL_INT, NET_TCP_SYNCOOKIES, "tcp_syncookies" }, | ||
| 359 | { CTL_INT, NET_TCP_TW_RECYCLE, "tcp_tw_recycle" }, | ||
| 360 | { CTL_INT, NET_TCP_ABORT_ON_OVERFLOW, "tcp_abort_on_overflow" }, | ||
| 361 | { CTL_INT, NET_TCP_STDURG, "tcp_stdurg" }, | ||
| 362 | { CTL_INT, NET_TCP_RFC1337, "tcp_rfc1337" }, | ||
| 363 | { CTL_INT, NET_TCP_MAX_SYN_BACKLOG, "tcp_max_syn_backlog" }, | ||
| 364 | { CTL_INT, NET_IPV4_LOCAL_PORT_RANGE, "ip_local_port_range" }, | ||
| 365 | { CTL_INT, NET_IPV4_IGMP_MAX_MEMBERSHIPS, "igmp_max_memberships" }, | ||
| 366 | { CTL_INT, NET_IPV4_IGMP_MAX_MSF, "igmp_max_msf" }, | ||
| 367 | { CTL_INT, NET_IPV4_INET_PEER_THRESHOLD, "inet_peer_threshold" }, | ||
| 368 | { CTL_INT, NET_IPV4_INET_PEER_MINTTL, "inet_peer_minttl" }, | ||
| 369 | { CTL_INT, NET_IPV4_INET_PEER_MAXTTL, "inet_peer_maxttl" }, | ||
| 370 | { CTL_INT, NET_IPV4_INET_PEER_GC_MINTIME, "inet_peer_gc_mintime" }, | ||
| 371 | { CTL_INT, NET_IPV4_INET_PEER_GC_MAXTIME, "inet_peer_gc_maxtime" }, | ||
| 372 | { CTL_INT, NET_TCP_ORPHAN_RETRIES, "tcp_orphan_retries" }, | ||
| 373 | { CTL_INT, NET_TCP_FACK, "tcp_fack" }, | ||
| 374 | { CTL_INT, NET_TCP_REORDERING, "tcp_reordering" }, | ||
| 375 | { CTL_INT, NET_TCP_ECN, "tcp_ecn" }, | ||
| 376 | { CTL_INT, NET_TCP_DSACK, "tcp_dsack" }, | ||
| 377 | { CTL_INT, NET_TCP_MEM, "tcp_mem" }, | ||
| 378 | { CTL_INT, NET_TCP_WMEM, "tcp_wmem" }, | ||
| 379 | { CTL_INT, NET_TCP_RMEM, "tcp_rmem" }, | ||
| 380 | { CTL_INT, NET_TCP_APP_WIN, "tcp_app_win" }, | ||
| 381 | { CTL_INT, NET_TCP_ADV_WIN_SCALE, "tcp_adv_win_scale" }, | ||
| 382 | { CTL_INT, NET_TCP_TW_REUSE, "tcp_tw_reuse" }, | ||
| 383 | { CTL_INT, NET_TCP_FRTO, "tcp_frto" }, | ||
| 384 | { CTL_INT, NET_TCP_FRTO_RESPONSE, "tcp_frto_response" }, | ||
| 385 | { CTL_INT, NET_TCP_LOW_LATENCY, "tcp_low_latency" }, | ||
| 386 | { CTL_INT, NET_TCP_NO_METRICS_SAVE, "tcp_no_metrics_save" }, | ||
| 387 | { CTL_INT, NET_TCP_MODERATE_RCVBUF, "tcp_moderate_rcvbuf" }, | ||
| 388 | { CTL_INT, NET_TCP_TSO_WIN_DIVISOR, "tcp_tso_win_divisor" }, | ||
| 389 | { CTL_STR, NET_TCP_CONG_CONTROL, "tcp_congestion_control" }, | ||
| 390 | { CTL_INT, NET_TCP_ABC, "tcp_abc" }, | ||
| 391 | { CTL_INT, NET_TCP_MTU_PROBING, "tcp_mtu_probing" }, | ||
| 392 | { CTL_INT, NET_TCP_BASE_MSS, "tcp_base_mss" }, | ||
| 393 | { CTL_INT, NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS, "tcp_workaround_signed_windows" }, | ||
| 394 | { CTL_INT, NET_TCP_DMA_COPYBREAK, "tcp_dma_copybreak" }, | ||
| 395 | { CTL_INT, NET_TCP_SLOW_START_AFTER_IDLE, "tcp_slow_start_after_idle" }, | ||
| 396 | { CTL_INT, NET_CIPSOV4_CACHE_ENABLE, "cipso_cache_enable" }, | ||
| 397 | { CTL_INT, NET_CIPSOV4_CACHE_BUCKET_SIZE, "cipso_cache_bucket_size" }, | ||
| 398 | { CTL_INT, NET_CIPSOV4_RBM_OPTFMT, "cipso_rbm_optfmt" }, | ||
| 399 | { CTL_INT, NET_CIPSOV4_RBM_STRICTVALID, "cipso_rbm_strictvalid" }, | ||
| 400 | /* NET_TCP_AVAIL_CONG_CONTROL "tcp_available_congestion_control" no longer used */ | ||
| 401 | { CTL_STR, NET_TCP_ALLOWED_CONG_CONTROL, "tcp_allowed_congestion_control" }, | ||
| 402 | { CTL_INT, NET_TCP_MAX_SSTHRESH, "tcp_max_ssthresh" }, | ||
| 403 | |||
| 404 | { CTL_INT, NET_IPV4_ICMP_ECHO_IGNORE_ALL, "icmp_echo_ignore_all" }, | ||
| 405 | { CTL_INT, NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS, "icmp_echo_ignore_broadcasts" }, | ||
| 406 | { CTL_INT, NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES, "icmp_ignore_bogus_error_responses" }, | ||
| 407 | { CTL_INT, NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR, "icmp_errors_use_inbound_ifaddr" }, | ||
| 408 | { CTL_INT, NET_IPV4_ICMP_RATELIMIT, "icmp_ratelimit" }, | ||
| 409 | { CTL_INT, NET_IPV4_ICMP_RATEMASK, "icmp_ratemask" }, | ||
| 410 | |||
| 411 | { CTL_INT, NET_IPV4_IPFRAG_HIGH_THRESH, "ipfrag_high_thresh" }, | ||
| 412 | { CTL_INT, NET_IPV4_IPFRAG_LOW_THRESH, "ipfrag_low_thresh" }, | ||
| 413 | { CTL_INT, NET_IPV4_IPFRAG_TIME, "ipfrag_time" }, | ||
| 414 | |||
| 415 | { CTL_INT, NET_IPV4_IPFRAG_SECRET_INTERVAL, "ipfrag_secret_interval" }, | ||
| 416 | /* NET_IPV4_IPFRAG_MAX_DIST "ipfrag_max_dist" no longer used */ | ||
| 417 | |||
| 418 | { CTL_INT, 2088 /* NET_IPQ_QMAX */, "ip_queue_maxlen" }, | ||
| 419 | |||
| 420 | /* NET_TCP_DEFAULT_WIN_SCALE unused */ | ||
| 421 | /* NET_TCP_BIC_BETA unused */ | ||
| 422 | /* NET_IPV4_TCP_MAX_KA_PROBES unused */ | ||
| 423 | /* NET_IPV4_IP_MASQ_DEBUG unused */ | ||
| 424 | /* NET_TCP_SYN_TAILDROP unused */ | ||
| 425 | /* NET_IPV4_ICMP_SOURCEQUENCH_RATE unused */ | ||
| 426 | /* NET_IPV4_ICMP_DESTUNREACH_RATE unused */ | ||
| 427 | /* NET_IPV4_ICMP_TIMEEXCEED_RATE unused */ | ||
| 428 | /* NET_IPV4_ICMP_PARAMPROB_RATE unused */ | ||
| 429 | /* NET_IPV4_ICMP_ECHOREPLY_RATE unused */ | ||
| 430 | /* NET_IPV4_ALWAYS_DEFRAG unused */ | ||
| 431 | {} | ||
| 432 | }; | ||
| 433 | |||
| 434 | static const struct bin_table bin_net_ipx_table[] = { | ||
| 435 | { CTL_INT, NET_IPX_PPROP_BROADCASTING, "ipx_pprop_broadcasting" }, | ||
| 436 | /* NET_IPX_FORWARDING unused */ | ||
| 437 | {} | ||
| 438 | }; | ||
| 439 | |||
| 440 | static const struct bin_table bin_net_atalk_table[] = { | ||
| 441 | { CTL_INT, NET_ATALK_AARP_EXPIRY_TIME, "aarp-expiry-time" }, | ||
| 442 | { CTL_INT, NET_ATALK_AARP_TICK_TIME, "aarp-tick-time" }, | ||
| 443 | { CTL_INT, NET_ATALK_AARP_RETRANSMIT_LIMIT, "aarp-retransmit-limit" }, | ||
| 444 | { CTL_INT, NET_ATALK_AARP_RESOLVE_TIME, "aarp-resolve-time" }, | ||
| 445 | {}, | ||
| 446 | }; | ||
| 447 | |||
| 448 | static const struct bin_table bin_net_netrom_table[] = { | ||
| 449 | { CTL_INT, NET_NETROM_DEFAULT_PATH_QUALITY, "default_path_quality" }, | ||
| 450 | { CTL_INT, NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER, "obsolescence_count_initialiser" }, | ||
| 451 | { CTL_INT, NET_NETROM_NETWORK_TTL_INITIALISER, "network_ttl_initialiser" }, | ||
| 452 | { CTL_INT, NET_NETROM_TRANSPORT_TIMEOUT, "transport_timeout" }, | ||
| 453 | { CTL_INT, NET_NETROM_TRANSPORT_MAXIMUM_TRIES, "transport_maximum_tries" }, | ||
| 454 | { CTL_INT, NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY, "transport_acknowledge_delay" }, | ||
| 455 | { CTL_INT, NET_NETROM_TRANSPORT_BUSY_DELAY, "transport_busy_delay" }, | ||
| 456 | { CTL_INT, NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE, "transport_requested_window_size" }, | ||
| 457 | { CTL_INT, NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT, "transport_no_activity_timeout" }, | ||
| 458 | { CTL_INT, NET_NETROM_ROUTING_CONTROL, "routing_control" }, | ||
| 459 | { CTL_INT, NET_NETROM_LINK_FAILS_COUNT, "link_fails_count" }, | ||
| 460 | { CTL_INT, NET_NETROM_RESET, "reset" }, | ||
| 461 | {} | ||
| 462 | }; | ||
| 463 | |||
| 464 | static const struct bin_table bin_net_ax25_param_table[] = { | ||
| 465 | { CTL_INT, NET_AX25_IP_DEFAULT_MODE, "ip_default_mode" }, | ||
| 466 | { CTL_INT, NET_AX25_DEFAULT_MODE, "ax25_default_mode" }, | ||
| 467 | { CTL_INT, NET_AX25_BACKOFF_TYPE, "backoff_type" }, | ||
| 468 | { CTL_INT, NET_AX25_CONNECT_MODE, "connect_mode" }, | ||
| 469 | { CTL_INT, NET_AX25_STANDARD_WINDOW, "standard_window_size" }, | ||
| 470 | { CTL_INT, NET_AX25_EXTENDED_WINDOW, "extended_window_size" }, | ||
| 471 | { CTL_INT, NET_AX25_T1_TIMEOUT, "t1_timeout" }, | ||
| 472 | { CTL_INT, NET_AX25_T2_TIMEOUT, "t2_timeout" }, | ||
| 473 | { CTL_INT, NET_AX25_T3_TIMEOUT, "t3_timeout" }, | ||
| 474 | { CTL_INT, NET_AX25_IDLE_TIMEOUT, "idle_timeout" }, | ||
| 475 | { CTL_INT, NET_AX25_N2, "maximum_retry_count" }, | ||
| 476 | { CTL_INT, NET_AX25_PACLEN, "maximum_packet_length" }, | ||
| 477 | { CTL_INT, NET_AX25_PROTOCOL, "protocol" }, | ||
| 478 | { CTL_INT, NET_AX25_DAMA_SLAVE_TIMEOUT, "dama_slave_timeout" }, | ||
| 479 | {} | ||
| 480 | }; | ||
| 481 | |||
| 482 | static const struct bin_table bin_net_ax25_table[] = { | ||
| 483 | { CTL_DIR, 0, NULL, bin_net_ax25_param_table }, | ||
| 484 | {} | ||
| 485 | }; | ||
| 486 | |||
| 487 | static const struct bin_table bin_net_rose_table[] = { | ||
| 488 | { CTL_INT, NET_ROSE_RESTART_REQUEST_TIMEOUT, "restart_request_timeout" }, | ||
| 489 | { CTL_INT, NET_ROSE_CALL_REQUEST_TIMEOUT, "call_request_timeout" }, | ||
| 490 | { CTL_INT, NET_ROSE_RESET_REQUEST_TIMEOUT, "reset_request_timeout" }, | ||
| 491 | { CTL_INT, NET_ROSE_CLEAR_REQUEST_TIMEOUT, "clear_request_timeout" }, | ||
| 492 | { CTL_INT, NET_ROSE_ACK_HOLD_BACK_TIMEOUT, "acknowledge_hold_back_timeout" }, | ||
| 493 | { CTL_INT, NET_ROSE_ROUTING_CONTROL, "routing_control" }, | ||
| 494 | { CTL_INT, NET_ROSE_LINK_FAIL_TIMEOUT, "link_fail_timeout" }, | ||
| 495 | { CTL_INT, NET_ROSE_MAX_VCS, "maximum_virtual_circuits" }, | ||
| 496 | { CTL_INT, NET_ROSE_WINDOW_SIZE, "window_size" }, | ||
| 497 | { CTL_INT, NET_ROSE_NO_ACTIVITY_TIMEOUT, "no_activity_timeout" }, | ||
| 498 | {} | ||
| 499 | }; | ||
| 500 | |||
| 501 | static const struct bin_table bin_net_ipv6_conf_var_table[] = { | ||
| 502 | { CTL_INT, NET_IPV6_FORWARDING, "forwarding" }, | ||
| 503 | { CTL_INT, NET_IPV6_HOP_LIMIT, "hop_limit" }, | ||
| 504 | { CTL_INT, NET_IPV6_MTU, "mtu" }, | ||
| 505 | { CTL_INT, NET_IPV6_ACCEPT_RA, "accept_ra" }, | ||
| 506 | { CTL_INT, NET_IPV6_ACCEPT_REDIRECTS, "accept_redirects" }, | ||
| 507 | { CTL_INT, NET_IPV6_AUTOCONF, "autoconf" }, | ||
| 508 | { CTL_INT, NET_IPV6_DAD_TRANSMITS, "dad_transmits" }, | ||
| 509 | { CTL_INT, NET_IPV6_RTR_SOLICITS, "router_solicitations" }, | ||
| 510 | { CTL_INT, NET_IPV6_RTR_SOLICIT_INTERVAL, "router_solicitation_interval" }, | ||
| 511 | { CTL_INT, NET_IPV6_RTR_SOLICIT_DELAY, "router_solicitation_delay" }, | ||
| 512 | { CTL_INT, NET_IPV6_USE_TEMPADDR, "use_tempaddr" }, | ||
| 513 | { CTL_INT, NET_IPV6_TEMP_VALID_LFT, "temp_valid_lft" }, | ||
| 514 | { CTL_INT, NET_IPV6_TEMP_PREFERED_LFT, "temp_prefered_lft" }, | ||
| 515 | { CTL_INT, NET_IPV6_REGEN_MAX_RETRY, "regen_max_retry" }, | ||
| 516 | { CTL_INT, NET_IPV6_MAX_DESYNC_FACTOR, "max_desync_factor" }, | ||
| 517 | { CTL_INT, NET_IPV6_MAX_ADDRESSES, "max_addresses" }, | ||
| 518 | { CTL_INT, NET_IPV6_FORCE_MLD_VERSION, "force_mld_version" }, | ||
| 519 | { CTL_INT, NET_IPV6_ACCEPT_RA_DEFRTR, "accept_ra_defrtr" }, | ||
| 520 | { CTL_INT, NET_IPV6_ACCEPT_RA_PINFO, "accept_ra_pinfo" }, | ||
| 521 | { CTL_INT, NET_IPV6_ACCEPT_RA_RTR_PREF, "accept_ra_rtr_pref" }, | ||
| 522 | { CTL_INT, NET_IPV6_RTR_PROBE_INTERVAL, "router_probe_interval" }, | ||
| 523 | { CTL_INT, NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN, "accept_ra_rt_info_max_plen" }, | ||
| 524 | { CTL_INT, NET_IPV6_PROXY_NDP, "proxy_ndp" }, | ||
| 525 | { CTL_INT, NET_IPV6_ACCEPT_SOURCE_ROUTE, "accept_source_route" }, | ||
| 526 | {} | ||
| 527 | }; | ||
| 528 | |||
| 529 | static const struct bin_table bin_net_ipv6_conf_table[] = { | ||
| 530 | { CTL_DIR, NET_PROTO_CONF_ALL, "all", bin_net_ipv6_conf_var_table }, | ||
| 531 | { CTL_DIR, NET_PROTO_CONF_DEFAULT, "default", bin_net_ipv6_conf_var_table }, | ||
| 532 | { CTL_DIR, 0, NULL, bin_net_ipv6_conf_var_table }, | ||
| 533 | {} | ||
| 534 | }; | ||
| 535 | |||
| 536 | static const struct bin_table bin_net_ipv6_route_table[] = { | ||
| 537 | /* NET_IPV6_ROUTE_FLUSH "flush" no longer used */ | ||
| 538 | { CTL_INT, NET_IPV6_ROUTE_GC_THRESH, "gc_thresh" }, | ||
| 539 | { CTL_INT, NET_IPV6_ROUTE_MAX_SIZE, "max_size" }, | ||
| 540 | { CTL_INT, NET_IPV6_ROUTE_GC_MIN_INTERVAL, "gc_min_interval" }, | ||
| 541 | { CTL_INT, NET_IPV6_ROUTE_GC_TIMEOUT, "gc_timeout" }, | ||
| 542 | { CTL_INT, NET_IPV6_ROUTE_GC_INTERVAL, "gc_interval" }, | ||
| 543 | { CTL_INT, NET_IPV6_ROUTE_GC_ELASTICITY, "gc_elasticity" }, | ||
| 544 | { CTL_INT, NET_IPV6_ROUTE_MTU_EXPIRES, "mtu_expires" }, | ||
| 545 | { CTL_INT, NET_IPV6_ROUTE_MIN_ADVMSS, "min_adv_mss" }, | ||
| 546 | { CTL_INT, NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS, "gc_min_interval_ms" }, | ||
| 547 | {} | ||
| 548 | }; | ||
| 549 | |||
| 550 | static const struct bin_table bin_net_ipv6_icmp_table[] = { | ||
| 551 | { CTL_INT, NET_IPV6_ICMP_RATELIMIT, "ratelimit" }, | ||
| 552 | {} | ||
| 553 | }; | ||
| 554 | |||
| 555 | static const struct bin_table bin_net_ipv6_table[] = { | ||
| 556 | { CTL_DIR, NET_IPV6_CONF, "conf", bin_net_ipv6_conf_table }, | ||
| 557 | { CTL_DIR, NET_IPV6_NEIGH, "neigh", bin_net_neigh_table }, | ||
| 558 | { CTL_DIR, NET_IPV6_ROUTE, "route", bin_net_ipv6_route_table }, | ||
| 559 | { CTL_DIR, NET_IPV6_ICMP, "icmp", bin_net_ipv6_icmp_table }, | ||
| 560 | { CTL_INT, NET_IPV6_BINDV6ONLY, "bindv6only" }, | ||
| 561 | { CTL_INT, NET_IPV6_IP6FRAG_HIGH_THRESH, "ip6frag_high_thresh" }, | ||
| 562 | { CTL_INT, NET_IPV6_IP6FRAG_LOW_THRESH, "ip6frag_low_thresh" }, | ||
| 563 | { CTL_INT, NET_IPV6_IP6FRAG_TIME, "ip6frag_time" }, | ||
| 564 | { CTL_INT, NET_IPV6_IP6FRAG_SECRET_INTERVAL, "ip6frag_secret_interval" }, | ||
| 565 | { CTL_INT, NET_IPV6_MLD_MAX_MSF, "mld_max_msf" }, | ||
| 566 | { CTL_INT, 2088 /* IPQ_QMAX */, "ip6_queue_maxlen" }, | ||
| 567 | {} | ||
| 568 | }; | ||
| 569 | |||
| 570 | static const struct bin_table bin_net_x25_table[] = { | ||
| 571 | { CTL_INT, NET_X25_RESTART_REQUEST_TIMEOUT, "restart_request_timeout" }, | ||
| 572 | { CTL_INT, NET_X25_CALL_REQUEST_TIMEOUT, "call_request_timeout" }, | ||
| 573 | { CTL_INT, NET_X25_RESET_REQUEST_TIMEOUT, "reset_request_timeout" }, | ||
| 574 | { CTL_INT, NET_X25_CLEAR_REQUEST_TIMEOUT, "clear_request_timeout" }, | ||
| 575 | { CTL_INT, NET_X25_ACK_HOLD_BACK_TIMEOUT, "acknowledgement_hold_back_timeout" }, | ||
| 576 | { CTL_INT, NET_X25_FORWARD, "x25_forward" }, | ||
| 577 | {} | ||
| 578 | }; | ||
| 579 | |||
| 580 | static const struct bin_table bin_net_tr_table[] = { | ||
| 581 | { CTL_INT, NET_TR_RIF_TIMEOUT, "rif_timeout" }, | ||
| 582 | {} | ||
| 583 | }; | ||
| 584 | |||
| 585 | |||
| 586 | static const struct bin_table bin_net_decnet_conf_vars[] = { | ||
| 587 | { CTL_INT, NET_DECNET_CONF_DEV_FORWARDING, "forwarding" }, | ||
| 588 | { CTL_INT, NET_DECNET_CONF_DEV_PRIORITY, "priority" }, | ||
| 589 | { CTL_INT, NET_DECNET_CONF_DEV_T2, "t2" }, | ||
| 590 | { CTL_INT, NET_DECNET_CONF_DEV_T3, "t3" }, | ||
| 591 | {} | ||
| 592 | }; | ||
| 593 | |||
| 594 | static const struct bin_table bin_net_decnet_conf[] = { | ||
| 595 | { CTL_DIR, NET_DECNET_CONF_ETHER, "ethernet", bin_net_decnet_conf_vars }, | ||
| 596 | { CTL_DIR, NET_DECNET_CONF_GRE, "ipgre", bin_net_decnet_conf_vars }, | ||
| 597 | { CTL_DIR, NET_DECNET_CONF_X25, "x25", bin_net_decnet_conf_vars }, | ||
| 598 | { CTL_DIR, NET_DECNET_CONF_PPP, "ppp", bin_net_decnet_conf_vars }, | ||
| 599 | { CTL_DIR, NET_DECNET_CONF_DDCMP, "ddcmp", bin_net_decnet_conf_vars }, | ||
| 600 | { CTL_DIR, NET_DECNET_CONF_LOOPBACK, "loopback", bin_net_decnet_conf_vars }, | ||
| 601 | { CTL_DIR, 0, NULL, bin_net_decnet_conf_vars }, | ||
| 602 | {} | ||
| 603 | }; | ||
| 604 | |||
| 605 | static const struct bin_table bin_net_decnet_table[] = { | ||
| 606 | { CTL_DIR, NET_DECNET_CONF, "conf", bin_net_decnet_conf }, | ||
| 607 | { CTL_DNADR, NET_DECNET_NODE_ADDRESS, "node_address" }, | ||
| 608 | { CTL_STR, NET_DECNET_NODE_NAME, "node_name" }, | ||
| 609 | { CTL_STR, NET_DECNET_DEFAULT_DEVICE, "default_device" }, | ||
| 610 | { CTL_INT, NET_DECNET_TIME_WAIT, "time_wait" }, | ||
| 611 | { CTL_INT, NET_DECNET_DN_COUNT, "dn_count" }, | ||
| 612 | { CTL_INT, NET_DECNET_DI_COUNT, "di_count" }, | ||
| 613 | { CTL_INT, NET_DECNET_DR_COUNT, "dr_count" }, | ||
| 614 | { CTL_INT, NET_DECNET_DST_GC_INTERVAL, "dst_gc_interval" }, | ||
| 615 | { CTL_INT, NET_DECNET_NO_FC_MAX_CWND, "no_fc_max_cwnd" }, | ||
| 616 | { CTL_INT, NET_DECNET_MEM, "decnet_mem" }, | ||
| 617 | { CTL_INT, NET_DECNET_RMEM, "decnet_rmem" }, | ||
| 618 | { CTL_INT, NET_DECNET_WMEM, "decnet_wmem" }, | ||
| 619 | { CTL_INT, NET_DECNET_DEBUG_LEVEL, "debug" }, | ||
| 620 | {} | ||
| 621 | }; | ||
| 622 | |||
| 623 | static const struct bin_table bin_net_sctp_table[] = { | ||
| 624 | { CTL_INT, NET_SCTP_RTO_INITIAL, "rto_initial" }, | ||
| 625 | { CTL_INT, NET_SCTP_RTO_MIN, "rto_min" }, | ||
| 626 | { CTL_INT, NET_SCTP_RTO_MAX, "rto_max" }, | ||
| 627 | { CTL_INT, NET_SCTP_RTO_ALPHA, "rto_alpha_exp_divisor" }, | ||
| 628 | { CTL_INT, NET_SCTP_RTO_BETA, "rto_beta_exp_divisor" }, | ||
| 629 | { CTL_INT, NET_SCTP_VALID_COOKIE_LIFE, "valid_cookie_life" }, | ||
| 630 | { CTL_INT, NET_SCTP_ASSOCIATION_MAX_RETRANS, "association_max_retrans" }, | ||
| 631 | { CTL_INT, NET_SCTP_PATH_MAX_RETRANS, "path_max_retrans" }, | ||
| 632 | { CTL_INT, NET_SCTP_MAX_INIT_RETRANSMITS, "max_init_retransmits" }, | ||
| 633 | { CTL_INT, NET_SCTP_HB_INTERVAL, "hb_interval" }, | ||
| 634 | { CTL_INT, NET_SCTP_PRESERVE_ENABLE, "cookie_preserve_enable" }, | ||
| 635 | { CTL_INT, NET_SCTP_MAX_BURST, "max_burst" }, | ||
| 636 | { CTL_INT, NET_SCTP_ADDIP_ENABLE, "addip_enable" }, | ||
| 637 | { CTL_INT, NET_SCTP_PRSCTP_ENABLE, "prsctp_enable" }, | ||
| 638 | { CTL_INT, NET_SCTP_SNDBUF_POLICY, "sndbuf_policy" }, | ||
| 639 | { CTL_INT, NET_SCTP_SACK_TIMEOUT, "sack_timeout" }, | ||
| 640 | { CTL_INT, NET_SCTP_RCVBUF_POLICY, "rcvbuf_policy" }, | ||
| 641 | {} | ||
| 642 | }; | ||
| 643 | |||
| 644 | static const struct bin_table bin_net_llc_llc2_timeout_table[] = { | ||
| 645 | { CTL_INT, NET_LLC2_ACK_TIMEOUT, "ack" }, | ||
| 646 | { CTL_INT, NET_LLC2_P_TIMEOUT, "p" }, | ||
| 647 | { CTL_INT, NET_LLC2_REJ_TIMEOUT, "rej" }, | ||
| 648 | { CTL_INT, NET_LLC2_BUSY_TIMEOUT, "busy" }, | ||
| 649 | {} | ||
| 650 | }; | ||
| 651 | |||
| 652 | static const struct bin_table bin_net_llc_station_table[] = { | ||
| 653 | { CTL_INT, NET_LLC_STATION_ACK_TIMEOUT, "ack_timeout" }, | ||
| 654 | {} | ||
| 655 | }; | ||
| 656 | |||
| 657 | static const struct bin_table bin_net_llc_llc2_table[] = { | ||
| 658 | { CTL_DIR, NET_LLC2, "timeout", bin_net_llc_llc2_timeout_table }, | ||
| 659 | {} | ||
| 660 | }; | ||
| 661 | |||
| 662 | static const struct bin_table bin_net_llc_table[] = { | ||
| 663 | { CTL_DIR, NET_LLC2, "llc2", bin_net_llc_llc2_table }, | ||
| 664 | { CTL_DIR, NET_LLC_STATION, "station", bin_net_llc_station_table }, | ||
| 665 | {} | ||
| 666 | }; | ||
| 667 | |||
| 668 | static const struct bin_table bin_net_netfilter_table[] = { | ||
| 669 | { CTL_INT, NET_NF_CONNTRACK_MAX, "nf_conntrack_max" }, | ||
| 670 | /* NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT "nf_conntrack_tcp_timeout_syn_sent" no longer used */ | ||
| 671 | /* NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV "nf_conntrack_tcp_timeout_syn_recv" no longer used */ | ||
| 672 | /* NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED "nf_conntrack_tcp_timeout_established" no longer used */ | ||
| 673 | /* NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT "nf_conntrack_tcp_timeout_fin_wait" no longer used */ | ||
| 674 | /* NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT "nf_conntrack_tcp_timeout_close_wait" no longer used */ | ||
| 675 | /* NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK "nf_conntrack_tcp_timeout_last_ack" no longer used */ | ||
| 676 | /* NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT "nf_conntrack_tcp_timeout_time_wait" no longer used */ | ||
| 677 | /* NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE "nf_conntrack_tcp_timeout_close" no longer used */ | ||
| 678 | /* NET_NF_CONNTRACK_UDP_TIMEOUT "nf_conntrack_udp_timeout" no longer used */ | ||
| 679 | /* NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM "nf_conntrack_udp_timeout_stream" no longer used */ | ||
| 680 | /* NET_NF_CONNTRACK_ICMP_TIMEOUT "nf_conntrack_icmp_timeout" no longer used */ | ||
| 681 | /* NET_NF_CONNTRACK_GENERIC_TIMEOUT "nf_conntrack_generic_timeout" no longer used */ | ||
| 682 | { CTL_INT, NET_NF_CONNTRACK_BUCKETS, "nf_conntrack_buckets" }, | ||
| 683 | { CTL_INT, NET_NF_CONNTRACK_LOG_INVALID, "nf_conntrack_log_invalid" }, | ||
| 684 | /* NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS "nf_conntrack_tcp_timeout_max_retrans" no longer used */ | ||
| 685 | { CTL_INT, NET_NF_CONNTRACK_TCP_LOOSE, "nf_conntrack_tcp_loose" }, | ||
| 686 | { CTL_INT, NET_NF_CONNTRACK_TCP_BE_LIBERAL, "nf_conntrack_tcp_be_liberal" }, | ||
| 687 | { CTL_INT, NET_NF_CONNTRACK_TCP_MAX_RETRANS, "nf_conntrack_tcp_max_retrans" }, | ||
| 688 | /* NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED "nf_conntrack_sctp_timeout_closed" no longer used */ | ||
| 689 | /* NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT "nf_conntrack_sctp_timeout_cookie_wait" no longer used */ | ||
| 690 | /* NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED "nf_conntrack_sctp_timeout_cookie_echoed" no longer used */ | ||
| 691 | /* NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED "nf_conntrack_sctp_timeout_established" no longer used */ | ||
| 692 | /* NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT "nf_conntrack_sctp_timeout_shutdown_sent" no longer used */ | ||
| 693 | /* NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD "nf_conntrack_sctp_timeout_shutdown_recd" no longer used */ | ||
| 694 | /* NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT "nf_conntrack_sctp_timeout_shutdown_ack_sent" no longer used */ | ||
| 695 | { CTL_INT, NET_NF_CONNTRACK_COUNT, "nf_conntrack_count" }, | ||
| 696 | /* NET_NF_CONNTRACK_ICMPV6_TIMEOUT "nf_conntrack_icmpv6_timeout" no longer used */ | ||
| 697 | /* NET_NF_CONNTRACK_FRAG6_TIMEOUT "nf_conntrack_frag6_timeout" no longer used */ | ||
| 698 | { CTL_INT, NET_NF_CONNTRACK_FRAG6_LOW_THRESH, "nf_conntrack_frag6_low_thresh" }, | ||
| 699 | { CTL_INT, NET_NF_CONNTRACK_FRAG6_HIGH_THRESH, "nf_conntrack_frag6_high_thresh" }, | ||
| 700 | { CTL_INT, NET_NF_CONNTRACK_CHECKSUM, "nf_conntrack_checksum" }, | ||
| 701 | |||
| 702 | {} | ||
| 703 | }; | ||
| 704 | |||
| 705 | static const struct bin_table bin_net_irda_table[] = { | ||
| 706 | { CTL_INT, NET_IRDA_DISCOVERY, "discovery" }, | ||
| 707 | { CTL_STR, NET_IRDA_DEVNAME, "devname" }, | ||
| 708 | { CTL_INT, NET_IRDA_DEBUG, "debug" }, | ||
| 709 | { CTL_INT, NET_IRDA_FAST_POLL, "fast_poll_increase" }, | ||
| 710 | { CTL_INT, NET_IRDA_DISCOVERY_SLOTS, "discovery_slots" }, | ||
| 711 | { CTL_INT, NET_IRDA_DISCOVERY_TIMEOUT, "discovery_timeout" }, | ||
| 712 | { CTL_INT, NET_IRDA_SLOT_TIMEOUT, "slot_timeout" }, | ||
| 713 | { CTL_INT, NET_IRDA_MAX_BAUD_RATE, "max_baud_rate" }, | ||
| 714 | { CTL_INT, NET_IRDA_MIN_TX_TURN_TIME, "min_tx_turn_time" }, | ||
| 715 | { CTL_INT, NET_IRDA_MAX_TX_DATA_SIZE, "max_tx_data_size" }, | ||
| 716 | { CTL_INT, NET_IRDA_MAX_TX_WINDOW, "max_tx_window" }, | ||
| 717 | { CTL_INT, NET_IRDA_MAX_NOREPLY_TIME, "max_noreply_time" }, | ||
| 718 | { CTL_INT, NET_IRDA_WARN_NOREPLY_TIME, "warn_noreply_time" }, | ||
| 719 | { CTL_INT, NET_IRDA_LAP_KEEPALIVE_TIME, "lap_keepalive_time" }, | ||
| 720 | {} | ||
| 721 | }; | ||
| 722 | |||
| 723 | static const struct bin_table bin_net_table[] = { | ||
| 724 | { CTL_DIR, NET_CORE, "core", bin_net_core_table }, | ||
| 725 | /* NET_ETHER not used */ | ||
| 726 | /* NET_802 not used */ | ||
| 727 | { CTL_DIR, NET_UNIX, "unix", bin_net_unix_table }, | ||
| 728 | { CTL_DIR, NET_IPV4, "ipv4", bin_net_ipv4_table }, | ||
| 729 | { CTL_DIR, NET_IPX, "ipx", bin_net_ipx_table }, | ||
| 730 | { CTL_DIR, NET_ATALK, "appletalk", bin_net_atalk_table }, | ||
| 731 | { CTL_DIR, NET_NETROM, "netrom", bin_net_netrom_table }, | ||
| 732 | { CTL_DIR, NET_AX25, "ax25", bin_net_ax25_table }, | ||
| 733 | /* NET_BRIDGE "bridge" no longer used */ | ||
| 734 | { CTL_DIR, NET_ROSE, "rose", bin_net_rose_table }, | ||
| 735 | { CTL_DIR, NET_IPV6, "ipv6", bin_net_ipv6_table }, | ||
| 736 | { CTL_DIR, NET_X25, "x25", bin_net_x25_table }, | ||
| 737 | { CTL_DIR, NET_TR, "token-ring", bin_net_tr_table }, | ||
| 738 | { CTL_DIR, NET_DECNET, "decnet", bin_net_decnet_table }, | ||
| 739 | /* NET_ECONET not used */ | ||
| 740 | { CTL_DIR, NET_SCTP, "sctp", bin_net_sctp_table }, | ||
| 741 | { CTL_DIR, NET_LLC, "llc", bin_net_llc_table }, | ||
| 742 | { CTL_DIR, NET_NETFILTER, "netfilter", bin_net_netfilter_table }, | ||
| 743 | /* NET_DCCP "dccp" no longer used */ | ||
| 744 | { CTL_DIR, NET_IRDA, "irda", bin_net_irda_table }, | ||
| 745 | { CTL_INT, 2089, "nf_conntrack_max" }, | ||
| 746 | {} | ||
| 747 | }; | ||
| 748 | |||
| 749 | static const struct bin_table bin_fs_quota_table[] = { | ||
| 750 | { CTL_INT, FS_DQ_LOOKUPS, "lookups" }, | ||
| 751 | { CTL_INT, FS_DQ_DROPS, "drops" }, | ||
| 752 | { CTL_INT, FS_DQ_READS, "reads" }, | ||
| 753 | { CTL_INT, FS_DQ_WRITES, "writes" }, | ||
| 754 | { CTL_INT, FS_DQ_CACHE_HITS, "cache_hits" }, | ||
| 755 | { CTL_INT, FS_DQ_ALLOCATED, "allocated_dquots" }, | ||
| 756 | { CTL_INT, FS_DQ_FREE, "free_dquots" }, | ||
| 757 | { CTL_INT, FS_DQ_SYNCS, "syncs" }, | ||
| 758 | { CTL_INT, FS_DQ_WARNINGS, "warnings" }, | ||
| 759 | {} | ||
| 760 | }; | ||
| 761 | |||
| 762 | static const struct bin_table bin_fs_xfs_table[] = { | ||
| 763 | { CTL_INT, XFS_SGID_INHERIT, "irix_sgid_inherit" }, | ||
| 764 | { CTL_INT, XFS_SYMLINK_MODE, "irix_symlink_mode" }, | ||
| 765 | { CTL_INT, XFS_PANIC_MASK, "panic_mask" }, | ||
| 766 | |||
| 767 | { CTL_INT, XFS_ERRLEVEL, "error_level" }, | ||
| 768 | { CTL_INT, XFS_SYNCD_TIMER, "xfssyncd_centisecs" }, | ||
| 769 | { CTL_INT, XFS_INHERIT_SYNC, "inherit_sync" }, | ||
| 770 | { CTL_INT, XFS_INHERIT_NODUMP, "inherit_nodump" }, | ||
| 771 | { CTL_INT, XFS_INHERIT_NOATIME, "inherit_noatime" }, | ||
| 772 | { CTL_INT, XFS_BUF_TIMER, "xfsbufd_centisecs" }, | ||
| 773 | { CTL_INT, XFS_BUF_AGE, "age_buffer_centisecs" }, | ||
| 774 | { CTL_INT, XFS_INHERIT_NOSYM, "inherit_nosymlinks" }, | ||
| 775 | { CTL_INT, XFS_ROTORSTEP, "rotorstep" }, | ||
| 776 | { CTL_INT, XFS_INHERIT_NODFRG, "inherit_nodefrag" }, | ||
| 777 | { CTL_INT, XFS_FILESTREAM_TIMER, "filestream_centisecs" }, | ||
| 778 | { CTL_INT, XFS_STATS_CLEAR, "stats_clear" }, | ||
| 779 | {} | ||
| 780 | }; | ||
| 781 | |||
| 782 | static const struct bin_table bin_fs_ocfs2_nm_table[] = { | ||
| 783 | { CTL_STR, 1, "hb_ctl_path" }, | ||
| 784 | {} | ||
| 785 | }; | ||
| 786 | |||
| 787 | static const struct bin_table bin_fs_ocfs2_table[] = { | ||
| 788 | { CTL_DIR, 1, "nm", bin_fs_ocfs2_nm_table }, | ||
| 789 | {} | ||
| 790 | }; | ||
| 791 | |||
| 792 | static const struct bin_table bin_inotify_table[] = { | ||
| 793 | { CTL_INT, INOTIFY_MAX_USER_INSTANCES, "max_user_instances" }, | ||
| 794 | { CTL_INT, INOTIFY_MAX_USER_WATCHES, "max_user_watches" }, | ||
| 795 | { CTL_INT, INOTIFY_MAX_QUEUED_EVENTS, "max_queued_events" }, | ||
| 796 | {} | ||
| 797 | }; | ||
| 798 | |||
| 799 | static const struct bin_table bin_fs_table[] = { | ||
| 800 | { CTL_INT, FS_NRINODE, "inode-nr" }, | ||
| 801 | { CTL_INT, FS_STATINODE, "inode-state" }, | ||
| 802 | /* FS_MAXINODE unused */ | ||
| 803 | /* FS_NRDQUOT unused */ | ||
| 804 | /* FS_MAXDQUOT unused */ | ||
| 805 | /* FS_NRFILE "file-nr" no longer used */ | ||
| 806 | { CTL_INT, FS_MAXFILE, "file-max" }, | ||
| 807 | { CTL_INT, FS_DENTRY, "dentry-state" }, | ||
| 808 | /* FS_NRSUPER unused */ | ||
| 809 | /* FS_MAXUPSER unused */ | ||
| 810 | { CTL_INT, FS_OVERFLOWUID, "overflowuid" }, | ||
| 811 | { CTL_INT, FS_OVERFLOWGID, "overflowgid" }, | ||
| 812 | { CTL_INT, FS_LEASES, "leases-enable" }, | ||
| 813 | { CTL_INT, FS_DIR_NOTIFY, "dir-notify-enable" }, | ||
| 814 | { CTL_INT, FS_LEASE_TIME, "lease-break-time" }, | ||
| 815 | { CTL_DIR, FS_DQSTATS, "quota", bin_fs_quota_table }, | ||
| 816 | { CTL_DIR, FS_XFS, "xfs", bin_fs_xfs_table }, | ||
| 817 | { CTL_ULONG, FS_AIO_NR, "aio-nr" }, | ||
| 818 | { CTL_ULONG, FS_AIO_MAX_NR, "aio-max-nr" }, | ||
| 819 | { CTL_DIR, FS_INOTIFY, "inotify", bin_inotify_table }, | ||
| 820 | { CTL_DIR, FS_OCFS2, "ocfs2", bin_fs_ocfs2_table }, | ||
| 821 | { CTL_INT, KERN_SETUID_DUMPABLE, "suid_dumpable" }, | ||
| 822 | {} | ||
| 823 | }; | ||
| 824 | |||
| 825 | static const struct bin_table bin_ipmi_table[] = { | ||
| 826 | { CTL_INT, DEV_IPMI_POWEROFF_POWERCYCLE, "poweroff_powercycle" }, | ||
| 827 | {} | ||
| 828 | }; | ||
| 829 | |||
| 830 | static const struct bin_table bin_mac_hid_files[] = { | ||
| 831 | /* DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES unused */ | ||
| 832 | /* DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES unused */ | ||
| 833 | { CTL_INT, DEV_MAC_HID_MOUSE_BUTTON_EMULATION, "mouse_button_emulation" }, | ||
| 834 | { CTL_INT, DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE, "mouse_button2_keycode" }, | ||
| 835 | { CTL_INT, DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE, "mouse_button3_keycode" }, | ||
| 836 | /* DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES unused */ | ||
| 837 | {} | ||
| 838 | }; | ||
| 839 | |||
| 840 | static const struct bin_table bin_raid_table[] = { | ||
| 841 | { CTL_INT, DEV_RAID_SPEED_LIMIT_MIN, "speed_limit_min" }, | ||
| 842 | { CTL_INT, DEV_RAID_SPEED_LIMIT_MAX, "speed_limit_max" }, | ||
| 843 | {} | ||
| 844 | }; | ||
| 845 | |||
| 846 | static const struct bin_table bin_scsi_table[] = { | ||
| 847 | { CTL_INT, DEV_SCSI_LOGGING_LEVEL, "logging_level" }, | ||
| 848 | {} | ||
| 849 | }; | ||
| 850 | |||
| 851 | static const struct bin_table bin_dev_table[] = { | ||
| 852 | /* DEV_CDROM "cdrom" no longer used */ | ||
| 853 | /* DEV_HWMON unused */ | ||
| 854 | /* DEV_PARPORT "parport" no longer used */ | ||
| 855 | { CTL_DIR, DEV_RAID, "raid", bin_raid_table }, | ||
| 856 | { CTL_DIR, DEV_MAC_HID, "mac_hid", bin_mac_hid_files }, | ||
| 857 | { CTL_DIR, DEV_SCSI, "scsi", bin_scsi_table }, | ||
| 858 | { CTL_DIR, DEV_IPMI, "ipmi", bin_ipmi_table }, | ||
| 859 | {} | ||
| 860 | }; | ||
| 861 | |||
| 862 | static const struct bin_table bin_bus_isa_table[] = { | ||
| 863 | { CTL_INT, BUS_ISA_MEM_BASE, "membase" }, | ||
| 864 | { CTL_INT, BUS_ISA_PORT_BASE, "portbase" }, | ||
| 865 | { CTL_INT, BUS_ISA_PORT_SHIFT, "portshift" }, | ||
| 866 | {} | ||
| 867 | }; | ||
| 868 | |||
| 869 | static const struct bin_table bin_bus_table[] = { | ||
| 870 | { CTL_DIR, CTL_BUS_ISA, "isa", bin_bus_isa_table }, | ||
| 871 | {} | ||
| 872 | }; | ||
| 873 | |||
| 874 | |||
| 875 | static const struct bin_table bin_s390dbf_table[] = { | ||
| 876 | { CTL_INT, 5678 /* CTL_S390DBF_STOPPABLE */, "debug_stoppable" }, | ||
| 877 | { CTL_INT, 5679 /* CTL_S390DBF_ACTIVE */, "debug_active" }, | ||
| 878 | {} | ||
| 879 | }; | ||
| 880 | |||
| 881 | static const struct bin_table bin_sunrpc_table[] = { | ||
| 882 | /* CTL_RPCDEBUG "rpc_debug" no longer used */ | ||
| 883 | /* CTL_NFSDEBUG "nfs_debug" no longer used */ | ||
| 884 | /* CTL_NFSDDEBUG "nfsd_debug" no longer used */ | ||
| 885 | /* CTL_NLMDEBUG "nlm_debug" no longer used */ | ||
| 886 | |||
| 887 | { CTL_INT, CTL_SLOTTABLE_UDP, "udp_slot_table_entries" }, | ||
| 888 | { CTL_INT, CTL_SLOTTABLE_TCP, "tcp_slot_table_entries" }, | ||
| 889 | { CTL_INT, CTL_MIN_RESVPORT, "min_resvport" }, | ||
| 890 | { CTL_INT, CTL_MAX_RESVPORT, "max_resvport" }, | ||
| 891 | {} | ||
| 892 | }; | ||
| 893 | |||
| 894 | static const struct bin_table bin_pm_table[] = { | ||
| 895 | /* frv specific */ | ||
| 896 | /* 1 == CTL_PM_SUSPEND "suspend" no longer used" */ | ||
| 897 | { CTL_INT, 2 /* CTL_PM_CMODE */, "cmode" }, | ||
| 898 | { CTL_INT, 3 /* CTL_PM_P0 */, "p0" }, | ||
| 899 | { CTL_INT, 4 /* CTL_PM_CM */, "cm" }, | ||
| 900 | {} | ||
| 901 | }; | ||
| 902 | |||
| 903 | static const struct bin_table bin_root_table[] = { | ||
| 904 | { CTL_DIR, CTL_KERN, "kernel", bin_kern_table }, | ||
| 905 | { CTL_DIR, CTL_VM, "vm", bin_vm_table }, | ||
| 906 | { CTL_DIR, CTL_NET, "net", bin_net_table }, | ||
| 907 | /* CTL_PROC not used */ | ||
| 908 | { CTL_DIR, CTL_FS, "fs", bin_fs_table }, | ||
| 909 | /* CTL_DEBUG "debug" no longer used */ | ||
| 910 | { CTL_DIR, CTL_DEV, "dev", bin_dev_table }, | ||
| 911 | { CTL_DIR, CTL_BUS, "bus", bin_bus_table }, | ||
| 912 | { CTL_DIR, CTL_ABI, "abi" }, | ||
| 913 | /* CTL_CPU not used */ | ||
| 914 | /* CTL_ARLAN "arlan" no longer used */ | ||
| 915 | { CTL_DIR, CTL_S390DBF, "s390dbf", bin_s390dbf_table }, | ||
| 916 | { CTL_DIR, CTL_SUNRPC, "sunrpc", bin_sunrpc_table }, | ||
| 917 | { CTL_DIR, CTL_PM, "pm", bin_pm_table }, | ||
| 918 | {} | ||
| 919 | }; | ||
| 920 | |||
| 921 | static ssize_t bin_dir(struct file *file, | ||
| 922 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) | ||
| 923 | { | ||
| 924 | return -ENOTDIR; | ||
| 925 | } | ||
| 926 | |||
| 927 | |||
| 928 | static ssize_t bin_string(struct file *file, | ||
| 929 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) | ||
| 930 | { | ||
| 931 | ssize_t result, copied = 0; | ||
| 932 | |||
| 933 | if (oldval && oldlen) { | ||
| 934 | char __user *lastp; | ||
| 935 | loff_t pos = 0; | ||
| 936 | int ch; | ||
| 937 | |||
| 938 | result = vfs_read(file, oldval, oldlen, &pos); | ||
| 939 | if (result < 0) | ||
| 940 | goto out; | ||
| 941 | |||
| 942 | copied = result; | ||
| 943 | lastp = oldval + copied - 1; | ||
| 944 | |||
| 945 | result = -EFAULT; | ||
| 946 | if (get_user(ch, lastp)) | ||
| 947 | goto out; | ||
| 948 | |||
| 949 | /* Trim off the trailing newline */ | ||
| 950 | if (ch == '\n') { | ||
| 951 | result = -EFAULT; | ||
| 952 | if (put_user('\0', lastp)) | ||
| 953 | goto out; | ||
| 954 | copied -= 1; | ||
| 955 | } | ||
| 956 | } | ||
| 957 | |||
| 958 | if (newval && newlen) { | ||
| 959 | loff_t pos = 0; | ||
| 960 | |||
| 961 | result = vfs_write(file, newval, newlen, &pos); | ||
| 962 | if (result < 0) | ||
| 963 | goto out; | ||
| 964 | } | ||
| 965 | |||
| 966 | result = copied; | ||
| 967 | out: | ||
| 968 | return result; | ||
| 969 | } | ||
| 970 | |||
| 971 | static ssize_t bin_intvec(struct file *file, | ||
| 972 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) | ||
| 973 | { | ||
| 974 | mm_segment_t old_fs = get_fs(); | ||
| 975 | ssize_t copied = 0; | ||
| 976 | char *buffer; | ||
| 977 | ssize_t result; | ||
| 978 | |||
| 979 | result = -ENOMEM; | ||
| 980 | buffer = kmalloc(BUFSZ, GFP_KERNEL); | ||
| 981 | if (!buffer) | ||
| 982 | goto out; | ||
| 983 | |||
| 984 | if (oldval && oldlen) { | ||
| 985 | unsigned __user *vec = oldval; | ||
| 986 | size_t length = oldlen / sizeof(*vec); | ||
| 987 | loff_t pos = 0; | ||
| 988 | char *str, *end; | ||
| 989 | int i; | ||
| 990 | |||
| 991 | set_fs(KERNEL_DS); | ||
| 992 | result = vfs_read(file, buffer, BUFSZ - 1, &pos); | ||
| 993 | set_fs(old_fs); | ||
| 994 | if (result < 0) | ||
| 995 | goto out_kfree; | ||
| 996 | |||
| 997 | str = buffer; | ||
| 998 | end = str + result; | ||
| 999 | *end++ = '\0'; | ||
| 1000 | for (i = 0; i < length; i++) { | ||
| 1001 | unsigned long value; | ||
| 1002 | |||
| 1003 | value = simple_strtoul(str, &str, 10); | ||
| 1004 | while (isspace(*str)) | ||
| 1005 | str++; | ||
| 1006 | |||
| 1007 | result = -EFAULT; | ||
| 1008 | if (put_user(value, vec + i)) | ||
| 1009 | goto out_kfree; | ||
| 1010 | |||
| 1011 | copied += sizeof(*vec); | ||
| 1012 | if (!isdigit(*str)) | ||
| 1013 | break; | ||
| 1014 | } | ||
| 1015 | } | ||
| 1016 | |||
| 1017 | if (newval && newlen) { | ||
| 1018 | unsigned __user *vec = newval; | ||
| 1019 | size_t length = newlen / sizeof(*vec); | ||
| 1020 | loff_t pos = 0; | ||
| 1021 | char *str, *end; | ||
| 1022 | int i; | ||
| 1023 | |||
| 1024 | str = buffer; | ||
| 1025 | end = str + BUFSZ; | ||
| 1026 | for (i = 0; i < length; i++) { | ||
| 1027 | unsigned long value; | ||
| 1028 | |||
| 1029 | result = -EFAULT; | ||
| 1030 | if (get_user(value, vec + i)) | ||
| 1031 | goto out_kfree; | ||
| 1032 | |||
| 1033 | str += snprintf(str, end - str, "%lu\t", value); | ||
| 1034 | } | ||
| 1035 | |||
| 1036 | set_fs(KERNEL_DS); | ||
| 1037 | result = vfs_write(file, buffer, str - buffer, &pos); | ||
| 1038 | set_fs(old_fs); | ||
| 1039 | if (result < 0) | ||
| 1040 | goto out_kfree; | ||
| 1041 | } | ||
| 1042 | result = copied; | ||
| 1043 | out_kfree: | ||
| 1044 | kfree(buffer); | ||
| 1045 | out: | ||
| 1046 | return result; | ||
| 1047 | } | ||
| 1048 | |||
| 1049 | static ssize_t bin_ulongvec(struct file *file, | ||
| 1050 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) | ||
| 1051 | { | ||
| 1052 | mm_segment_t old_fs = get_fs(); | ||
| 1053 | ssize_t copied = 0; | ||
| 1054 | char *buffer; | ||
| 1055 | ssize_t result; | ||
| 1056 | |||
| 1057 | result = -ENOMEM; | ||
| 1058 | buffer = kmalloc(BUFSZ, GFP_KERNEL); | ||
| 1059 | if (!buffer) | ||
| 1060 | goto out; | ||
| 1061 | |||
| 1062 | if (oldval && oldlen) { | ||
| 1063 | unsigned long __user *vec = oldval; | ||
| 1064 | size_t length = oldlen / sizeof(*vec); | ||
| 1065 | loff_t pos = 0; | ||
| 1066 | char *str, *end; | ||
| 1067 | int i; | ||
| 1068 | |||
| 1069 | set_fs(KERNEL_DS); | ||
| 1070 | result = vfs_read(file, buffer, BUFSZ - 1, &pos); | ||
| 1071 | set_fs(old_fs); | ||
| 1072 | if (result < 0) | ||
| 1073 | goto out_kfree; | ||
| 1074 | |||
| 1075 | str = buffer; | ||
| 1076 | end = str + result; | ||
| 1077 | *end++ = '\0'; | ||
| 1078 | for (i = 0; i < length; i++) { | ||
| 1079 | unsigned long value; | ||
| 1080 | |||
| 1081 | value = simple_strtoul(str, &str, 10); | ||
| 1082 | while (isspace(*str)) | ||
| 1083 | str++; | ||
| 1084 | |||
| 1085 | result = -EFAULT; | ||
| 1086 | if (put_user(value, vec + i)) | ||
| 1087 | goto out_kfree; | ||
| 1088 | |||
| 1089 | copied += sizeof(*vec); | ||
| 1090 | if (!isdigit(*str)) | ||
| 1091 | break; | ||
| 1092 | } | ||
| 1093 | } | ||
| 1094 | |||
| 1095 | if (newval && newlen) { | ||
| 1096 | unsigned long __user *vec = newval; | ||
| 1097 | size_t length = newlen / sizeof(*vec); | ||
| 1098 | loff_t pos = 0; | ||
| 1099 | char *str, *end; | ||
| 1100 | int i; | ||
| 1101 | |||
| 1102 | str = buffer; | ||
| 1103 | end = str + BUFSZ; | ||
| 1104 | for (i = 0; i < length; i++) { | ||
| 1105 | unsigned long value; | ||
| 1106 | |||
| 1107 | result = -EFAULT; | ||
| 1108 | if (get_user(value, vec + i)) | ||
| 1109 | goto out_kfree; | ||
| 1110 | |||
| 1111 | str += snprintf(str, end - str, "%lu\t", value); | ||
| 1112 | } | ||
| 1113 | |||
| 1114 | set_fs(KERNEL_DS); | ||
| 1115 | result = vfs_write(file, buffer, str - buffer, &pos); | ||
| 1116 | set_fs(old_fs); | ||
| 1117 | if (result < 0) | ||
| 1118 | goto out_kfree; | ||
| 1119 | } | ||
| 1120 | result = copied; | ||
| 1121 | out_kfree: | ||
| 1122 | kfree(buffer); | ||
| 1123 | out: | ||
| 1124 | return result; | ||
| 1125 | } | ||
| 1126 | |||
| 1127 | static unsigned hex_value(int ch) | ||
| 1128 | { | ||
| 1129 | return isdigit(ch) ? ch - '0' : ((ch | 0x20) - 'a') + 10; | ||
| 1130 | } | ||
| 1131 | |||
| 1132 | static ssize_t bin_uuid(struct file *file, | ||
| 1133 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) | ||
| 1134 | { | ||
| 1135 | mm_segment_t old_fs = get_fs(); | ||
| 1136 | ssize_t result, copied = 0; | ||
| 1137 | |||
| 1138 | /* Only supports reads */ | ||
| 1139 | if (oldval && oldlen) { | ||
| 1140 | loff_t pos = 0; | ||
| 1141 | char buf[40], *str = buf; | ||
| 1142 | unsigned char uuid[16]; | ||
| 1143 | int i; | ||
| 1144 | |||
| 1145 | set_fs(KERNEL_DS); | ||
| 1146 | result = vfs_read(file, buf, sizeof(buf) - 1, &pos); | ||
| 1147 | set_fs(old_fs); | ||
| 1148 | if (result < 0) | ||
| 1149 | goto out; | ||
| 1150 | |||
| 1151 | buf[result] = '\0'; | ||
| 1152 | |||
| 1153 | /* Convert the uuid to from a string to binary */ | ||
| 1154 | for (i = 0; i < 16; i++) { | ||
| 1155 | result = -EIO; | ||
| 1156 | if (!isxdigit(str[0]) || !isxdigit(str[1])) | ||
| 1157 | goto out; | ||
| 1158 | |||
| 1159 | uuid[i] = (hex_value(str[0]) << 4) | hex_value(str[1]); | ||
| 1160 | str += 2; | ||
| 1161 | if (*str == '-') | ||
| 1162 | str++; | ||
| 1163 | } | ||
| 1164 | |||
| 1165 | if (oldlen > 16) | ||
| 1166 | oldlen = 16; | ||
| 1167 | |||
| 1168 | result = -EFAULT; | ||
| 1169 | if (copy_to_user(oldval, uuid, oldlen)) | ||
| 1170 | goto out; | ||
| 1171 | |||
| 1172 | copied = oldlen; | ||
| 1173 | } | ||
| 1174 | result = copied; | ||
| 1175 | out: | ||
| 1176 | return result; | ||
| 1177 | } | ||
| 1178 | |||
| 1179 | static ssize_t bin_dn_node_address(struct file *file, | ||
| 1180 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) | ||
| 1181 | { | ||
| 1182 | mm_segment_t old_fs = get_fs(); | ||
| 1183 | ssize_t result, copied = 0; | ||
| 1184 | |||
| 1185 | if (oldval && oldlen) { | ||
| 1186 | loff_t pos = 0; | ||
| 1187 | char buf[15], *nodep; | ||
| 1188 | unsigned long area, node; | ||
| 1189 | __le16 dnaddr; | ||
| 1190 | |||
| 1191 | set_fs(KERNEL_DS); | ||
| 1192 | result = vfs_read(file, buf, sizeof(buf) - 1, &pos); | ||
| 1193 | set_fs(old_fs); | ||
| 1194 | if (result < 0) | ||
| 1195 | goto out; | ||
| 1196 | |||
| 1197 | buf[result] = '\0'; | ||
| 1198 | |||
| 1199 | /* Convert the decnet addresss to binary */ | ||
| 1200 | result = -EIO; | ||
| 1201 | nodep = strchr(buf, '.') + 1; | ||
| 1202 | if (!nodep) | ||
| 1203 | goto out; | ||
| 1204 | |||
| 1205 | area = simple_strtoul(buf, NULL, 10); | ||
| 1206 | node = simple_strtoul(nodep, NULL, 10); | ||
| 1207 | |||
| 1208 | result = -EIO; | ||
| 1209 | if ((area > 63)||(node > 1023)) | ||
| 1210 | goto out; | ||
| 1211 | |||
| 1212 | dnaddr = cpu_to_le16((area << 10) | node); | ||
| 1213 | |||
| 1214 | result = -EFAULT; | ||
| 1215 | if (put_user(dnaddr, (__le16 __user *)oldval)) | ||
| 1216 | goto out; | ||
| 1217 | |||
| 1218 | copied = sizeof(dnaddr); | ||
| 1219 | } | ||
| 1220 | |||
| 1221 | if (newval && newlen) { | ||
| 1222 | loff_t pos = 0; | ||
| 1223 | __le16 dnaddr; | ||
| 1224 | char buf[15]; | ||
| 1225 | int len; | ||
| 1226 | |||
| 1227 | result = -EINVAL; | ||
| 1228 | if (newlen != sizeof(dnaddr)) | ||
| 1229 | goto out; | ||
| 1230 | |||
| 1231 | result = -EFAULT; | ||
| 1232 | if (get_user(dnaddr, (__le16 __user *)newval)) | ||
| 1233 | goto out; | ||
| 1234 | |||
| 1235 | len = snprintf(buf, sizeof(buf), "%hu.%hu", | ||
| 1236 | le16_to_cpu(dnaddr) >> 10, | ||
| 1237 | le16_to_cpu(dnaddr) & 0x3ff); | ||
| 1238 | |||
| 1239 | set_fs(KERNEL_DS); | ||
| 1240 | result = vfs_write(file, buf, len, &pos); | ||
| 1241 | set_fs(old_fs); | ||
| 1242 | if (result < 0) | ||
| 1243 | goto out; | ||
| 1244 | } | ||
| 1245 | |||
| 1246 | result = copied; | ||
| 1247 | out: | ||
| 1248 | return result; | ||
| 1249 | } | ||
| 1250 | |||
| 1251 | static const struct bin_table *get_sysctl(const int *name, int nlen, char *path) | ||
| 1252 | { | ||
| 1253 | const struct bin_table *table = &bin_root_table[0]; | ||
| 1254 | int ctl_name; | ||
| 1255 | |||
| 1256 | /* The binary sysctl tables have a small maximum depth so | ||
| 1257 | * there is no danger of overflowing our path as it PATH_MAX | ||
| 1258 | * bytes long. | ||
| 1259 | */ | ||
| 1260 | memcpy(path, "sys/", 4); | ||
| 1261 | path += 4; | ||
| 1262 | |||
| 1263 | repeat: | ||
| 1264 | if (!nlen) | ||
| 1265 | return ERR_PTR(-ENOTDIR); | ||
| 1266 | ctl_name = *name; | ||
| 1267 | name++; | ||
| 1268 | nlen--; | ||
| 1269 | for ( ; table->convert; table++) { | ||
| 1270 | int len = 0; | ||
| 1271 | |||
| 1272 | /* | ||
| 1273 | * For a wild card entry map from ifindex to network | ||
| 1274 | * device name. | ||
| 1275 | */ | ||
| 1276 | if (!table->ctl_name) { | ||
| 1277 | #ifdef CONFIG_NET | ||
| 1278 | struct net *net = current->nsproxy->net_ns; | ||
| 1279 | struct net_device *dev; | ||
| 1280 | dev = dev_get_by_index(net, ctl_name); | ||
| 1281 | if (dev) { | ||
| 1282 | len = strlen(dev->name); | ||
| 1283 | memcpy(path, dev->name, len); | ||
| 1284 | dev_put(dev); | ||
| 1285 | } | ||
| 1286 | #endif | ||
| 1287 | /* Use the well known sysctl number to proc name mapping */ | ||
| 1288 | } else if (ctl_name == table->ctl_name) { | ||
| 1289 | len = strlen(table->procname); | ||
| 1290 | memcpy(path, table->procname, len); | ||
| 1291 | } | ||
| 1292 | if (len) { | ||
| 1293 | path += len; | ||
| 1294 | if (table->child) { | ||
| 1295 | *path++ = '/'; | ||
| 1296 | table = table->child; | ||
| 1297 | goto repeat; | ||
| 1298 | } | ||
| 1299 | *path = '\0'; | ||
| 1300 | return table; | ||
| 1301 | } | ||
| 1302 | } | ||
| 1303 | return ERR_PTR(-ENOTDIR); | ||
| 1304 | } | ||
| 1305 | |||
| 1306 | static char *sysctl_getname(const int *name, int nlen, const struct bin_table **tablep) | ||
| 1307 | { | ||
| 1308 | char *tmp, *result; | ||
| 1309 | |||
| 1310 | result = ERR_PTR(-ENOMEM); | ||
| 1311 | tmp = __getname(); | ||
| 1312 | if (tmp) { | ||
| 1313 | const struct bin_table *table = get_sysctl(name, nlen, tmp); | ||
| 1314 | result = tmp; | ||
| 1315 | *tablep = table; | ||
| 1316 | if (IS_ERR(table)) { | ||
| 1317 | __putname(tmp); | ||
| 1318 | result = ERR_CAST(table); | ||
| 1319 | } | ||
| 1320 | } | ||
| 1321 | return result; | ||
| 1322 | } | ||
| 1323 | |||
| 1324 | static ssize_t binary_sysctl(const int *name, int nlen, | ||
| 1325 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) | ||
| 1326 | { | ||
| 1327 | const struct bin_table *table = NULL; | ||
| 1328 | struct nameidata nd; | ||
| 1329 | struct vfsmount *mnt; | ||
| 1330 | struct file *file; | ||
| 1331 | ssize_t result; | ||
| 1332 | char *pathname; | ||
| 1333 | int flags; | ||
| 1334 | int acc_mode, fmode; | ||
| 1335 | |||
| 1336 | pathname = sysctl_getname(name, nlen, &table); | ||
| 1337 | result = PTR_ERR(pathname); | ||
| 1338 | if (IS_ERR(pathname)) | ||
| 1339 | goto out; | ||
| 1340 | |||
| 1341 | /* How should the sysctl be accessed? */ | ||
| 1342 | if (oldval && oldlen && newval && newlen) { | ||
| 1343 | flags = O_RDWR; | ||
| 1344 | acc_mode = MAY_READ | MAY_WRITE; | ||
| 1345 | fmode = FMODE_READ | FMODE_WRITE; | ||
| 1346 | } else if (newval && newlen) { | ||
| 1347 | flags = O_WRONLY; | ||
| 1348 | acc_mode = MAY_WRITE; | ||
| 1349 | fmode = FMODE_WRITE; | ||
| 1350 | } else if (oldval && oldlen) { | ||
| 1351 | flags = O_RDONLY; | ||
| 1352 | acc_mode = MAY_READ; | ||
| 1353 | fmode = FMODE_READ; | ||
| 1354 | } else { | ||
| 1355 | result = 0; | ||
| 1356 | goto out_putname; | ||
| 1357 | } | ||
| 1358 | |||
| 1359 | mnt = current->nsproxy->pid_ns->proc_mnt; | ||
| 1360 | result = vfs_path_lookup(mnt->mnt_root, mnt, pathname, 0, &nd); | ||
| 1361 | if (result) | ||
| 1362 | goto out_putname; | ||
| 1363 | |||
| 1364 | result = may_open(&nd.path, acc_mode, fmode); | ||
| 1365 | if (result) | ||
| 1366 | goto out_putpath; | ||
| 1367 | |||
| 1368 | file = dentry_open(nd.path.dentry, nd.path.mnt, flags, current_cred()); | ||
| 1369 | result = PTR_ERR(file); | ||
| 1370 | if (IS_ERR(file)) | ||
| 1371 | goto out_putname; | ||
| 1372 | |||
| 1373 | result = table->convert(file, oldval, oldlen, newval, newlen); | ||
| 1374 | |||
| 1375 | fput(file); | ||
| 1376 | out_putname: | ||
| 1377 | putname(pathname); | ||
| 1378 | out: | ||
| 1379 | return result; | ||
| 1380 | |||
| 1381 | out_putpath: | ||
| 1382 | path_put(&nd.path); | ||
| 1383 | goto out_putname; | ||
| 1384 | } | ||
| 1385 | |||
| 1386 | |||
| 1387 | #else /* CONFIG_SYSCTL_SYSCALL */ | ||
| 1388 | |||
| 1389 | static ssize_t binary_sysctl(const int *name, int nlen, | ||
| 1390 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) | ||
| 1391 | { | ||
| 1392 | return -ENOSYS; | ||
| 1393 | } | ||
| 1394 | |||
| 1395 | #endif /* CONFIG_SYSCTL_SYSCALL */ | ||
| 1396 | |||
| 1397 | |||
| 1398 | static void deprecated_sysctl_warning(const int *name, int nlen) | ||
| 1399 | { | ||
| 1400 | int i; | ||
| 1401 | |||
| 1402 | if (printk_ratelimit()) { | ||
| 1403 | printk(KERN_INFO | ||
| 1404 | "warning: process `%s' used the deprecated sysctl " | ||
| 1405 | "system call with ", current->comm); | ||
| 1406 | for (i = 0; i < nlen; i++) | ||
| 1407 | printk("%d.", name[i]); | ||
| 1408 | printk("\n"); | ||
| 1409 | } | ||
| 1410 | return; | ||
| 1411 | } | ||
| 1412 | |||
| 1413 | static ssize_t do_sysctl(int __user *args_name, int nlen, | ||
| 1414 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) | ||
| 1415 | { | ||
| 1416 | int name[CTL_MAXNAME]; | ||
| 1417 | int i; | ||
| 1418 | |||
| 1419 | /* Check args->nlen. */ | ||
| 1420 | if (nlen < 0 || nlen > CTL_MAXNAME) | ||
| 1421 | return -ENOTDIR; | ||
| 1422 | /* Read in the sysctl name for simplicity */ | ||
| 1423 | for (i = 0; i < nlen; i++) | ||
| 1424 | if (get_user(name[i], args_name + i)) | ||
| 1425 | return -EFAULT; | ||
| 1426 | |||
| 1427 | deprecated_sysctl_warning(name, nlen); | ||
| 1428 | |||
| 1429 | return binary_sysctl(name, nlen, oldval, oldlen, newval, newlen); | ||
| 1430 | } | ||
| 1431 | |||
| 1432 | SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args) | ||
| 1433 | { | ||
| 1434 | struct __sysctl_args tmp; | ||
| 1435 | size_t oldlen = 0; | ||
| 1436 | ssize_t result; | ||
| 1437 | |||
| 1438 | if (copy_from_user(&tmp, args, sizeof(tmp))) | ||
| 1439 | return -EFAULT; | ||
| 1440 | |||
| 1441 | if (tmp.oldval && !tmp.oldlenp) | ||
| 1442 | return -EFAULT; | ||
| 1443 | |||
| 1444 | if (tmp.oldlenp && get_user(oldlen, tmp.oldlenp)) | ||
| 1445 | return -EFAULT; | ||
| 1446 | |||
| 1447 | result = do_sysctl(tmp.name, tmp.nlen, tmp.oldval, oldlen, | ||
| 1448 | tmp.newval, tmp.newlen); | ||
| 1449 | |||
| 1450 | if (result >= 0) { | ||
| 1451 | oldlen = result; | ||
| 1452 | result = 0; | ||
| 1453 | } | ||
| 1454 | |||
| 1455 | if (tmp.oldlenp && put_user(oldlen, tmp.oldlenp)) | ||
| 1456 | return -EFAULT; | ||
| 1457 | |||
| 1458 | return result; | ||
| 1459 | } | ||
| 1460 | |||
| 1461 | |||
| 1462 | #ifdef CONFIG_COMPAT | ||
| 1463 | #include <asm/compat.h> | ||
| 1464 | |||
| 1465 | struct compat_sysctl_args { | ||
| 1466 | compat_uptr_t name; | ||
| 1467 | int nlen; | ||
| 1468 | compat_uptr_t oldval; | ||
| 1469 | compat_uptr_t oldlenp; | ||
| 1470 | compat_uptr_t newval; | ||
| 1471 | compat_size_t newlen; | ||
| 1472 | compat_ulong_t __unused[4]; | ||
| 1473 | }; | ||
| 1474 | |||
| 1475 | asmlinkage long compat_sys_sysctl(struct compat_sysctl_args __user *args) | ||
| 1476 | { | ||
| 1477 | struct compat_sysctl_args tmp; | ||
| 1478 | compat_size_t __user *compat_oldlenp; | ||
| 1479 | size_t oldlen = 0; | ||
| 1480 | ssize_t result; | ||
| 1481 | |||
| 1482 | if (copy_from_user(&tmp, args, sizeof(tmp))) | ||
| 1483 | return -EFAULT; | ||
| 1484 | |||
| 1485 | if (tmp.oldval && !tmp.oldlenp) | ||
| 1486 | return -EFAULT; | ||
| 1487 | |||
| 1488 | compat_oldlenp = compat_ptr(tmp.oldlenp); | ||
| 1489 | if (compat_oldlenp && get_user(oldlen, compat_oldlenp)) | ||
| 1490 | return -EFAULT; | ||
| 1491 | |||
| 1492 | result = do_sysctl(compat_ptr(tmp.name), tmp.nlen, | ||
| 1493 | compat_ptr(tmp.oldval), oldlen, | ||
| 1494 | compat_ptr(tmp.newval), tmp.newlen); | ||
| 1495 | |||
| 1496 | if (result >= 0) { | ||
| 1497 | oldlen = result; | ||
| 1498 | result = 0; | ||
| 1499 | } | ||
| 1500 | |||
| 1501 | if (compat_oldlenp && put_user(oldlen, compat_oldlenp)) | ||
| 1502 | return -EFAULT; | ||
| 1503 | |||
| 1504 | return result; | ||
| 1505 | } | ||
| 1506 | |||
| 1507 | #endif /* CONFIG_COMPAT */ | ||
diff --git a/kernel/sysctl_check.c b/kernel/sysctl_check.c index b6e7aaea4604..04cdcf72c827 100644 --- a/kernel/sysctl_check.c +++ b/kernel/sysctl_check.c | |||
| @@ -5,1239 +5,6 @@ | |||
| 5 | #include <linux/string.h> | 5 | #include <linux/string.h> |
| 6 | #include <net/ip_vs.h> | 6 | #include <net/ip_vs.h> |
| 7 | 7 | ||
| 8 | struct trans_ctl_table { | ||
| 9 | int ctl_name; | ||
| 10 | const char *procname; | ||
| 11 | const struct trans_ctl_table *child; | ||
| 12 | }; | ||
| 13 | |||
| 14 | static const struct trans_ctl_table trans_random_table[] = { | ||
| 15 | { RANDOM_POOLSIZE, "poolsize" }, | ||
| 16 | { RANDOM_ENTROPY_COUNT, "entropy_avail" }, | ||
| 17 | { RANDOM_READ_THRESH, "read_wakeup_threshold" }, | ||
| 18 | { RANDOM_WRITE_THRESH, "write_wakeup_threshold" }, | ||
| 19 | { RANDOM_BOOT_ID, "boot_id" }, | ||
| 20 | { RANDOM_UUID, "uuid" }, | ||
| 21 | {} | ||
| 22 | }; | ||
| 23 | |||
| 24 | static const struct trans_ctl_table trans_pty_table[] = { | ||
| 25 | { PTY_MAX, "max" }, | ||
| 26 | { PTY_NR, "nr" }, | ||
| 27 | {} | ||
| 28 | }; | ||
| 29 | |||
| 30 | static const struct trans_ctl_table trans_kern_table[] = { | ||
| 31 | { KERN_OSTYPE, "ostype" }, | ||
| 32 | { KERN_OSRELEASE, "osrelease" }, | ||
| 33 | /* KERN_OSREV not used */ | ||
| 34 | { KERN_VERSION, "version" }, | ||
| 35 | /* KERN_SECUREMASK not used */ | ||
| 36 | /* KERN_PROF not used */ | ||
| 37 | { KERN_NODENAME, "hostname" }, | ||
| 38 | { KERN_DOMAINNAME, "domainname" }, | ||
| 39 | |||
| 40 | { KERN_PANIC, "panic" }, | ||
| 41 | { KERN_REALROOTDEV, "real-root-dev" }, | ||
| 42 | |||
| 43 | { KERN_SPARC_REBOOT, "reboot-cmd" }, | ||
| 44 | { KERN_CTLALTDEL, "ctrl-alt-del" }, | ||
| 45 | { KERN_PRINTK, "printk" }, | ||
| 46 | |||
| 47 | /* KERN_NAMETRANS not used */ | ||
| 48 | /* KERN_PPC_HTABRECLAIM not used */ | ||
| 49 | /* KERN_PPC_ZEROPAGED not used */ | ||
| 50 | { KERN_PPC_POWERSAVE_NAP, "powersave-nap" }, | ||
| 51 | |||
| 52 | { KERN_MODPROBE, "modprobe" }, | ||
| 53 | { KERN_SG_BIG_BUFF, "sg-big-buff" }, | ||
| 54 | { KERN_ACCT, "acct" }, | ||
| 55 | { KERN_PPC_L2CR, "l2cr" }, | ||
| 56 | |||
| 57 | /* KERN_RTSIGNR not used */ | ||
| 58 | /* KERN_RTSIGMAX not used */ | ||
| 59 | |||
| 60 | { KERN_SHMMAX, "shmmax" }, | ||
| 61 | { KERN_MSGMAX, "msgmax" }, | ||
| 62 | { KERN_MSGMNB, "msgmnb" }, | ||
| 63 | /* KERN_MSGPOOL not used*/ | ||
| 64 | { KERN_SYSRQ, "sysrq" }, | ||
| 65 | { KERN_MAX_THREADS, "threads-max" }, | ||
| 66 | { KERN_RANDOM, "random", trans_random_table }, | ||
| 67 | { KERN_SHMALL, "shmall" }, | ||
| 68 | { KERN_MSGMNI, "msgmni" }, | ||
| 69 | { KERN_SEM, "sem" }, | ||
| 70 | { KERN_SPARC_STOP_A, "stop-a" }, | ||
| 71 | { KERN_SHMMNI, "shmmni" }, | ||
| 72 | |||
| 73 | { KERN_OVERFLOWUID, "overflowuid" }, | ||
| 74 | { KERN_OVERFLOWGID, "overflowgid" }, | ||
| 75 | |||
| 76 | { KERN_HOTPLUG, "hotplug", }, | ||
| 77 | { KERN_IEEE_EMULATION_WARNINGS, "ieee_emulation_warnings" }, | ||
| 78 | |||
| 79 | { KERN_S390_USER_DEBUG_LOGGING, "userprocess_debug" }, | ||
| 80 | { KERN_CORE_USES_PID, "core_uses_pid" }, | ||
| 81 | { KERN_TAINTED, "tainted" }, | ||
| 82 | { KERN_CADPID, "cad_pid" }, | ||
| 83 | { KERN_PIDMAX, "pid_max" }, | ||
| 84 | { KERN_CORE_PATTERN, "core_pattern" }, | ||
| 85 | { KERN_PANIC_ON_OOPS, "panic_on_oops" }, | ||
| 86 | { KERN_HPPA_PWRSW, "soft-power" }, | ||
| 87 | { KERN_HPPA_UNALIGNED, "unaligned-trap" }, | ||
| 88 | |||
| 89 | { KERN_PRINTK_RATELIMIT, "printk_ratelimit" }, | ||
| 90 | { KERN_PRINTK_RATELIMIT_BURST, "printk_ratelimit_burst" }, | ||
| 91 | |||
| 92 | { KERN_PTY, "pty", trans_pty_table }, | ||
| 93 | { KERN_NGROUPS_MAX, "ngroups_max" }, | ||
| 94 | { KERN_SPARC_SCONS_PWROFF, "scons-poweroff" }, | ||
| 95 | { KERN_HZ_TIMER, "hz_timer" }, | ||
| 96 | { KERN_UNKNOWN_NMI_PANIC, "unknown_nmi_panic" }, | ||
| 97 | { KERN_BOOTLOADER_TYPE, "bootloader_type" }, | ||
| 98 | { KERN_RANDOMIZE, "randomize_va_space" }, | ||
| 99 | |||
| 100 | { KERN_SPIN_RETRY, "spin_retry" }, | ||
| 101 | { KERN_ACPI_VIDEO_FLAGS, "acpi_video_flags" }, | ||
| 102 | { KERN_IA64_UNALIGNED, "ignore-unaligned-usertrap" }, | ||
| 103 | { KERN_COMPAT_LOG, "compat-log" }, | ||
| 104 | { KERN_MAX_LOCK_DEPTH, "max_lock_depth" }, | ||
| 105 | { KERN_NMI_WATCHDOG, "nmi_watchdog" }, | ||
| 106 | { KERN_PANIC_ON_NMI, "panic_on_unrecovered_nmi" }, | ||
| 107 | {} | ||
| 108 | }; | ||
| 109 | |||
| 110 | static const struct trans_ctl_table trans_vm_table[] = { | ||
| 111 | { VM_OVERCOMMIT_MEMORY, "overcommit_memory" }, | ||
| 112 | { VM_PAGE_CLUSTER, "page-cluster" }, | ||
| 113 | { VM_DIRTY_BACKGROUND, "dirty_background_ratio" }, | ||
| 114 | { VM_DIRTY_RATIO, "dirty_ratio" }, | ||
| 115 | { VM_DIRTY_WB_CS, "dirty_writeback_centisecs" }, | ||
| 116 | { VM_DIRTY_EXPIRE_CS, "dirty_expire_centisecs" }, | ||
| 117 | { VM_NR_PDFLUSH_THREADS, "nr_pdflush_threads" }, | ||
| 118 | { VM_OVERCOMMIT_RATIO, "overcommit_ratio" }, | ||
| 119 | /* VM_PAGEBUF unused */ | ||
| 120 | { VM_HUGETLB_PAGES, "nr_hugepages" }, | ||
| 121 | { VM_SWAPPINESS, "swappiness" }, | ||
| 122 | { VM_LOWMEM_RESERVE_RATIO, "lowmem_reserve_ratio" }, | ||
| 123 | { VM_MIN_FREE_KBYTES, "min_free_kbytes" }, | ||
| 124 | { VM_MAX_MAP_COUNT, "max_map_count" }, | ||
| 125 | { VM_LAPTOP_MODE, "laptop_mode" }, | ||
| 126 | { VM_BLOCK_DUMP, "block_dump" }, | ||
| 127 | { VM_HUGETLB_GROUP, "hugetlb_shm_group" }, | ||
| 128 | { VM_VFS_CACHE_PRESSURE, "vfs_cache_pressure" }, | ||
| 129 | { VM_LEGACY_VA_LAYOUT, "legacy_va_layout" }, | ||
| 130 | /* VM_SWAP_TOKEN_TIMEOUT unused */ | ||
| 131 | { VM_DROP_PAGECACHE, "drop_caches" }, | ||
| 132 | { VM_PERCPU_PAGELIST_FRACTION, "percpu_pagelist_fraction" }, | ||
| 133 | { VM_ZONE_RECLAIM_MODE, "zone_reclaim_mode" }, | ||
| 134 | { VM_MIN_UNMAPPED, "min_unmapped_ratio" }, | ||
| 135 | { VM_PANIC_ON_OOM, "panic_on_oom" }, | ||
| 136 | { VM_VDSO_ENABLED, "vdso_enabled" }, | ||
| 137 | { VM_MIN_SLAB, "min_slab_ratio" }, | ||
| 138 | |||
| 139 | {} | ||
| 140 | }; | ||
| 141 | |||
| 142 | static const struct trans_ctl_table trans_net_core_table[] = { | ||
| 143 | { NET_CORE_WMEM_MAX, "wmem_max" }, | ||
| 144 | { NET_CORE_RMEM_MAX, "rmem_max" }, | ||
| 145 | { NET_CORE_WMEM_DEFAULT, "wmem_default" }, | ||
| 146 | { NET_CORE_RMEM_DEFAULT, "rmem_default" }, | ||
| 147 | /* NET_CORE_DESTROY_DELAY unused */ | ||
| 148 | { NET_CORE_MAX_BACKLOG, "netdev_max_backlog" }, | ||
| 149 | /* NET_CORE_FASTROUTE unused */ | ||
| 150 | { NET_CORE_MSG_COST, "message_cost" }, | ||
| 151 | { NET_CORE_MSG_BURST, "message_burst" }, | ||
| 152 | { NET_CORE_OPTMEM_MAX, "optmem_max" }, | ||
| 153 | /* NET_CORE_HOT_LIST_LENGTH unused */ | ||
| 154 | /* NET_CORE_DIVERT_VERSION unused */ | ||
| 155 | /* NET_CORE_NO_CONG_THRESH unused */ | ||
| 156 | /* NET_CORE_NO_CONG unused */ | ||
| 157 | /* NET_CORE_LO_CONG unused */ | ||
| 158 | /* NET_CORE_MOD_CONG unused */ | ||
| 159 | { NET_CORE_DEV_WEIGHT, "dev_weight" }, | ||
| 160 | { NET_CORE_SOMAXCONN, "somaxconn" }, | ||
| 161 | { NET_CORE_BUDGET, "netdev_budget" }, | ||
| 162 | { NET_CORE_AEVENT_ETIME, "xfrm_aevent_etime" }, | ||
| 163 | { NET_CORE_AEVENT_RSEQTH, "xfrm_aevent_rseqth" }, | ||
| 164 | { NET_CORE_WARNINGS, "warnings" }, | ||
| 165 | {}, | ||
| 166 | }; | ||
| 167 | |||
| 168 | static const struct trans_ctl_table trans_net_unix_table[] = { | ||
| 169 | /* NET_UNIX_DESTROY_DELAY unused */ | ||
| 170 | /* NET_UNIX_DELETE_DELAY unused */ | ||
| 171 | { NET_UNIX_MAX_DGRAM_QLEN, "max_dgram_qlen" }, | ||
| 172 | {} | ||
| 173 | }; | ||
| 174 | |||
| 175 | static const struct trans_ctl_table trans_net_ipv4_route_table[] = { | ||
| 176 | { NET_IPV4_ROUTE_FLUSH, "flush" }, | ||
| 177 | { NET_IPV4_ROUTE_MIN_DELAY, "min_delay" }, | ||
| 178 | { NET_IPV4_ROUTE_MAX_DELAY, "max_delay" }, | ||
| 179 | { NET_IPV4_ROUTE_GC_THRESH, "gc_thresh" }, | ||
| 180 | { NET_IPV4_ROUTE_MAX_SIZE, "max_size" }, | ||
| 181 | { NET_IPV4_ROUTE_GC_MIN_INTERVAL, "gc_min_interval" }, | ||
| 182 | { NET_IPV4_ROUTE_GC_TIMEOUT, "gc_timeout" }, | ||
| 183 | { NET_IPV4_ROUTE_GC_INTERVAL, "gc_interval" }, | ||
| 184 | { NET_IPV4_ROUTE_REDIRECT_LOAD, "redirect_load" }, | ||
| 185 | { NET_IPV4_ROUTE_REDIRECT_NUMBER, "redirect_number" }, | ||
| 186 | { NET_IPV4_ROUTE_REDIRECT_SILENCE, "redirect_silence" }, | ||
| 187 | { NET_IPV4_ROUTE_ERROR_COST, "error_cost" }, | ||
| 188 | { NET_IPV4_ROUTE_ERROR_BURST, "error_burst" }, | ||
| 189 | { NET_IPV4_ROUTE_GC_ELASTICITY, "gc_elasticity" }, | ||
| 190 | { NET_IPV4_ROUTE_MTU_EXPIRES, "mtu_expires" }, | ||
| 191 | { NET_IPV4_ROUTE_MIN_PMTU, "min_pmtu" }, | ||
| 192 | { NET_IPV4_ROUTE_MIN_ADVMSS, "min_adv_mss" }, | ||
| 193 | { NET_IPV4_ROUTE_SECRET_INTERVAL, "secret_interval" }, | ||
| 194 | { NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS, "gc_min_interval_ms" }, | ||
| 195 | {} | ||
| 196 | }; | ||
| 197 | |||
| 198 | static const struct trans_ctl_table trans_net_ipv4_conf_vars_table[] = { | ||
| 199 | { NET_IPV4_CONF_FORWARDING, "forwarding" }, | ||
| 200 | { NET_IPV4_CONF_MC_FORWARDING, "mc_forwarding" }, | ||
| 201 | |||
| 202 | { NET_IPV4_CONF_PROXY_ARP, "proxy_arp" }, | ||
| 203 | { NET_IPV4_CONF_ACCEPT_REDIRECTS, "accept_redirects" }, | ||
| 204 | { NET_IPV4_CONF_SECURE_REDIRECTS, "secure_redirects" }, | ||
| 205 | { NET_IPV4_CONF_SEND_REDIRECTS, "send_redirects" }, | ||
| 206 | { NET_IPV4_CONF_SHARED_MEDIA, "shared_media" }, | ||
| 207 | { NET_IPV4_CONF_RP_FILTER, "rp_filter" }, | ||
| 208 | { NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE, "accept_source_route" }, | ||
| 209 | { NET_IPV4_CONF_BOOTP_RELAY, "bootp_relay" }, | ||
| 210 | { NET_IPV4_CONF_LOG_MARTIANS, "log_martians" }, | ||
| 211 | { NET_IPV4_CONF_TAG, "tag" }, | ||
| 212 | { NET_IPV4_CONF_ARPFILTER, "arp_filter" }, | ||
| 213 | { NET_IPV4_CONF_MEDIUM_ID, "medium_id" }, | ||
| 214 | { NET_IPV4_CONF_NOXFRM, "disable_xfrm" }, | ||
| 215 | { NET_IPV4_CONF_NOPOLICY, "disable_policy" }, | ||
| 216 | { NET_IPV4_CONF_FORCE_IGMP_VERSION, "force_igmp_version" }, | ||
| 217 | |||
| 218 | { NET_IPV4_CONF_ARP_ANNOUNCE, "arp_announce" }, | ||
| 219 | { NET_IPV4_CONF_ARP_IGNORE, "arp_ignore" }, | ||
| 220 | { NET_IPV4_CONF_PROMOTE_SECONDARIES, "promote_secondaries" }, | ||
| 221 | { NET_IPV4_CONF_ARP_ACCEPT, "arp_accept" }, | ||
| 222 | { NET_IPV4_CONF_ARP_NOTIFY, "arp_notify" }, | ||
| 223 | {} | ||
| 224 | }; | ||
| 225 | |||
| 226 | static const struct trans_ctl_table trans_net_ipv4_conf_table[] = { | ||
| 227 | { NET_PROTO_CONF_ALL, "all", trans_net_ipv4_conf_vars_table }, | ||
| 228 | { NET_PROTO_CONF_DEFAULT, "default", trans_net_ipv4_conf_vars_table }, | ||
| 229 | { 0, NULL, trans_net_ipv4_conf_vars_table }, | ||
| 230 | {} | ||
| 231 | }; | ||
| 232 | |||
| 233 | static const struct trans_ctl_table trans_net_neigh_vars_table[] = { | ||
| 234 | { NET_NEIGH_MCAST_SOLICIT, "mcast_solicit" }, | ||
| 235 | { NET_NEIGH_UCAST_SOLICIT, "ucast_solicit" }, | ||
| 236 | { NET_NEIGH_APP_SOLICIT, "app_solicit" }, | ||
| 237 | { NET_NEIGH_RETRANS_TIME, "retrans_time" }, | ||
| 238 | { NET_NEIGH_REACHABLE_TIME, "base_reachable_time" }, | ||
| 239 | { NET_NEIGH_DELAY_PROBE_TIME, "delay_first_probe_time" }, | ||
| 240 | { NET_NEIGH_GC_STALE_TIME, "gc_stale_time" }, | ||
| 241 | { NET_NEIGH_UNRES_QLEN, "unres_qlen" }, | ||
| 242 | { NET_NEIGH_PROXY_QLEN, "proxy_qlen" }, | ||
| 243 | { NET_NEIGH_ANYCAST_DELAY, "anycast_delay" }, | ||
| 244 | { NET_NEIGH_PROXY_DELAY, "proxy_delay" }, | ||
| 245 | { NET_NEIGH_LOCKTIME, "locktime" }, | ||
| 246 | { NET_NEIGH_GC_INTERVAL, "gc_interval" }, | ||
| 247 | { NET_NEIGH_GC_THRESH1, "gc_thresh1" }, | ||
| 248 | { NET_NEIGH_GC_THRESH2, "gc_thresh2" }, | ||
| 249 | { NET_NEIGH_GC_THRESH3, "gc_thresh3" }, | ||
| 250 | { NET_NEIGH_RETRANS_TIME_MS, "retrans_time_ms" }, | ||
| 251 | { NET_NEIGH_REACHABLE_TIME_MS, "base_reachable_time_ms" }, | ||
| 252 | {} | ||
| 253 | }; | ||
| 254 | |||
| 255 | static const struct trans_ctl_table trans_net_neigh_table[] = { | ||
| 256 | { NET_PROTO_CONF_DEFAULT, "default", trans_net_neigh_vars_table }, | ||
| 257 | { 0, NULL, trans_net_neigh_vars_table }, | ||
| 258 | {} | ||
| 259 | }; | ||
| 260 | |||
| 261 | static const struct trans_ctl_table trans_net_ipv4_netfilter_table[] = { | ||
| 262 | { NET_IPV4_NF_CONNTRACK_MAX, "ip_conntrack_max" }, | ||
| 263 | |||
| 264 | { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT, "ip_conntrack_tcp_timeout_syn_sent" }, | ||
| 265 | { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV, "ip_conntrack_tcp_timeout_syn_recv" }, | ||
| 266 | { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED, "ip_conntrack_tcp_timeout_established" }, | ||
| 267 | { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT, "ip_conntrack_tcp_timeout_fin_wait" }, | ||
| 268 | { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT, "ip_conntrack_tcp_timeout_close_wait" }, | ||
| 269 | { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK, "ip_conntrack_tcp_timeout_last_ack" }, | ||
| 270 | { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT, "ip_conntrack_tcp_timeout_time_wait" }, | ||
| 271 | { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE, "ip_conntrack_tcp_timeout_close" }, | ||
| 272 | |||
| 273 | { NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT, "ip_conntrack_udp_timeout" }, | ||
| 274 | { NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM, "ip_conntrack_udp_timeout_stream" }, | ||
| 275 | { NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT, "ip_conntrack_icmp_timeout" }, | ||
| 276 | { NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT, "ip_conntrack_generic_timeout" }, | ||
| 277 | |||
| 278 | { NET_IPV4_NF_CONNTRACK_BUCKETS, "ip_conntrack_buckets" }, | ||
| 279 | { NET_IPV4_NF_CONNTRACK_LOG_INVALID, "ip_conntrack_log_invalid" }, | ||
| 280 | { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS, "ip_conntrack_tcp_timeout_max_retrans" }, | ||
| 281 | { NET_IPV4_NF_CONNTRACK_TCP_LOOSE, "ip_conntrack_tcp_loose" }, | ||
| 282 | { NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL, "ip_conntrack_tcp_be_liberal" }, | ||
| 283 | { NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS, "ip_conntrack_tcp_max_retrans" }, | ||
| 284 | |||
| 285 | { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED, "ip_conntrack_sctp_timeout_closed" }, | ||
| 286 | { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT, "ip_conntrack_sctp_timeout_cookie_wait" }, | ||
| 287 | { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED, "ip_conntrack_sctp_timeout_cookie_echoed" }, | ||
| 288 | { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED, "ip_conntrack_sctp_timeout_established" }, | ||
| 289 | { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT, "ip_conntrack_sctp_timeout_shutdown_sent" }, | ||
| 290 | { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD, "ip_conntrack_sctp_timeout_shutdown_recd" }, | ||
| 291 | { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT, "ip_conntrack_sctp_timeout_shutdown_ack_sent" }, | ||
| 292 | |||
| 293 | { NET_IPV4_NF_CONNTRACK_COUNT, "ip_conntrack_count" }, | ||
| 294 | { NET_IPV4_NF_CONNTRACK_CHECKSUM, "ip_conntrack_checksum" }, | ||
| 295 | {} | ||
| 296 | }; | ||
| 297 | |||
| 298 | static const struct trans_ctl_table trans_net_ipv4_table[] = { | ||
| 299 | { NET_IPV4_FORWARD, "ip_forward" }, | ||
| 300 | { NET_IPV4_DYNADDR, "ip_dynaddr" }, | ||
| 301 | |||
| 302 | { NET_IPV4_CONF, "conf", trans_net_ipv4_conf_table }, | ||
| 303 | { NET_IPV4_NEIGH, "neigh", trans_net_neigh_table }, | ||
| 304 | { NET_IPV4_ROUTE, "route", trans_net_ipv4_route_table }, | ||
| 305 | /* NET_IPV4_FIB_HASH unused */ | ||
| 306 | { NET_IPV4_NETFILTER, "netfilter", trans_net_ipv4_netfilter_table }, | ||
| 307 | |||
| 308 | { NET_IPV4_TCP_TIMESTAMPS, "tcp_timestamps" }, | ||
| 309 | { NET_IPV4_TCP_WINDOW_SCALING, "tcp_window_scaling" }, | ||
| 310 | { NET_IPV4_TCP_SACK, "tcp_sack" }, | ||
| 311 | { NET_IPV4_TCP_RETRANS_COLLAPSE, "tcp_retrans_collapse" }, | ||
| 312 | { NET_IPV4_DEFAULT_TTL, "ip_default_ttl" }, | ||
| 313 | /* NET_IPV4_AUTOCONFIG unused */ | ||
| 314 | { NET_IPV4_NO_PMTU_DISC, "ip_no_pmtu_disc" }, | ||
| 315 | { NET_IPV4_TCP_SYN_RETRIES, "tcp_syn_retries" }, | ||
| 316 | { NET_IPV4_IPFRAG_HIGH_THRESH, "ipfrag_high_thresh" }, | ||
| 317 | { NET_IPV4_IPFRAG_LOW_THRESH, "ipfrag_low_thresh" }, | ||
| 318 | { NET_IPV4_IPFRAG_TIME, "ipfrag_time" }, | ||
| 319 | /* NET_IPV4_TCP_MAX_KA_PROBES unused */ | ||
| 320 | { NET_IPV4_TCP_KEEPALIVE_TIME, "tcp_keepalive_time" }, | ||
| 321 | { NET_IPV4_TCP_KEEPALIVE_PROBES, "tcp_keepalive_probes" }, | ||
| 322 | { NET_IPV4_TCP_RETRIES1, "tcp_retries1" }, | ||
| 323 | { NET_IPV4_TCP_RETRIES2, "tcp_retries2" }, | ||
| 324 | { NET_IPV4_TCP_FIN_TIMEOUT, "tcp_fin_timeout" }, | ||
| 325 | /* NET_IPV4_IP_MASQ_DEBUG unused */ | ||
| 326 | { NET_TCP_SYNCOOKIES, "tcp_syncookies" }, | ||
| 327 | { NET_TCP_STDURG, "tcp_stdurg" }, | ||
| 328 | { NET_TCP_RFC1337, "tcp_rfc1337" }, | ||
| 329 | /* NET_TCP_SYN_TAILDROP unused */ | ||
| 330 | { NET_TCP_MAX_SYN_BACKLOG, "tcp_max_syn_backlog" }, | ||
| 331 | { NET_IPV4_LOCAL_PORT_RANGE, "ip_local_port_range" }, | ||
| 332 | { NET_IPV4_ICMP_ECHO_IGNORE_ALL, "icmp_echo_ignore_all" }, | ||
| 333 | { NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS, "icmp_echo_ignore_broadcasts" }, | ||
| 334 | /* NET_IPV4_ICMP_SOURCEQUENCH_RATE unused */ | ||
| 335 | /* NET_IPV4_ICMP_DESTUNREACH_RATE unused */ | ||
| 336 | /* NET_IPV4_ICMP_TIMEEXCEED_RATE unused */ | ||
| 337 | /* NET_IPV4_ICMP_PARAMPROB_RATE unused */ | ||
| 338 | /* NET_IPV4_ICMP_ECHOREPLY_RATE unused */ | ||
| 339 | { NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES, "icmp_ignore_bogus_error_responses" }, | ||
| 340 | { NET_IPV4_IGMP_MAX_MEMBERSHIPS, "igmp_max_memberships" }, | ||
| 341 | { NET_TCP_TW_RECYCLE, "tcp_tw_recycle" }, | ||
| 342 | /* NET_IPV4_ALWAYS_DEFRAG unused */ | ||
| 343 | { NET_IPV4_TCP_KEEPALIVE_INTVL, "tcp_keepalive_intvl" }, | ||
| 344 | { NET_IPV4_INET_PEER_THRESHOLD, "inet_peer_threshold" }, | ||
| 345 | { NET_IPV4_INET_PEER_MINTTL, "inet_peer_minttl" }, | ||
| 346 | { NET_IPV4_INET_PEER_MAXTTL, "inet_peer_maxttl" }, | ||
| 347 | { NET_IPV4_INET_PEER_GC_MINTIME, "inet_peer_gc_mintime" }, | ||
| 348 | { NET_IPV4_INET_PEER_GC_MAXTIME, "inet_peer_gc_maxtime" }, | ||
| 349 | { NET_TCP_ORPHAN_RETRIES, "tcp_orphan_retries" }, | ||
| 350 | { NET_TCP_ABORT_ON_OVERFLOW, "tcp_abort_on_overflow" }, | ||
| 351 | { NET_TCP_SYNACK_RETRIES, "tcp_synack_retries" }, | ||
| 352 | { NET_TCP_MAX_ORPHANS, "tcp_max_orphans" }, | ||
| 353 | { NET_TCP_MAX_TW_BUCKETS, "tcp_max_tw_buckets" }, | ||
| 354 | { NET_TCP_FACK, "tcp_fack" }, | ||
| 355 | { NET_TCP_REORDERING, "tcp_reordering" }, | ||
| 356 | { NET_TCP_ECN, "tcp_ecn" }, | ||
| 357 | { NET_TCP_DSACK, "tcp_dsack" }, | ||
| 358 | { NET_TCP_MEM, "tcp_mem" }, | ||
| 359 | { NET_TCP_WMEM, "tcp_wmem" }, | ||
| 360 | { NET_TCP_RMEM, "tcp_rmem" }, | ||
| 361 | { NET_TCP_APP_WIN, "tcp_app_win" }, | ||
| 362 | { NET_TCP_ADV_WIN_SCALE, "tcp_adv_win_scale" }, | ||
| 363 | { NET_IPV4_NONLOCAL_BIND, "ip_nonlocal_bind" }, | ||
| 364 | { NET_IPV4_ICMP_RATELIMIT, "icmp_ratelimit" }, | ||
| 365 | { NET_IPV4_ICMP_RATEMASK, "icmp_ratemask" }, | ||
| 366 | { NET_TCP_TW_REUSE, "tcp_tw_reuse" }, | ||
| 367 | { NET_TCP_FRTO, "tcp_frto" }, | ||
| 368 | { NET_TCP_LOW_LATENCY, "tcp_low_latency" }, | ||
| 369 | { NET_IPV4_IPFRAG_SECRET_INTERVAL, "ipfrag_secret_interval" }, | ||
| 370 | { NET_IPV4_IGMP_MAX_MSF, "igmp_max_msf" }, | ||
| 371 | { NET_TCP_NO_METRICS_SAVE, "tcp_no_metrics_save" }, | ||
| 372 | /* NET_TCP_DEFAULT_WIN_SCALE unused */ | ||
| 373 | { NET_TCP_MODERATE_RCVBUF, "tcp_moderate_rcvbuf" }, | ||
| 374 | { NET_TCP_TSO_WIN_DIVISOR, "tcp_tso_win_divisor" }, | ||
| 375 | /* NET_TCP_BIC_BETA unused */ | ||
| 376 | { NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR, "icmp_errors_use_inbound_ifaddr" }, | ||
| 377 | { NET_TCP_CONG_CONTROL, "tcp_congestion_control" }, | ||
| 378 | { NET_TCP_ABC, "tcp_abc" }, | ||
| 379 | { NET_IPV4_IPFRAG_MAX_DIST, "ipfrag_max_dist" }, | ||
| 380 | { NET_TCP_MTU_PROBING, "tcp_mtu_probing" }, | ||
| 381 | { NET_TCP_BASE_MSS, "tcp_base_mss" }, | ||
| 382 | { NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS, "tcp_workaround_signed_windows" }, | ||
| 383 | { NET_TCP_DMA_COPYBREAK, "tcp_dma_copybreak" }, | ||
| 384 | { NET_TCP_SLOW_START_AFTER_IDLE, "tcp_slow_start_after_idle" }, | ||
| 385 | { NET_CIPSOV4_CACHE_ENABLE, "cipso_cache_enable" }, | ||
| 386 | { NET_CIPSOV4_CACHE_BUCKET_SIZE, "cipso_cache_bucket_size" }, | ||
| 387 | { NET_CIPSOV4_RBM_OPTFMT, "cipso_rbm_optfmt" }, | ||
| 388 | { NET_CIPSOV4_RBM_STRICTVALID, "cipso_rbm_strictvalid" }, | ||
| 389 | { NET_TCP_AVAIL_CONG_CONTROL, "tcp_available_congestion_control" }, | ||
| 390 | { NET_TCP_ALLOWED_CONG_CONTROL, "tcp_allowed_congestion_control" }, | ||
| 391 | { NET_TCP_MAX_SSTHRESH, "tcp_max_ssthresh" }, | ||
| 392 | { NET_TCP_FRTO_RESPONSE, "tcp_frto_response" }, | ||
| 393 | { 2088 /* NET_IPQ_QMAX */, "ip_queue_maxlen" }, | ||
| 394 | {} | ||
| 395 | }; | ||
| 396 | |||
| 397 | static const struct trans_ctl_table trans_net_ipx_table[] = { | ||
| 398 | { NET_IPX_PPROP_BROADCASTING, "ipx_pprop_broadcasting" }, | ||
| 399 | /* NET_IPX_FORWARDING unused */ | ||
| 400 | {} | ||
| 401 | }; | ||
| 402 | |||
| 403 | static const struct trans_ctl_table trans_net_atalk_table[] = { | ||
| 404 | { NET_ATALK_AARP_EXPIRY_TIME, "aarp-expiry-time" }, | ||
| 405 | { NET_ATALK_AARP_TICK_TIME, "aarp-tick-time" }, | ||
| 406 | { NET_ATALK_AARP_RETRANSMIT_LIMIT, "aarp-retransmit-limit" }, | ||
| 407 | { NET_ATALK_AARP_RESOLVE_TIME, "aarp-resolve-time" }, | ||
| 408 | {}, | ||
| 409 | }; | ||
| 410 | |||
| 411 | static const struct trans_ctl_table trans_net_netrom_table[] = { | ||
| 412 | { NET_NETROM_DEFAULT_PATH_QUALITY, "default_path_quality" }, | ||
| 413 | { NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER, "obsolescence_count_initialiser" }, | ||
| 414 | { NET_NETROM_NETWORK_TTL_INITIALISER, "network_ttl_initialiser" }, | ||
| 415 | { NET_NETROM_TRANSPORT_TIMEOUT, "transport_timeout" }, | ||
| 416 | { NET_NETROM_TRANSPORT_MAXIMUM_TRIES, "transport_maximum_tries" }, | ||
| 417 | { NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY, "transport_acknowledge_delay" }, | ||
| 418 | { NET_NETROM_TRANSPORT_BUSY_DELAY, "transport_busy_delay" }, | ||
| 419 | { NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE, "transport_requested_window_size" }, | ||
| 420 | { NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT, "transport_no_activity_timeout" }, | ||
| 421 | { NET_NETROM_ROUTING_CONTROL, "routing_control" }, | ||
| 422 | { NET_NETROM_LINK_FAILS_COUNT, "link_fails_count" }, | ||
| 423 | { NET_NETROM_RESET, "reset" }, | ||
| 424 | {} | ||
| 425 | }; | ||
| 426 | |||
| 427 | static const struct trans_ctl_table trans_net_ax25_param_table[] = { | ||
| 428 | { NET_AX25_IP_DEFAULT_MODE, "ip_default_mode" }, | ||
| 429 | { NET_AX25_DEFAULT_MODE, "ax25_default_mode" }, | ||
| 430 | { NET_AX25_BACKOFF_TYPE, "backoff_type" }, | ||
| 431 | { NET_AX25_CONNECT_MODE, "connect_mode" }, | ||
| 432 | { NET_AX25_STANDARD_WINDOW, "standard_window_size" }, | ||
| 433 | { NET_AX25_EXTENDED_WINDOW, "extended_window_size" }, | ||
| 434 | { NET_AX25_T1_TIMEOUT, "t1_timeout" }, | ||
| 435 | { NET_AX25_T2_TIMEOUT, "t2_timeout" }, | ||
| 436 | { NET_AX25_T3_TIMEOUT, "t3_timeout" }, | ||
| 437 | { NET_AX25_IDLE_TIMEOUT, "idle_timeout" }, | ||
| 438 | { NET_AX25_N2, "maximum_retry_count" }, | ||
| 439 | { NET_AX25_PACLEN, "maximum_packet_length" }, | ||
| 440 | { NET_AX25_PROTOCOL, "protocol" }, | ||
| 441 | { NET_AX25_DAMA_SLAVE_TIMEOUT, "dama_slave_timeout" }, | ||
| 442 | {} | ||
| 443 | }; | ||
| 444 | |||
| 445 | static const struct trans_ctl_table trans_net_ax25_table[] = { | ||
| 446 | { 0, NULL, trans_net_ax25_param_table }, | ||
| 447 | {} | ||
| 448 | }; | ||
| 449 | |||
| 450 | static const struct trans_ctl_table trans_net_bridge_table[] = { | ||
| 451 | { NET_BRIDGE_NF_CALL_ARPTABLES, "bridge-nf-call-arptables" }, | ||
| 452 | { NET_BRIDGE_NF_CALL_IPTABLES, "bridge-nf-call-iptables" }, | ||
| 453 | { NET_BRIDGE_NF_CALL_IP6TABLES, "bridge-nf-call-ip6tables" }, | ||
| 454 | { NET_BRIDGE_NF_FILTER_VLAN_TAGGED, "bridge-nf-filter-vlan-tagged" }, | ||
| 455 | { NET_BRIDGE_NF_FILTER_PPPOE_TAGGED, "bridge-nf-filter-pppoe-tagged" }, | ||
| 456 | {} | ||
| 457 | }; | ||
| 458 | |||
| 459 | static const struct trans_ctl_table trans_net_rose_table[] = { | ||
| 460 | { NET_ROSE_RESTART_REQUEST_TIMEOUT, "restart_request_timeout" }, | ||
| 461 | { NET_ROSE_CALL_REQUEST_TIMEOUT, "call_request_timeout" }, | ||
| 462 | { NET_ROSE_RESET_REQUEST_TIMEOUT, "reset_request_timeout" }, | ||
| 463 | { NET_ROSE_CLEAR_REQUEST_TIMEOUT, "clear_request_timeout" }, | ||
| 464 | { NET_ROSE_ACK_HOLD_BACK_TIMEOUT, "acknowledge_hold_back_timeout" }, | ||
| 465 | { NET_ROSE_ROUTING_CONTROL, "routing_control" }, | ||
| 466 | { NET_ROSE_LINK_FAIL_TIMEOUT, "link_fail_timeout" }, | ||
| 467 | { NET_ROSE_MAX_VCS, "maximum_virtual_circuits" }, | ||
| 468 | { NET_ROSE_WINDOW_SIZE, "window_size" }, | ||
| 469 | { NET_ROSE_NO_ACTIVITY_TIMEOUT, "no_activity_timeout" }, | ||
| 470 | {} | ||
| 471 | }; | ||
| 472 | |||
| 473 | static const struct trans_ctl_table trans_net_ipv6_conf_var_table[] = { | ||
| 474 | { NET_IPV6_FORWARDING, "forwarding" }, | ||
| 475 | { NET_IPV6_HOP_LIMIT, "hop_limit" }, | ||
| 476 | { NET_IPV6_MTU, "mtu" }, | ||
| 477 | { NET_IPV6_ACCEPT_RA, "accept_ra" }, | ||
| 478 | { NET_IPV6_ACCEPT_REDIRECTS, "accept_redirects" }, | ||
| 479 | { NET_IPV6_AUTOCONF, "autoconf" }, | ||
| 480 | { NET_IPV6_DAD_TRANSMITS, "dad_transmits" }, | ||
| 481 | { NET_IPV6_RTR_SOLICITS, "router_solicitations" }, | ||
| 482 | { NET_IPV6_RTR_SOLICIT_INTERVAL, "router_solicitation_interval" }, | ||
| 483 | { NET_IPV6_RTR_SOLICIT_DELAY, "router_solicitation_delay" }, | ||
| 484 | { NET_IPV6_USE_TEMPADDR, "use_tempaddr" }, | ||
| 485 | { NET_IPV6_TEMP_VALID_LFT, "temp_valid_lft" }, | ||
| 486 | { NET_IPV6_TEMP_PREFERED_LFT, "temp_prefered_lft" }, | ||
| 487 | { NET_IPV6_REGEN_MAX_RETRY, "regen_max_retry" }, | ||
| 488 | { NET_IPV6_MAX_DESYNC_FACTOR, "max_desync_factor" }, | ||
| 489 | { NET_IPV6_MAX_ADDRESSES, "max_addresses" }, | ||
| 490 | { NET_IPV6_FORCE_MLD_VERSION, "force_mld_version" }, | ||
| 491 | { NET_IPV6_ACCEPT_RA_DEFRTR, "accept_ra_defrtr" }, | ||
| 492 | { NET_IPV6_ACCEPT_RA_PINFO, "accept_ra_pinfo" }, | ||
| 493 | { NET_IPV6_ACCEPT_RA_RTR_PREF, "accept_ra_rtr_pref" }, | ||
| 494 | { NET_IPV6_RTR_PROBE_INTERVAL, "router_probe_interval" }, | ||
| 495 | { NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN, "accept_ra_rt_info_max_plen" }, | ||
| 496 | { NET_IPV6_PROXY_NDP, "proxy_ndp" }, | ||
| 497 | { NET_IPV6_ACCEPT_SOURCE_ROUTE, "accept_source_route" }, | ||
| 498 | {} | ||
| 499 | }; | ||
| 500 | |||
| 501 | static const struct trans_ctl_table trans_net_ipv6_conf_table[] = { | ||
| 502 | { NET_PROTO_CONF_ALL, "all", trans_net_ipv6_conf_var_table }, | ||
| 503 | { NET_PROTO_CONF_DEFAULT, "default", trans_net_ipv6_conf_var_table }, | ||
| 504 | { 0, NULL, trans_net_ipv6_conf_var_table }, | ||
| 505 | {} | ||
| 506 | }; | ||
| 507 | |||
| 508 | static const struct trans_ctl_table trans_net_ipv6_route_table[] = { | ||
| 509 | { NET_IPV6_ROUTE_FLUSH, "flush" }, | ||
| 510 | { NET_IPV6_ROUTE_GC_THRESH, "gc_thresh" }, | ||
| 511 | { NET_IPV6_ROUTE_MAX_SIZE, "max_size" }, | ||
| 512 | { NET_IPV6_ROUTE_GC_MIN_INTERVAL, "gc_min_interval" }, | ||
| 513 | { NET_IPV6_ROUTE_GC_TIMEOUT, "gc_timeout" }, | ||
| 514 | { NET_IPV6_ROUTE_GC_INTERVAL, "gc_interval" }, | ||
| 515 | { NET_IPV6_ROUTE_GC_ELASTICITY, "gc_elasticity" }, | ||
| 516 | { NET_IPV6_ROUTE_MTU_EXPIRES, "mtu_expires" }, | ||
| 517 | { NET_IPV6_ROUTE_MIN_ADVMSS, "min_adv_mss" }, | ||
| 518 | { NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS, "gc_min_interval_ms" }, | ||
| 519 | {} | ||
| 520 | }; | ||
| 521 | |||
| 522 | static const struct trans_ctl_table trans_net_ipv6_icmp_table[] = { | ||
| 523 | { NET_IPV6_ICMP_RATELIMIT, "ratelimit" }, | ||
| 524 | {} | ||
| 525 | }; | ||
| 526 | |||
| 527 | static const struct trans_ctl_table trans_net_ipv6_table[] = { | ||
| 528 | { NET_IPV6_CONF, "conf", trans_net_ipv6_conf_table }, | ||
| 529 | { NET_IPV6_NEIGH, "neigh", trans_net_neigh_table }, | ||
| 530 | { NET_IPV6_ROUTE, "route", trans_net_ipv6_route_table }, | ||
| 531 | { NET_IPV6_ICMP, "icmp", trans_net_ipv6_icmp_table }, | ||
| 532 | { NET_IPV6_BINDV6ONLY, "bindv6only" }, | ||
| 533 | { NET_IPV6_IP6FRAG_HIGH_THRESH, "ip6frag_high_thresh" }, | ||
| 534 | { NET_IPV6_IP6FRAG_LOW_THRESH, "ip6frag_low_thresh" }, | ||
| 535 | { NET_IPV6_IP6FRAG_TIME, "ip6frag_time" }, | ||
| 536 | { NET_IPV6_IP6FRAG_SECRET_INTERVAL, "ip6frag_secret_interval" }, | ||
| 537 | { NET_IPV6_MLD_MAX_MSF, "mld_max_msf" }, | ||
| 538 | { 2088 /* IPQ_QMAX */, "ip6_queue_maxlen" }, | ||
| 539 | {} | ||
| 540 | }; | ||
| 541 | |||
| 542 | static const struct trans_ctl_table trans_net_x25_table[] = { | ||
| 543 | { NET_X25_RESTART_REQUEST_TIMEOUT, "restart_request_timeout" }, | ||
| 544 | { NET_X25_CALL_REQUEST_TIMEOUT, "call_request_timeout" }, | ||
| 545 | { NET_X25_RESET_REQUEST_TIMEOUT, "reset_request_timeout" }, | ||
| 546 | { NET_X25_CLEAR_REQUEST_TIMEOUT, "clear_request_timeout" }, | ||
| 547 | { NET_X25_ACK_HOLD_BACK_TIMEOUT, "acknowledgement_hold_back_timeout" }, | ||
| 548 | { NET_X25_FORWARD, "x25_forward" }, | ||
| 549 | {} | ||
| 550 | }; | ||
| 551 | |||
| 552 | static const struct trans_ctl_table trans_net_tr_table[] = { | ||
| 553 | { NET_TR_RIF_TIMEOUT, "rif_timeout" }, | ||
| 554 | {} | ||
| 555 | }; | ||
| 556 | |||
| 557 | |||
| 558 | static const struct trans_ctl_table trans_net_decnet_conf_vars[] = { | ||
| 559 | { NET_DECNET_CONF_DEV_FORWARDING, "forwarding" }, | ||
| 560 | { NET_DECNET_CONF_DEV_PRIORITY, "priority" }, | ||
| 561 | { NET_DECNET_CONF_DEV_T2, "t2" }, | ||
| 562 | { NET_DECNET_CONF_DEV_T3, "t3" }, | ||
| 563 | {} | ||
| 564 | }; | ||
| 565 | |||
| 566 | static const struct trans_ctl_table trans_net_decnet_conf[] = { | ||
| 567 | { 0, NULL, trans_net_decnet_conf_vars }, | ||
| 568 | {} | ||
| 569 | }; | ||
| 570 | |||
| 571 | static const struct trans_ctl_table trans_net_decnet_table[] = { | ||
| 572 | { NET_DECNET_CONF, "conf", trans_net_decnet_conf }, | ||
| 573 | { NET_DECNET_NODE_ADDRESS, "node_address" }, | ||
| 574 | { NET_DECNET_NODE_NAME, "node_name" }, | ||
| 575 | { NET_DECNET_DEFAULT_DEVICE, "default_device" }, | ||
| 576 | { NET_DECNET_TIME_WAIT, "time_wait" }, | ||
| 577 | { NET_DECNET_DN_COUNT, "dn_count" }, | ||
| 578 | { NET_DECNET_DI_COUNT, "di_count" }, | ||
| 579 | { NET_DECNET_DR_COUNT, "dr_count" }, | ||
| 580 | { NET_DECNET_DST_GC_INTERVAL, "dst_gc_interval" }, | ||
| 581 | { NET_DECNET_NO_FC_MAX_CWND, "no_fc_max_cwnd" }, | ||
| 582 | { NET_DECNET_MEM, "decnet_mem" }, | ||
| 583 | { NET_DECNET_RMEM, "decnet_rmem" }, | ||
| 584 | { NET_DECNET_WMEM, "decnet_wmem" }, | ||
| 585 | { NET_DECNET_DEBUG_LEVEL, "debug" }, | ||
| 586 | {} | ||
| 587 | }; | ||
| 588 | |||
| 589 | static const struct trans_ctl_table trans_net_sctp_table[] = { | ||
| 590 | { NET_SCTP_RTO_INITIAL, "rto_initial" }, | ||
| 591 | { NET_SCTP_RTO_MIN, "rto_min" }, | ||
| 592 | { NET_SCTP_RTO_MAX, "rto_max" }, | ||
| 593 | { NET_SCTP_RTO_ALPHA, "rto_alpha_exp_divisor" }, | ||
| 594 | { NET_SCTP_RTO_BETA, "rto_beta_exp_divisor" }, | ||
| 595 | { NET_SCTP_VALID_COOKIE_LIFE, "valid_cookie_life" }, | ||
| 596 | { NET_SCTP_ASSOCIATION_MAX_RETRANS, "association_max_retrans" }, | ||
| 597 | { NET_SCTP_PATH_MAX_RETRANS, "path_max_retrans" }, | ||
| 598 | { NET_SCTP_MAX_INIT_RETRANSMITS, "max_init_retransmits" }, | ||
| 599 | { NET_SCTP_HB_INTERVAL, "hb_interval" }, | ||
| 600 | { NET_SCTP_PRESERVE_ENABLE, "cookie_preserve_enable" }, | ||
| 601 | { NET_SCTP_MAX_BURST, "max_burst" }, | ||
| 602 | { NET_SCTP_ADDIP_ENABLE, "addip_enable" }, | ||
| 603 | { NET_SCTP_PRSCTP_ENABLE, "prsctp_enable" }, | ||
| 604 | { NET_SCTP_SNDBUF_POLICY, "sndbuf_policy" }, | ||
| 605 | { NET_SCTP_SACK_TIMEOUT, "sack_timeout" }, | ||
| 606 | { NET_SCTP_RCVBUF_POLICY, "rcvbuf_policy" }, | ||
| 607 | {} | ||
| 608 | }; | ||
| 609 | |||
| 610 | static const struct trans_ctl_table trans_net_llc_llc2_timeout_table[] = { | ||
| 611 | { NET_LLC2_ACK_TIMEOUT, "ack" }, | ||
| 612 | { NET_LLC2_P_TIMEOUT, "p" }, | ||
| 613 | { NET_LLC2_REJ_TIMEOUT, "rej" }, | ||
| 614 | { NET_LLC2_BUSY_TIMEOUT, "busy" }, | ||
| 615 | {} | ||
| 616 | }; | ||
| 617 | |||
| 618 | static const struct trans_ctl_table trans_net_llc_station_table[] = { | ||
| 619 | { NET_LLC_STATION_ACK_TIMEOUT, "ack_timeout" }, | ||
| 620 | {} | ||
| 621 | }; | ||
| 622 | |||
| 623 | static const struct trans_ctl_table trans_net_llc_llc2_table[] = { | ||
| 624 | { NET_LLC2, "timeout", trans_net_llc_llc2_timeout_table }, | ||
| 625 | {} | ||
| 626 | }; | ||
| 627 | |||
| 628 | static const struct trans_ctl_table trans_net_llc_table[] = { | ||
| 629 | { NET_LLC2, "llc2", trans_net_llc_llc2_table }, | ||
| 630 | { NET_LLC_STATION, "station", trans_net_llc_station_table }, | ||
| 631 | {} | ||
| 632 | }; | ||
| 633 | |||
| 634 | static const struct trans_ctl_table trans_net_netfilter_table[] = { | ||
| 635 | { NET_NF_CONNTRACK_MAX, "nf_conntrack_max" }, | ||
| 636 | { NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT, "nf_conntrack_tcp_timeout_syn_sent" }, | ||
| 637 | { NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV, "nf_conntrack_tcp_timeout_syn_recv" }, | ||
| 638 | { NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED, "nf_conntrack_tcp_timeout_established" }, | ||
| 639 | { NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT, "nf_conntrack_tcp_timeout_fin_wait" }, | ||
| 640 | { NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT, "nf_conntrack_tcp_timeout_close_wait" }, | ||
| 641 | { NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK, "nf_conntrack_tcp_timeout_last_ack" }, | ||
| 642 | { NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT, "nf_conntrack_tcp_timeout_time_wait" }, | ||
| 643 | { NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE, "nf_conntrack_tcp_timeout_close" }, | ||
| 644 | { NET_NF_CONNTRACK_UDP_TIMEOUT, "nf_conntrack_udp_timeout" }, | ||
| 645 | { NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM, "nf_conntrack_udp_timeout_stream" }, | ||
| 646 | { NET_NF_CONNTRACK_ICMP_TIMEOUT, "nf_conntrack_icmp_timeout" }, | ||
| 647 | { NET_NF_CONNTRACK_GENERIC_TIMEOUT, "nf_conntrack_generic_timeout" }, | ||
| 648 | { NET_NF_CONNTRACK_BUCKETS, "nf_conntrack_buckets" }, | ||
| 649 | { NET_NF_CONNTRACK_LOG_INVALID, "nf_conntrack_log_invalid" }, | ||
| 650 | { NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS, "nf_conntrack_tcp_timeout_max_retrans" }, | ||
| 651 | { NET_NF_CONNTRACK_TCP_LOOSE, "nf_conntrack_tcp_loose" }, | ||
| 652 | { NET_NF_CONNTRACK_TCP_BE_LIBERAL, "nf_conntrack_tcp_be_liberal" }, | ||
| 653 | { NET_NF_CONNTRACK_TCP_MAX_RETRANS, "nf_conntrack_tcp_max_retrans" }, | ||
| 654 | { NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED, "nf_conntrack_sctp_timeout_closed" }, | ||
| 655 | { NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT, "nf_conntrack_sctp_timeout_cookie_wait" }, | ||
| 656 | { NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED, "nf_conntrack_sctp_timeout_cookie_echoed" }, | ||
| 657 | { NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED, "nf_conntrack_sctp_timeout_established" }, | ||
| 658 | { NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT, "nf_conntrack_sctp_timeout_shutdown_sent" }, | ||
| 659 | { NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD, "nf_conntrack_sctp_timeout_shutdown_recd" }, | ||
| 660 | { NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT, "nf_conntrack_sctp_timeout_shutdown_ack_sent" }, | ||
| 661 | { NET_NF_CONNTRACK_COUNT, "nf_conntrack_count" }, | ||
| 662 | { NET_NF_CONNTRACK_ICMPV6_TIMEOUT, "nf_conntrack_icmpv6_timeout" }, | ||
| 663 | { NET_NF_CONNTRACK_FRAG6_TIMEOUT, "nf_conntrack_frag6_timeout" }, | ||
| 664 | { NET_NF_CONNTRACK_FRAG6_LOW_THRESH, "nf_conntrack_frag6_low_thresh" }, | ||
| 665 | { NET_NF_CONNTRACK_FRAG6_HIGH_THRESH, "nf_conntrack_frag6_high_thresh" }, | ||
| 666 | { NET_NF_CONNTRACK_CHECKSUM, "nf_conntrack_checksum" }, | ||
| 667 | |||
| 668 | {} | ||
| 669 | }; | ||
| 670 | |||
| 671 | static const struct trans_ctl_table trans_net_dccp_table[] = { | ||
| 672 | { NET_DCCP_DEFAULT, "default" }, | ||
| 673 | {} | ||
| 674 | }; | ||
| 675 | |||
| 676 | static const struct trans_ctl_table trans_net_irda_table[] = { | ||
| 677 | { NET_IRDA_DISCOVERY, "discovery" }, | ||
| 678 | { NET_IRDA_DEVNAME, "devname" }, | ||
| 679 | { NET_IRDA_DEBUG, "debug" }, | ||
| 680 | { NET_IRDA_FAST_POLL, "fast_poll_increase" }, | ||
| 681 | { NET_IRDA_DISCOVERY_SLOTS, "discovery_slots" }, | ||
| 682 | { NET_IRDA_DISCOVERY_TIMEOUT, "discovery_timeout" }, | ||
| 683 | { NET_IRDA_SLOT_TIMEOUT, "slot_timeout" }, | ||
| 684 | { NET_IRDA_MAX_BAUD_RATE, "max_baud_rate" }, | ||
| 685 | { NET_IRDA_MIN_TX_TURN_TIME, "min_tx_turn_time" }, | ||
| 686 | { NET_IRDA_MAX_TX_DATA_SIZE, "max_tx_data_size" }, | ||
| 687 | { NET_IRDA_MAX_TX_WINDOW, "max_tx_window" }, | ||
| 688 | { NET_IRDA_MAX_NOREPLY_TIME, "max_noreply_time" }, | ||
| 689 | { NET_IRDA_WARN_NOREPLY_TIME, "warn_noreply_time" }, | ||
| 690 | { NET_IRDA_LAP_KEEPALIVE_TIME, "lap_keepalive_time" }, | ||
| 691 | {} | ||
| 692 | }; | ||
| 693 | |||
| 694 | static const struct trans_ctl_table trans_net_table[] = { | ||
| 695 | { NET_CORE, "core", trans_net_core_table }, | ||
| 696 | /* NET_ETHER not used */ | ||
| 697 | /* NET_802 not used */ | ||
| 698 | { NET_UNIX, "unix", trans_net_unix_table }, | ||
| 699 | { NET_IPV4, "ipv4", trans_net_ipv4_table }, | ||
| 700 | { NET_IPX, "ipx", trans_net_ipx_table }, | ||
| 701 | { NET_ATALK, "appletalk", trans_net_atalk_table }, | ||
| 702 | { NET_NETROM, "netrom", trans_net_netrom_table }, | ||
| 703 | { NET_AX25, "ax25", trans_net_ax25_table }, | ||
| 704 | { NET_BRIDGE, "bridge", trans_net_bridge_table }, | ||
| 705 | { NET_ROSE, "rose", trans_net_rose_table }, | ||
| 706 | { NET_IPV6, "ipv6", trans_net_ipv6_table }, | ||
| 707 | { NET_X25, "x25", trans_net_x25_table }, | ||
| 708 | { NET_TR, "token-ring", trans_net_tr_table }, | ||
| 709 | { NET_DECNET, "decnet", trans_net_decnet_table }, | ||
| 710 | /* NET_ECONET not used */ | ||
| 711 | { NET_SCTP, "sctp", trans_net_sctp_table }, | ||
| 712 | { NET_LLC, "llc", trans_net_llc_table }, | ||
| 713 | { NET_NETFILTER, "netfilter", trans_net_netfilter_table }, | ||
| 714 | { NET_DCCP, "dccp", trans_net_dccp_table }, | ||
| 715 | { NET_IRDA, "irda", trans_net_irda_table }, | ||
| 716 | { 2089, "nf_conntrack_max" }, | ||
| 717 | {} | ||
| 718 | }; | ||
| 719 | |||
| 720 | static const struct trans_ctl_table trans_fs_quota_table[] = { | ||
| 721 | { FS_DQ_LOOKUPS, "lookups" }, | ||
| 722 | { FS_DQ_DROPS, "drops" }, | ||
| 723 | { FS_DQ_READS, "reads" }, | ||
| 724 | { FS_DQ_WRITES, "writes" }, | ||
| 725 | { FS_DQ_CACHE_HITS, "cache_hits" }, | ||
| 726 | { FS_DQ_ALLOCATED, "allocated_dquots" }, | ||
| 727 | { FS_DQ_FREE, "free_dquots" }, | ||
| 728 | { FS_DQ_SYNCS, "syncs" }, | ||
| 729 | { FS_DQ_WARNINGS, "warnings" }, | ||
| 730 | {} | ||
| 731 | }; | ||
| 732 | |||
| 733 | static const struct trans_ctl_table trans_fs_xfs_table[] = { | ||
| 734 | { XFS_SGID_INHERIT, "irix_sgid_inherit" }, | ||
| 735 | { XFS_SYMLINK_MODE, "irix_symlink_mode" }, | ||
| 736 | { XFS_PANIC_MASK, "panic_mask" }, | ||
| 737 | |||
| 738 | { XFS_ERRLEVEL, "error_level" }, | ||
| 739 | { XFS_SYNCD_TIMER, "xfssyncd_centisecs" }, | ||
| 740 | { XFS_INHERIT_SYNC, "inherit_sync" }, | ||
| 741 | { XFS_INHERIT_NODUMP, "inherit_nodump" }, | ||
| 742 | { XFS_INHERIT_NOATIME, "inherit_noatime" }, | ||
| 743 | { XFS_BUF_TIMER, "xfsbufd_centisecs" }, | ||
| 744 | { XFS_BUF_AGE, "age_buffer_centisecs" }, | ||
| 745 | { XFS_INHERIT_NOSYM, "inherit_nosymlinks" }, | ||
| 746 | { XFS_ROTORSTEP, "rotorstep" }, | ||
| 747 | { XFS_INHERIT_NODFRG, "inherit_nodefrag" }, | ||
| 748 | { XFS_FILESTREAM_TIMER, "filestream_centisecs" }, | ||
| 749 | { XFS_STATS_CLEAR, "stats_clear" }, | ||
| 750 | {} | ||
| 751 | }; | ||
| 752 | |||
| 753 | static const struct trans_ctl_table trans_fs_ocfs2_nm_table[] = { | ||
| 754 | { 1, "hb_ctl_path" }, | ||
| 755 | {} | ||
| 756 | }; | ||
| 757 | |||
| 758 | static const struct trans_ctl_table trans_fs_ocfs2_table[] = { | ||
| 759 | { 1, "nm", trans_fs_ocfs2_nm_table }, | ||
| 760 | {} | ||
| 761 | }; | ||
| 762 | |||
| 763 | static const struct trans_ctl_table trans_inotify_table[] = { | ||
| 764 | { INOTIFY_MAX_USER_INSTANCES, "max_user_instances" }, | ||
| 765 | { INOTIFY_MAX_USER_WATCHES, "max_user_watches" }, | ||
| 766 | { INOTIFY_MAX_QUEUED_EVENTS, "max_queued_events" }, | ||
| 767 | {} | ||
| 768 | }; | ||
| 769 | |||
| 770 | static const struct trans_ctl_table trans_fs_table[] = { | ||
| 771 | { FS_NRINODE, "inode-nr" }, | ||
| 772 | { FS_STATINODE, "inode-state" }, | ||
| 773 | /* FS_MAXINODE unused */ | ||
| 774 | /* FS_NRDQUOT unused */ | ||
| 775 | /* FS_MAXDQUOT unused */ | ||
| 776 | { FS_NRFILE, "file-nr" }, | ||
| 777 | { FS_MAXFILE, "file-max" }, | ||
| 778 | { FS_DENTRY, "dentry-state" }, | ||
| 779 | /* FS_NRSUPER unused */ | ||
| 780 | /* FS_MAXUPSER unused */ | ||
| 781 | { FS_OVERFLOWUID, "overflowuid" }, | ||
| 782 | { FS_OVERFLOWGID, "overflowgid" }, | ||
| 783 | { FS_LEASES, "leases-enable" }, | ||
| 784 | { FS_DIR_NOTIFY, "dir-notify-enable" }, | ||
| 785 | { FS_LEASE_TIME, "lease-break-time" }, | ||
| 786 | { FS_DQSTATS, "quota", trans_fs_quota_table }, | ||
| 787 | { FS_XFS, "xfs", trans_fs_xfs_table }, | ||
| 788 | { FS_AIO_NR, "aio-nr" }, | ||
| 789 | { FS_AIO_MAX_NR, "aio-max-nr" }, | ||
| 790 | { FS_INOTIFY, "inotify", trans_inotify_table }, | ||
| 791 | { FS_OCFS2, "ocfs2", trans_fs_ocfs2_table }, | ||
| 792 | { KERN_SETUID_DUMPABLE, "suid_dumpable" }, | ||
| 793 | {} | ||
| 794 | }; | ||
| 795 | |||
| 796 | static const struct trans_ctl_table trans_debug_table[] = { | ||
| 797 | {} | ||
| 798 | }; | ||
| 799 | |||
| 800 | static const struct trans_ctl_table trans_cdrom_table[] = { | ||
| 801 | { DEV_CDROM_INFO, "info" }, | ||
| 802 | { DEV_CDROM_AUTOCLOSE, "autoclose" }, | ||
| 803 | { DEV_CDROM_AUTOEJECT, "autoeject" }, | ||
| 804 | { DEV_CDROM_DEBUG, "debug" }, | ||
| 805 | { DEV_CDROM_LOCK, "lock" }, | ||
| 806 | { DEV_CDROM_CHECK_MEDIA, "check_media" }, | ||
| 807 | {} | ||
| 808 | }; | ||
| 809 | |||
| 810 | static const struct trans_ctl_table trans_ipmi_table[] = { | ||
| 811 | { DEV_IPMI_POWEROFF_POWERCYCLE, "poweroff_powercycle" }, | ||
| 812 | {} | ||
| 813 | }; | ||
| 814 | |||
| 815 | static const struct trans_ctl_table trans_mac_hid_files[] = { | ||
| 816 | /* DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES unused */ | ||
| 817 | /* DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES unused */ | ||
| 818 | { DEV_MAC_HID_MOUSE_BUTTON_EMULATION, "mouse_button_emulation" }, | ||
| 819 | { DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE, "mouse_button2_keycode" }, | ||
| 820 | { DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE, "mouse_button3_keycode" }, | ||
| 821 | /* DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES unused */ | ||
| 822 | {} | ||
| 823 | }; | ||
| 824 | |||
| 825 | static const struct trans_ctl_table trans_raid_table[] = { | ||
| 826 | { DEV_RAID_SPEED_LIMIT_MIN, "speed_limit_min" }, | ||
| 827 | { DEV_RAID_SPEED_LIMIT_MAX, "speed_limit_max" }, | ||
| 828 | {} | ||
| 829 | }; | ||
| 830 | |||
| 831 | static const struct trans_ctl_table trans_scsi_table[] = { | ||
| 832 | { DEV_SCSI_LOGGING_LEVEL, "logging_level" }, | ||
| 833 | {} | ||
| 834 | }; | ||
| 835 | |||
| 836 | static const struct trans_ctl_table trans_parport_default_table[] = { | ||
| 837 | { DEV_PARPORT_DEFAULT_TIMESLICE, "timeslice" }, | ||
| 838 | { DEV_PARPORT_DEFAULT_SPINTIME, "spintime" }, | ||
| 839 | {} | ||
| 840 | }; | ||
| 841 | |||
| 842 | static const struct trans_ctl_table trans_parport_device_table[] = { | ||
| 843 | { DEV_PARPORT_DEVICE_TIMESLICE, "timeslice" }, | ||
| 844 | {} | ||
| 845 | }; | ||
| 846 | |||
| 847 | static const struct trans_ctl_table trans_parport_devices_table[] = { | ||
| 848 | { DEV_PARPORT_DEVICES_ACTIVE, "active" }, | ||
| 849 | { 0, NULL, trans_parport_device_table }, | ||
| 850 | {} | ||
| 851 | }; | ||
| 852 | |||
| 853 | static const struct trans_ctl_table trans_parport_parport_table[] = { | ||
| 854 | { DEV_PARPORT_SPINTIME, "spintime" }, | ||
| 855 | { DEV_PARPORT_BASE_ADDR, "base-addr" }, | ||
| 856 | { DEV_PARPORT_IRQ, "irq" }, | ||
| 857 | { DEV_PARPORT_DMA, "dma" }, | ||
| 858 | { DEV_PARPORT_MODES, "modes" }, | ||
| 859 | { DEV_PARPORT_DEVICES, "devices", trans_parport_devices_table }, | ||
| 860 | { DEV_PARPORT_AUTOPROBE, "autoprobe" }, | ||
| 861 | { DEV_PARPORT_AUTOPROBE + 1, "autoprobe0" }, | ||
| 862 | { DEV_PARPORT_AUTOPROBE + 2, "autoprobe1" }, | ||
| 863 | { DEV_PARPORT_AUTOPROBE + 3, "autoprobe2" }, | ||
| 864 | { DEV_PARPORT_AUTOPROBE + 4, "autoprobe3" }, | ||
| 865 | {} | ||
| 866 | }; | ||
| 867 | static const struct trans_ctl_table trans_parport_table[] = { | ||
| 868 | { DEV_PARPORT_DEFAULT, "default", trans_parport_default_table }, | ||
| 869 | { 0, NULL, trans_parport_parport_table }, | ||
| 870 | {} | ||
| 871 | }; | ||
| 872 | |||
| 873 | static const struct trans_ctl_table trans_dev_table[] = { | ||
| 874 | { DEV_CDROM, "cdrom", trans_cdrom_table }, | ||
| 875 | /* DEV_HWMON unused */ | ||
| 876 | { DEV_PARPORT, "parport", trans_parport_table }, | ||
| 877 | { DEV_RAID, "raid", trans_raid_table }, | ||
| 878 | { DEV_MAC_HID, "mac_hid", trans_mac_hid_files }, | ||
| 879 | { DEV_SCSI, "scsi", trans_scsi_table }, | ||
| 880 | { DEV_IPMI, "ipmi", trans_ipmi_table }, | ||
| 881 | {} | ||
| 882 | }; | ||
| 883 | |||
| 884 | static const struct trans_ctl_table trans_bus_isa_table[] = { | ||
| 885 | { BUS_ISA_MEM_BASE, "membase" }, | ||
| 886 | { BUS_ISA_PORT_BASE, "portbase" }, | ||
| 887 | { BUS_ISA_PORT_SHIFT, "portshift" }, | ||
| 888 | {} | ||
| 889 | }; | ||
| 890 | |||
| 891 | static const struct trans_ctl_table trans_bus_table[] = { | ||
| 892 | { CTL_BUS_ISA, "isa", trans_bus_isa_table }, | ||
| 893 | {} | ||
| 894 | }; | ||
| 895 | |||
| 896 | static const struct trans_ctl_table trans_arlan_conf_table0[] = { | ||
| 897 | { 1, "spreadingCode" }, | ||
| 898 | { 2, "channelNumber" }, | ||
| 899 | { 3, "scramblingDisable" }, | ||
| 900 | { 4, "txAttenuation" }, | ||
| 901 | { 5, "systemId" }, | ||
| 902 | { 6, "maxDatagramSize" }, | ||
| 903 | { 7, "maxFrameSize" }, | ||
| 904 | { 8, "maxRetries" }, | ||
| 905 | { 9, "receiveMode" }, | ||
| 906 | { 10, "priority" }, | ||
| 907 | { 11, "rootOrRepeater" }, | ||
| 908 | { 12, "SID" }, | ||
| 909 | { 13, "registrationMode" }, | ||
| 910 | { 14, "registrationFill" }, | ||
| 911 | { 15, "localTalkAddress" }, | ||
| 912 | { 16, "codeFormat" }, | ||
| 913 | { 17, "numChannels" }, | ||
| 914 | { 18, "channel1" }, | ||
| 915 | { 19, "channel2" }, | ||
| 916 | { 20, "channel3" }, | ||
| 917 | { 21, "channel4" }, | ||
| 918 | { 22, "txClear" }, | ||
| 919 | { 23, "txRetries" }, | ||
| 920 | { 24, "txRouting" }, | ||
| 921 | { 25, "txScrambled" }, | ||
| 922 | { 26, "rxParameter" }, | ||
| 923 | { 27, "txTimeoutMs" }, | ||
| 924 | { 28, "waitCardTimeout" }, | ||
| 925 | { 29, "channelSet" }, | ||
| 926 | { 30, "name" }, | ||
| 927 | { 31, "waitTime" }, | ||
| 928 | { 32, "lParameter" }, | ||
| 929 | { 33, "_15" }, | ||
| 930 | { 34, "headerSize" }, | ||
| 931 | { 36, "tx_delay_ms" }, | ||
| 932 | { 37, "retries" }, | ||
| 933 | { 38, "ReTransmitPacketMaxSize" }, | ||
| 934 | { 39, "waitReTransmitPacketMaxSize" }, | ||
| 935 | { 40, "fastReTransCount" }, | ||
| 936 | { 41, "driverRetransmissions" }, | ||
| 937 | { 42, "txAckTimeoutMs" }, | ||
| 938 | { 43, "registrationInterrupts" }, | ||
| 939 | { 44, "hardwareType" }, | ||
| 940 | { 45, "radioType" }, | ||
| 941 | { 46, "writeEEPROM" }, | ||
| 942 | { 47, "writeRadioType" }, | ||
| 943 | { 48, "entry_exit_debug" }, | ||
| 944 | { 49, "debug" }, | ||
| 945 | { 50, "in_speed" }, | ||
| 946 | { 51, "out_speed" }, | ||
| 947 | { 52, "in_speed10" }, | ||
| 948 | { 53, "out_speed10" }, | ||
| 949 | { 54, "in_speed_max" }, | ||
| 950 | { 55, "out_speed_max" }, | ||
| 951 | { 56, "measure_rate" }, | ||
| 952 | { 57, "pre_Command_Wait" }, | ||
| 953 | { 58, "rx_tweak1" }, | ||
| 954 | { 59, "rx_tweak2" }, | ||
| 955 | { 60, "tx_queue_len" }, | ||
| 956 | |||
| 957 | { 150, "arlan0-txRing" }, | ||
| 958 | { 151, "arlan0-rxRing" }, | ||
| 959 | { 152, "arlan0-18" }, | ||
| 960 | { 153, "arlan0-ring" }, | ||
| 961 | { 154, "arlan0-shm-cpy" }, | ||
| 962 | { 155, "config0" }, | ||
| 963 | { 156, "reset0" }, | ||
| 964 | {} | ||
| 965 | }; | ||
| 966 | |||
| 967 | static const struct trans_ctl_table trans_arlan_conf_table1[] = { | ||
| 968 | { 1, "spreadingCode" }, | ||
| 969 | { 2, "channelNumber" }, | ||
| 970 | { 3, "scramblingDisable" }, | ||
| 971 | { 4, "txAttenuation" }, | ||
| 972 | { 5, "systemId" }, | ||
| 973 | { 6, "maxDatagramSize" }, | ||
| 974 | { 7, "maxFrameSize" }, | ||
| 975 | { 8, "maxRetries" }, | ||
| 976 | { 9, "receiveMode" }, | ||
| 977 | { 10, "priority" }, | ||
| 978 | { 11, "rootOrRepeater" }, | ||
| 979 | { 12, "SID" }, | ||
| 980 | { 13, "registrationMode" }, | ||
| 981 | { 14, "registrationFill" }, | ||
| 982 | { 15, "localTalkAddress" }, | ||
| 983 | { 16, "codeFormat" }, | ||
| 984 | { 17, "numChannels" }, | ||
| 985 | { 18, "channel1" }, | ||
| 986 | { 19, "channel2" }, | ||
| 987 | { 20, "channel3" }, | ||
| 988 | { 21, "channel4" }, | ||
| 989 | { 22, "txClear" }, | ||
| 990 | { 23, "txRetries" }, | ||
| 991 | { 24, "txRouting" }, | ||
| 992 | { 25, "txScrambled" }, | ||
| 993 | { 26, "rxParameter" }, | ||
| 994 | { 27, "txTimeoutMs" }, | ||
| 995 | { 28, "waitCardTimeout" }, | ||
| 996 | { 29, "channelSet" }, | ||
| 997 | { 30, "name" }, | ||
| 998 | { 31, "waitTime" }, | ||
| 999 | { 32, "lParameter" }, | ||
| 1000 | { 33, "_15" }, | ||
| 1001 | { 34, "headerSize" }, | ||
| 1002 | { 36, "tx_delay_ms" }, | ||
| 1003 | { 37, "retries" }, | ||
| 1004 | { 38, "ReTransmitPacketMaxSize" }, | ||
| 1005 | { 39, "waitReTransmitPacketMaxSize" }, | ||
| 1006 | { 40, "fastReTransCount" }, | ||
| 1007 | { 41, "driverRetransmissions" }, | ||
| 1008 | { 42, "txAckTimeoutMs" }, | ||
| 1009 | { 43, "registrationInterrupts" }, | ||
| 1010 | { 44, "hardwareType" }, | ||
| 1011 | { 45, "radioType" }, | ||
| 1012 | { 46, "writeEEPROM" }, | ||
| 1013 | { 47, "writeRadioType" }, | ||
| 1014 | { 48, "entry_exit_debug" }, | ||
| 1015 | { 49, "debug" }, | ||
| 1016 | { 50, "in_speed" }, | ||
| 1017 | { 51, "out_speed" }, | ||
| 1018 | { 52, "in_speed10" }, | ||
| 1019 | { 53, "out_speed10" }, | ||
| 1020 | { 54, "in_speed_max" }, | ||
| 1021 | { 55, "out_speed_max" }, | ||
| 1022 | { 56, "measure_rate" }, | ||
| 1023 | { 57, "pre_Command_Wait" }, | ||
| 1024 | { 58, "rx_tweak1" }, | ||
| 1025 | { 59, "rx_tweak2" }, | ||
| 1026 | { 60, "tx_queue_len" }, | ||
| 1027 | |||
| 1028 | { 150, "arlan1-txRing" }, | ||
| 1029 | { 151, "arlan1-rxRing" }, | ||
| 1030 | { 152, "arlan1-18" }, | ||
| 1031 | { 153, "arlan1-ring" }, | ||
| 1032 | { 154, "arlan1-shm-cpy" }, | ||
| 1033 | { 155, "config1" }, | ||
| 1034 | { 156, "reset1" }, | ||
| 1035 | {} | ||
| 1036 | }; | ||
| 1037 | |||
| 1038 | static const struct trans_ctl_table trans_arlan_conf_table2[] = { | ||
| 1039 | { 1, "spreadingCode" }, | ||
| 1040 | { 2, "channelNumber" }, | ||
| 1041 | { 3, "scramblingDisable" }, | ||
| 1042 | { 4, "txAttenuation" }, | ||
| 1043 | { 5, "systemId" }, | ||
| 1044 | { 6, "maxDatagramSize" }, | ||
| 1045 | { 7, "maxFrameSize" }, | ||
| 1046 | { 8, "maxRetries" }, | ||
| 1047 | { 9, "receiveMode" }, | ||
| 1048 | { 10, "priority" }, | ||
| 1049 | { 11, "rootOrRepeater" }, | ||
| 1050 | { 12, "SID" }, | ||
| 1051 | { 13, "registrationMode" }, | ||
| 1052 | { 14, "registrationFill" }, | ||
| 1053 | { 15, "localTalkAddress" }, | ||
| 1054 | { 16, "codeFormat" }, | ||
| 1055 | { 17, "numChannels" }, | ||
| 1056 | { 18, "channel1" }, | ||
| 1057 | { 19, "channel2" }, | ||
| 1058 | { 20, "channel3" }, | ||
| 1059 | { 21, "channel4" }, | ||
| 1060 | { 22, "txClear" }, | ||
| 1061 | { 23, "txRetries" }, | ||
| 1062 | { 24, "txRouting" }, | ||
| 1063 | { 25, "txScrambled" }, | ||
| 1064 | { 26, "rxParameter" }, | ||
| 1065 | { 27, "txTimeoutMs" }, | ||
| 1066 | { 28, "waitCardTimeout" }, | ||
| 1067 | { 29, "channelSet" }, | ||
| 1068 | { 30, "name" }, | ||
| 1069 | { 31, "waitTime" }, | ||
| 1070 | { 32, "lParameter" }, | ||
| 1071 | { 33, "_15" }, | ||
| 1072 | { 34, "headerSize" }, | ||
| 1073 | { 36, "tx_delay_ms" }, | ||
| 1074 | { 37, "retries" }, | ||
| 1075 | { 38, "ReTransmitPacketMaxSize" }, | ||
| 1076 | { 39, "waitReTransmitPacketMaxSize" }, | ||
| 1077 | { 40, "fastReTransCount" }, | ||
| 1078 | { 41, "driverRetransmissions" }, | ||
| 1079 | { 42, "txAckTimeoutMs" }, | ||
| 1080 | { 43, "registrationInterrupts" }, | ||
| 1081 | { 44, "hardwareType" }, | ||
| 1082 | { 45, "radioType" }, | ||
| 1083 | { 46, "writeEEPROM" }, | ||
| 1084 | { 47, "writeRadioType" }, | ||
| 1085 | { 48, "entry_exit_debug" }, | ||
| 1086 | { 49, "debug" }, | ||
| 1087 | { 50, "in_speed" }, | ||
| 1088 | { 51, "out_speed" }, | ||
| 1089 | { 52, "in_speed10" }, | ||
| 1090 | { 53, "out_speed10" }, | ||
| 1091 | { 54, "in_speed_max" }, | ||
| 1092 | { 55, "out_speed_max" }, | ||
| 1093 | { 56, "measure_rate" }, | ||
| 1094 | { 57, "pre_Command_Wait" }, | ||
| 1095 | { 58, "rx_tweak1" }, | ||
| 1096 | { 59, "rx_tweak2" }, | ||
| 1097 | { 60, "tx_queue_len" }, | ||
| 1098 | |||
| 1099 | { 150, "arlan2-txRing" }, | ||
| 1100 | { 151, "arlan2-rxRing" }, | ||
| 1101 | { 152, "arlan2-18" }, | ||
| 1102 | { 153, "arlan2-ring" }, | ||
| 1103 | { 154, "arlan2-shm-cpy" }, | ||
| 1104 | { 155, "config2" }, | ||
| 1105 | { 156, "reset2" }, | ||
| 1106 | {} | ||
| 1107 | }; | ||
| 1108 | |||
| 1109 | static const struct trans_ctl_table trans_arlan_conf_table3[] = { | ||
| 1110 | { 1, "spreadingCode" }, | ||
| 1111 | { 2, "channelNumber" }, | ||
| 1112 | { 3, "scramblingDisable" }, | ||
| 1113 | { 4, "txAttenuation" }, | ||
| 1114 | { 5, "systemId" }, | ||
| 1115 | { 6, "maxDatagramSize" }, | ||
| 1116 | { 7, "maxFrameSize" }, | ||
| 1117 | { 8, "maxRetries" }, | ||
| 1118 | { 9, "receiveMode" }, | ||
| 1119 | { 10, "priority" }, | ||
| 1120 | { 11, "rootOrRepeater" }, | ||
| 1121 | { 12, "SID" }, | ||
| 1122 | { 13, "registrationMode" }, | ||
| 1123 | { 14, "registrationFill" }, | ||
| 1124 | { 15, "localTalkAddress" }, | ||
| 1125 | { 16, "codeFormat" }, | ||
| 1126 | { 17, "numChannels" }, | ||
| 1127 | { 18, "channel1" }, | ||
| 1128 | { 19, "channel2" }, | ||
| 1129 | { 20, "channel3" }, | ||
| 1130 | { 21, "channel4" }, | ||
| 1131 | { 22, "txClear" }, | ||
| 1132 | { 23, "txRetries" }, | ||
| 1133 | { 24, "txRouting" }, | ||
| 1134 | { 25, "txScrambled" }, | ||
| 1135 | { 26, "rxParameter" }, | ||
| 1136 | { 27, "txTimeoutMs" }, | ||
| 1137 | { 28, "waitCardTimeout" }, | ||
| 1138 | { 29, "channelSet" }, | ||
| 1139 | { 30, "name" }, | ||
| 1140 | { 31, "waitTime" }, | ||
| 1141 | { 32, "lParameter" }, | ||
| 1142 | { 33, "_15" }, | ||
| 1143 | { 34, "headerSize" }, | ||
| 1144 | { 36, "tx_delay_ms" }, | ||
| 1145 | { 37, "retries" }, | ||
| 1146 | { 38, "ReTransmitPacketMaxSize" }, | ||
| 1147 | { 39, "waitReTransmitPacketMaxSize" }, | ||
| 1148 | { 40, "fastReTransCount" }, | ||
| 1149 | { 41, "driverRetransmissions" }, | ||
| 1150 | { 42, "txAckTimeoutMs" }, | ||
| 1151 | { 43, "registrationInterrupts" }, | ||
| 1152 | { 44, "hardwareType" }, | ||
| 1153 | { 45, "radioType" }, | ||
| 1154 | { 46, "writeEEPROM" }, | ||
| 1155 | { 47, "writeRadioType" }, | ||
| 1156 | { 48, "entry_exit_debug" }, | ||
| 1157 | { 49, "debug" }, | ||
| 1158 | { 50, "in_speed" }, | ||
| 1159 | { 51, "out_speed" }, | ||
| 1160 | { 52, "in_speed10" }, | ||
| 1161 | { 53, "out_speed10" }, | ||
| 1162 | { 54, "in_speed_max" }, | ||
| 1163 | { 55, "out_speed_max" }, | ||
| 1164 | { 56, "measure_rate" }, | ||
| 1165 | { 57, "pre_Command_Wait" }, | ||
| 1166 | { 58, "rx_tweak1" }, | ||
| 1167 | { 59, "rx_tweak2" }, | ||
| 1168 | { 60, "tx_queue_len" }, | ||
| 1169 | |||
| 1170 | { 150, "arlan3-txRing" }, | ||
| 1171 | { 151, "arlan3-rxRing" }, | ||
| 1172 | { 152, "arlan3-18" }, | ||
| 1173 | { 153, "arlan3-ring" }, | ||
| 1174 | { 154, "arlan3-shm-cpy" }, | ||
| 1175 | { 155, "config3" }, | ||
| 1176 | { 156, "reset3" }, | ||
| 1177 | {} | ||
| 1178 | }; | ||
| 1179 | |||
| 1180 | static const struct trans_ctl_table trans_arlan_table[] = { | ||
| 1181 | { 1, "arlan0", trans_arlan_conf_table0 }, | ||
| 1182 | { 2, "arlan1", trans_arlan_conf_table1 }, | ||
| 1183 | { 3, "arlan2", trans_arlan_conf_table2 }, | ||
| 1184 | { 4, "arlan3", trans_arlan_conf_table3 }, | ||
| 1185 | {} | ||
| 1186 | }; | ||
| 1187 | |||
| 1188 | static const struct trans_ctl_table trans_s390dbf_table[] = { | ||
| 1189 | { 5678 /* CTL_S390DBF_STOPPABLE */, "debug_stoppable" }, | ||
| 1190 | { 5679 /* CTL_S390DBF_ACTIVE */, "debug_active" }, | ||
| 1191 | {} | ||
| 1192 | }; | ||
| 1193 | |||
| 1194 | static const struct trans_ctl_table trans_sunrpc_table[] = { | ||
| 1195 | { CTL_RPCDEBUG, "rpc_debug" }, | ||
| 1196 | { CTL_NFSDEBUG, "nfs_debug" }, | ||
| 1197 | { CTL_NFSDDEBUG, "nfsd_debug" }, | ||
| 1198 | { CTL_NLMDEBUG, "nlm_debug" }, | ||
| 1199 | { CTL_SLOTTABLE_UDP, "udp_slot_table_entries" }, | ||
| 1200 | { CTL_SLOTTABLE_TCP, "tcp_slot_table_entries" }, | ||
| 1201 | { CTL_MIN_RESVPORT, "min_resvport" }, | ||
| 1202 | { CTL_MAX_RESVPORT, "max_resvport" }, | ||
| 1203 | {} | ||
| 1204 | }; | ||
| 1205 | |||
| 1206 | static const struct trans_ctl_table trans_pm_table[] = { | ||
| 1207 | { 1 /* CTL_PM_SUSPEND */, "suspend" }, | ||
| 1208 | { 2 /* CTL_PM_CMODE */, "cmode" }, | ||
| 1209 | { 3 /* CTL_PM_P0 */, "p0" }, | ||
| 1210 | { 4 /* CTL_PM_CM */, "cm" }, | ||
| 1211 | {} | ||
| 1212 | }; | ||
| 1213 | |||
| 1214 | static const struct trans_ctl_table trans_frv_table[] = { | ||
| 1215 | { 1, "cache-mode" }, | ||
| 1216 | { 2, "pin-cxnr" }, | ||
| 1217 | {} | ||
| 1218 | }; | ||
| 1219 | |||
| 1220 | static const struct trans_ctl_table trans_root_table[] = { | ||
| 1221 | { CTL_KERN, "kernel", trans_kern_table }, | ||
| 1222 | { CTL_VM, "vm", trans_vm_table }, | ||
| 1223 | { CTL_NET, "net", trans_net_table }, | ||
| 1224 | /* CTL_PROC not used */ | ||
| 1225 | { CTL_FS, "fs", trans_fs_table }, | ||
| 1226 | { CTL_DEBUG, "debug", trans_debug_table }, | ||
| 1227 | { CTL_DEV, "dev", trans_dev_table }, | ||
| 1228 | { CTL_BUS, "bus", trans_bus_table }, | ||
| 1229 | { CTL_ABI, "abi" }, | ||
| 1230 | /* CTL_CPU not used */ | ||
| 1231 | { CTL_ARLAN, "arlan", trans_arlan_table }, | ||
| 1232 | { CTL_S390DBF, "s390dbf", trans_s390dbf_table }, | ||
| 1233 | { CTL_SUNRPC, "sunrpc", trans_sunrpc_table }, | ||
| 1234 | { CTL_PM, "pm", trans_pm_table }, | ||
| 1235 | { CTL_FRV, "frv", trans_frv_table }, | ||
| 1236 | {} | ||
| 1237 | }; | ||
| 1238 | |||
| 1239 | |||
| 1240 | |||
| 1241 | 8 | ||
| 1242 | static int sysctl_depth(struct ctl_table *table) | 9 | static int sysctl_depth(struct ctl_table *table) |
| 1243 | { | 10 | { |
| @@ -1261,47 +28,6 @@ static struct ctl_table *sysctl_parent(struct ctl_table *table, int n) | |||
| 1261 | return table; | 28 | return table; |
| 1262 | } | 29 | } |
| 1263 | 30 | ||
| 1264 | static const struct trans_ctl_table *sysctl_binary_lookup(struct ctl_table *table) | ||
| 1265 | { | ||
| 1266 | struct ctl_table *test; | ||
| 1267 | const struct trans_ctl_table *ref; | ||
| 1268 | int cur_depth; | ||
| 1269 | |||
| 1270 | cur_depth = sysctl_depth(table); | ||
| 1271 | |||
| 1272 | ref = trans_root_table; | ||
| 1273 | repeat: | ||
| 1274 | test = sysctl_parent(table, cur_depth); | ||
| 1275 | for (; ref->ctl_name || ref->procname || ref->child; ref++) { | ||
| 1276 | int match = 0; | ||
| 1277 | |||
| 1278 | if (cur_depth && !ref->child) | ||
| 1279 | continue; | ||
| 1280 | |||
| 1281 | if (test->procname && ref->procname && | ||
| 1282 | (strcmp(test->procname, ref->procname) == 0)) | ||
| 1283 | match++; | ||
| 1284 | |||
| 1285 | if (test->ctl_name && ref->ctl_name && | ||
| 1286 | (test->ctl_name == ref->ctl_name)) | ||
| 1287 | match++; | ||
| 1288 | |||
| 1289 | if (!ref->ctl_name && !ref->procname) | ||
| 1290 | match++; | ||
| 1291 | |||
| 1292 | if (match) { | ||
| 1293 | if (cur_depth != 0) { | ||
| 1294 | cur_depth--; | ||
| 1295 | ref = ref->child; | ||
| 1296 | goto repeat; | ||
| 1297 | } | ||
| 1298 | goto out; | ||
| 1299 | } | ||
| 1300 | } | ||
| 1301 | ref = NULL; | ||
| 1302 | out: | ||
| 1303 | return ref; | ||
| 1304 | } | ||
| 1305 | 31 | ||
| 1306 | static void sysctl_print_path(struct ctl_table *table) | 32 | static void sysctl_print_path(struct ctl_table *table) |
| 1307 | { | 33 | { |
| @@ -1315,26 +41,6 @@ static void sysctl_print_path(struct ctl_table *table) | |||
| 1315 | } | 41 | } |
| 1316 | } | 42 | } |
| 1317 | printk(" "); | 43 | printk(" "); |
| 1318 | if (table->ctl_name) { | ||
| 1319 | for (i = depth; i >= 0; i--) { | ||
| 1320 | tmp = sysctl_parent(table, i); | ||
| 1321 | printk(".%d", tmp->ctl_name); | ||
| 1322 | } | ||
| 1323 | } | ||
| 1324 | } | ||
| 1325 | |||
| 1326 | static void sysctl_repair_table(struct ctl_table *table) | ||
| 1327 | { | ||
| 1328 | /* Don't complain about the classic default | ||
| 1329 | * sysctl strategy routine. Maybe later we | ||
| 1330 | * can get the tables fixed and complain about | ||
| 1331 | * this. | ||
| 1332 | */ | ||
| 1333 | if (table->ctl_name && table->procname && | ||
| 1334 | (table->proc_handler == proc_dointvec) && | ||
| 1335 | (!table->strategy)) { | ||
| 1336 | table->strategy = sysctl_data; | ||
| 1337 | } | ||
| 1338 | } | 44 | } |
| 1339 | 45 | ||
| 1340 | static struct ctl_table *sysctl_check_lookup(struct nsproxy *namespaces, | 46 | static struct ctl_table *sysctl_check_lookup(struct nsproxy *namespaces, |
| @@ -1352,7 +58,7 @@ static struct ctl_table *sysctl_check_lookup(struct nsproxy *namespaces, | |||
| 1352 | ref = head->ctl_table; | 58 | ref = head->ctl_table; |
| 1353 | repeat: | 59 | repeat: |
| 1354 | test = sysctl_parent(table, cur_depth); | 60 | test = sysctl_parent(table, cur_depth); |
| 1355 | for (; ref->ctl_name || ref->procname; ref++) { | 61 | for (; ref->procname; ref++) { |
| 1356 | int match = 0; | 62 | int match = 0; |
| 1357 | if (cur_depth && !ref->child) | 63 | if (cur_depth && !ref->child) |
| 1358 | continue; | 64 | continue; |
| @@ -1361,10 +67,6 @@ repeat: | |||
| 1361 | (strcmp(test->procname, ref->procname) == 0)) | 67 | (strcmp(test->procname, ref->procname) == 0)) |
| 1362 | match++; | 68 | match++; |
| 1363 | 69 | ||
| 1364 | if (test->ctl_name && ref->ctl_name && | ||
| 1365 | (test->ctl_name == ref->ctl_name)) | ||
| 1366 | match++; | ||
| 1367 | |||
| 1368 | if (match) { | 70 | if (match) { |
| 1369 | if (cur_depth != 0) { | 71 | if (cur_depth != 0) { |
| 1370 | cur_depth--; | 72 | cur_depth--; |
| @@ -1392,38 +94,6 @@ static void set_fail(const char **fail, struct ctl_table *table, const char *str | |||
| 1392 | *fail = str; | 94 | *fail = str; |
| 1393 | } | 95 | } |
| 1394 | 96 | ||
| 1395 | static int sysctl_check_dir(struct nsproxy *namespaces, | ||
| 1396 | struct ctl_table *table) | ||
| 1397 | { | ||
| 1398 | struct ctl_table *ref; | ||
| 1399 | int error; | ||
| 1400 | |||
| 1401 | error = 0; | ||
| 1402 | ref = sysctl_check_lookup(namespaces, table); | ||
| 1403 | if (ref) { | ||
| 1404 | int match = 0; | ||
| 1405 | if ((!table->procname && !ref->procname) || | ||
| 1406 | (table->procname && ref->procname && | ||
| 1407 | (strcmp(table->procname, ref->procname) == 0))) | ||
| 1408 | match++; | ||
| 1409 | |||
| 1410 | if ((!table->ctl_name && !ref->ctl_name) || | ||
| 1411 | (table->ctl_name && ref->ctl_name && | ||
| 1412 | (table->ctl_name == ref->ctl_name))) | ||
| 1413 | match++; | ||
| 1414 | |||
| 1415 | if (match != 2) { | ||
| 1416 | printk(KERN_ERR "%s: failed: ", __func__); | ||
| 1417 | sysctl_print_path(table); | ||
| 1418 | printk(" ref: "); | ||
| 1419 | sysctl_print_path(ref); | ||
| 1420 | printk("\n"); | ||
| 1421 | error = -EINVAL; | ||
| 1422 | } | ||
| 1423 | } | ||
| 1424 | return error; | ||
| 1425 | } | ||
| 1426 | |||
| 1427 | static void sysctl_check_leaf(struct nsproxy *namespaces, | 97 | static void sysctl_check_leaf(struct nsproxy *namespaces, |
| 1428 | struct ctl_table *table, const char **fail) | 98 | struct ctl_table *table, const char **fail) |
| 1429 | { | 99 | { |
| @@ -1434,37 +104,15 @@ static void sysctl_check_leaf(struct nsproxy *namespaces, | |||
| 1434 | set_fail(fail, table, "Sysctl already exists"); | 104 | set_fail(fail, table, "Sysctl already exists"); |
| 1435 | } | 105 | } |
| 1436 | 106 | ||
| 1437 | static void sysctl_check_bin_path(struct ctl_table *table, const char **fail) | ||
| 1438 | { | ||
| 1439 | const struct trans_ctl_table *ref; | ||
| 1440 | |||
| 1441 | ref = sysctl_binary_lookup(table); | ||
| 1442 | if (table->ctl_name && !ref) | ||
| 1443 | set_fail(fail, table, "Unknown sysctl binary path"); | ||
| 1444 | if (ref) { | ||
| 1445 | if (ref->procname && | ||
| 1446 | (!table->procname || | ||
| 1447 | (strcmp(table->procname, ref->procname) != 0))) | ||
| 1448 | set_fail(fail, table, "procname does not match binary path procname"); | ||
| 1449 | |||
| 1450 | if (ref->ctl_name && table->ctl_name && | ||
| 1451 | (table->ctl_name != ref->ctl_name)) | ||
| 1452 | set_fail(fail, table, "ctl_name does not match binary path ctl_name"); | ||
| 1453 | } | ||
| 1454 | } | ||
| 1455 | |||
| 1456 | int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table) | 107 | int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table) |
| 1457 | { | 108 | { |
| 1458 | int error = 0; | 109 | int error = 0; |
| 1459 | for (; table->ctl_name || table->procname; table++) { | 110 | for (; table->procname; table++) { |
| 1460 | const char *fail = NULL; | 111 | const char *fail = NULL; |
| 1461 | 112 | ||
| 1462 | sysctl_repair_table(table); | ||
| 1463 | if (table->parent) { | 113 | if (table->parent) { |
| 1464 | if (table->procname && !table->parent->procname) | 114 | if (table->procname && !table->parent->procname) |
| 1465 | set_fail(&fail, table, "Parent without procname"); | 115 | set_fail(&fail, table, "Parent without procname"); |
| 1466 | if (table->ctl_name && !table->parent->ctl_name) | ||
| 1467 | set_fail(&fail, table, "Parent without ctl_name"); | ||
| 1468 | } | 116 | } |
| 1469 | if (!table->procname) | 117 | if (!table->procname) |
| 1470 | set_fail(&fail, table, "No procname"); | 118 | set_fail(&fail, table, "No procname"); |
| @@ -1477,21 +125,12 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table) | |||
| 1477 | set_fail(&fail, table, "Writable sysctl directory"); | 125 | set_fail(&fail, table, "Writable sysctl directory"); |
| 1478 | if (table->proc_handler) | 126 | if (table->proc_handler) |
| 1479 | set_fail(&fail, table, "Directory with proc_handler"); | 127 | set_fail(&fail, table, "Directory with proc_handler"); |
| 1480 | if (table->strategy) | ||
| 1481 | set_fail(&fail, table, "Directory with strategy"); | ||
| 1482 | if (table->extra1) | 128 | if (table->extra1) |
| 1483 | set_fail(&fail, table, "Directory with extra1"); | 129 | set_fail(&fail, table, "Directory with extra1"); |
| 1484 | if (table->extra2) | 130 | if (table->extra2) |
| 1485 | set_fail(&fail, table, "Directory with extra2"); | 131 | set_fail(&fail, table, "Directory with extra2"); |
| 1486 | if (sysctl_check_dir(namespaces, table)) | ||
| 1487 | set_fail(&fail, table, "Inconsistent directory names"); | ||
| 1488 | } else { | 132 | } else { |
| 1489 | if ((table->strategy == sysctl_data) || | 133 | if ((table->proc_handler == proc_dostring) || |
| 1490 | (table->strategy == sysctl_string) || | ||
| 1491 | (table->strategy == sysctl_intvec) || | ||
| 1492 | (table->strategy == sysctl_jiffies) || | ||
| 1493 | (table->strategy == sysctl_ms_jiffies) || | ||
| 1494 | (table->proc_handler == proc_dostring) || | ||
| 1495 | (table->proc_handler == proc_dointvec) || | 134 | (table->proc_handler == proc_dointvec) || |
| 1496 | (table->proc_handler == proc_dointvec_minmax) || | 135 | (table->proc_handler == proc_dointvec_minmax) || |
| 1497 | (table->proc_handler == proc_dointvec_jiffies) || | 136 | (table->proc_handler == proc_dointvec_jiffies) || |
| @@ -1513,14 +152,6 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table) | |||
| 1513 | set_fail(&fail, table, "No max"); | 152 | set_fail(&fail, table, "No max"); |
| 1514 | } | 153 | } |
| 1515 | } | 154 | } |
| 1516 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
| 1517 | if (table->ctl_name && !table->strategy) | ||
| 1518 | set_fail(&fail, table, "Missing strategy"); | ||
| 1519 | #endif | ||
| 1520 | #if 0 | ||
| 1521 | if (!table->ctl_name && table->strategy) | ||
| 1522 | set_fail(&fail, table, "Strategy without ctl_name"); | ||
| 1523 | #endif | ||
| 1524 | #ifdef CONFIG_PROC_SYSCTL | 155 | #ifdef CONFIG_PROC_SYSCTL |
| 1525 | if (table->procname && !table->proc_handler) | 156 | if (table->procname && !table->proc_handler) |
| 1526 | set_fail(&fail, table, "No proc_handler"); | 157 | set_fail(&fail, table, "No proc_handler"); |
| @@ -1531,7 +162,6 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table) | |||
| 1531 | #endif | 162 | #endif |
| 1532 | sysctl_check_leaf(namespaces, table, &fail); | 163 | sysctl_check_leaf(namespaces, table, &fail); |
| 1533 | } | 164 | } |
| 1534 | sysctl_check_bin_path(table, &fail); | ||
| 1535 | if (table->mode > 0777) | 165 | if (table->mode > 0777) |
| 1536 | set_fail(&fail, table, "bogus .mode"); | 166 | set_fail(&fail, table, "bogus .mode"); |
| 1537 | if (fail) { | 167 | if (fail) { |
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index 5e18c6ab2c6a..4a310906b3e8 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c | |||
| @@ -39,7 +39,7 @@ void timecounter_init(struct timecounter *tc, | |||
| 39 | tc->cycle_last = cc->read(cc); | 39 | tc->cycle_last = cc->read(cc); |
| 40 | tc->nsec = start_tstamp; | 40 | tc->nsec = start_tstamp; |
| 41 | } | 41 | } |
| 42 | EXPORT_SYMBOL(timecounter_init); | 42 | EXPORT_SYMBOL_GPL(timecounter_init); |
| 43 | 43 | ||
| 44 | /** | 44 | /** |
| 45 | * timecounter_read_delta - get nanoseconds since last call of this function | 45 | * timecounter_read_delta - get nanoseconds since last call of this function |
| @@ -83,7 +83,7 @@ u64 timecounter_read(struct timecounter *tc) | |||
| 83 | 83 | ||
| 84 | return nsec; | 84 | return nsec; |
| 85 | } | 85 | } |
| 86 | EXPORT_SYMBOL(timecounter_read); | 86 | EXPORT_SYMBOL_GPL(timecounter_read); |
| 87 | 87 | ||
| 88 | u64 timecounter_cyc2time(struct timecounter *tc, | 88 | u64 timecounter_cyc2time(struct timecounter *tc, |
| 89 | cycle_t cycle_tstamp) | 89 | cycle_t cycle_tstamp) |
| @@ -105,7 +105,7 @@ u64 timecounter_cyc2time(struct timecounter *tc, | |||
| 105 | 105 | ||
| 106 | return nsec; | 106 | return nsec; |
| 107 | } | 107 | } |
| 108 | EXPORT_SYMBOL(timecounter_cyc2time); | 108 | EXPORT_SYMBOL_GPL(timecounter_cyc2time); |
| 109 | 109 | ||
| 110 | /*[Clocksource internal variables]--------- | 110 | /*[Clocksource internal variables]--------- |
| 111 | * curr_clocksource: | 111 | * curr_clocksource: |
diff --git a/kernel/time/timecompare.c b/kernel/time/timecompare.c index 71e7f1a19156..96ff643a5a59 100644 --- a/kernel/time/timecompare.c +++ b/kernel/time/timecompare.c | |||
| @@ -40,7 +40,7 @@ ktime_t timecompare_transform(struct timecompare *sync, | |||
| 40 | 40 | ||
| 41 | return ns_to_ktime(nsec); | 41 | return ns_to_ktime(nsec); |
| 42 | } | 42 | } |
| 43 | EXPORT_SYMBOL(timecompare_transform); | 43 | EXPORT_SYMBOL_GPL(timecompare_transform); |
| 44 | 44 | ||
| 45 | int timecompare_offset(struct timecompare *sync, | 45 | int timecompare_offset(struct timecompare *sync, |
| 46 | s64 *offset, | 46 | s64 *offset, |
| @@ -131,7 +131,7 @@ int timecompare_offset(struct timecompare *sync, | |||
| 131 | 131 | ||
| 132 | return used; | 132 | return used; |
| 133 | } | 133 | } |
| 134 | EXPORT_SYMBOL(timecompare_offset); | 134 | EXPORT_SYMBOL_GPL(timecompare_offset); |
| 135 | 135 | ||
| 136 | void __timecompare_update(struct timecompare *sync, | 136 | void __timecompare_update(struct timecompare *sync, |
| 137 | u64 source_tstamp) | 137 | u64 source_tstamp) |
| @@ -188,4 +188,4 @@ void __timecompare_update(struct timecompare *sync, | |||
| 188 | } | 188 | } |
| 189 | } | 189 | } |
| 190 | } | 190 | } |
| 191 | EXPORT_SYMBOL(__timecompare_update); | 191 | EXPORT_SYMBOL_GPL(__timecompare_update); |
diff --git a/kernel/user-return-notifier.c b/kernel/user-return-notifier.c new file mode 100644 index 000000000000..03e2d6fd9b18 --- /dev/null +++ b/kernel/user-return-notifier.c | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | |||
| 2 | #include <linux/user-return-notifier.h> | ||
| 3 | #include <linux/percpu.h> | ||
| 4 | #include <linux/sched.h> | ||
| 5 | #include <linux/module.h> | ||
| 6 | |||
| 7 | static DEFINE_PER_CPU(struct hlist_head, return_notifier_list); | ||
| 8 | |||
| 9 | #define URN_LIST_HEAD per_cpu(return_notifier_list, raw_smp_processor_id()) | ||
| 10 | |||
| 11 | /* | ||
| 12 | * Request a notification when the current cpu returns to userspace. Must be | ||
| 13 | * called in atomic context. The notifier will also be called in atomic | ||
| 14 | * context. | ||
| 15 | */ | ||
| 16 | void user_return_notifier_register(struct user_return_notifier *urn) | ||
| 17 | { | ||
| 18 | set_tsk_thread_flag(current, TIF_USER_RETURN_NOTIFY); | ||
| 19 | hlist_add_head(&urn->link, &URN_LIST_HEAD); | ||
| 20 | } | ||
| 21 | EXPORT_SYMBOL_GPL(user_return_notifier_register); | ||
| 22 | |||
| 23 | /* | ||
| 24 | * Removes a registered user return notifier. Must be called from atomic | ||
| 25 | * context, and from the same cpu registration occured in. | ||
| 26 | */ | ||
| 27 | void user_return_notifier_unregister(struct user_return_notifier *urn) | ||
| 28 | { | ||
| 29 | hlist_del(&urn->link); | ||
| 30 | if (hlist_empty(&URN_LIST_HEAD)) | ||
| 31 | clear_tsk_thread_flag(current, TIF_USER_RETURN_NOTIFY); | ||
| 32 | } | ||
| 33 | EXPORT_SYMBOL_GPL(user_return_notifier_unregister); | ||
| 34 | |||
| 35 | /* Calls registered user return notifiers */ | ||
| 36 | void fire_user_return_notifiers(void) | ||
| 37 | { | ||
| 38 | struct user_return_notifier *urn; | ||
| 39 | struct hlist_node *tmp1, *tmp2; | ||
| 40 | struct hlist_head *head; | ||
| 41 | |||
| 42 | head = &get_cpu_var(return_notifier_list); | ||
| 43 | hlist_for_each_entry_safe(urn, tmp1, tmp2, head, link) | ||
| 44 | urn->on_user_return(urn); | ||
| 45 | put_cpu_var(return_notifier_list); | ||
| 46 | } | ||
diff --git a/kernel/utsname_sysctl.c b/kernel/utsname_sysctl.c index 69eae358a726..a2cd77e70d4d 100644 --- a/kernel/utsname_sysctl.c +++ b/kernel/utsname_sysctl.c | |||
| @@ -57,78 +57,47 @@ static int proc_do_uts_string(ctl_table *table, int write, | |||
| 57 | #define proc_do_uts_string NULL | 57 | #define proc_do_uts_string NULL |
| 58 | #endif | 58 | #endif |
| 59 | 59 | ||
| 60 | |||
| 61 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
| 62 | /* The generic string strategy routine: */ | ||
| 63 | static int sysctl_uts_string(ctl_table *table, | ||
| 64 | void __user *oldval, size_t __user *oldlenp, | ||
| 65 | void __user *newval, size_t newlen) | ||
| 66 | { | ||
| 67 | struct ctl_table uts_table; | ||
| 68 | int r, write; | ||
| 69 | write = newval && newlen; | ||
| 70 | memcpy(&uts_table, table, sizeof(uts_table)); | ||
| 71 | uts_table.data = get_uts(table, write); | ||
| 72 | r = sysctl_string(&uts_table, oldval, oldlenp, newval, newlen); | ||
| 73 | put_uts(table, write, uts_table.data); | ||
| 74 | return r; | ||
| 75 | } | ||
| 76 | #else | ||
| 77 | #define sysctl_uts_string NULL | ||
| 78 | #endif | ||
| 79 | |||
| 80 | static struct ctl_table uts_kern_table[] = { | 60 | static struct ctl_table uts_kern_table[] = { |
| 81 | { | 61 | { |
| 82 | .ctl_name = KERN_OSTYPE, | ||
| 83 | .procname = "ostype", | 62 | .procname = "ostype", |
| 84 | .data = init_uts_ns.name.sysname, | 63 | .data = init_uts_ns.name.sysname, |
| 85 | .maxlen = sizeof(init_uts_ns.name.sysname), | 64 | .maxlen = sizeof(init_uts_ns.name.sysname), |
| 86 | .mode = 0444, | 65 | .mode = 0444, |
| 87 | .proc_handler = proc_do_uts_string, | 66 | .proc_handler = proc_do_uts_string, |
| 88 | .strategy = sysctl_uts_string, | ||
| 89 | }, | 67 | }, |
| 90 | { | 68 | { |
| 91 | .ctl_name = KERN_OSRELEASE, | ||
| 92 | .procname = "osrelease", | 69 | .procname = "osrelease", |
| 93 | .data = init_uts_ns.name.release, | 70 | .data = init_uts_ns.name.release, |
| 94 | .maxlen = sizeof(init_uts_ns.name.release), | 71 | .maxlen = sizeof(init_uts_ns.name.release), |
| 95 | .mode = 0444, | 72 | .mode = 0444, |
| 96 | .proc_handler = proc_do_uts_string, | 73 | .proc_handler = proc_do_uts_string, |
| 97 | .strategy = sysctl_uts_string, | ||
| 98 | }, | 74 | }, |
| 99 | { | 75 | { |
| 100 | .ctl_name = KERN_VERSION, | ||
| 101 | .procname = "version", | 76 | .procname = "version", |
| 102 | .data = init_uts_ns.name.version, | 77 | .data = init_uts_ns.name.version, |
| 103 | .maxlen = sizeof(init_uts_ns.name.version), | 78 | .maxlen = sizeof(init_uts_ns.name.version), |
| 104 | .mode = 0444, | 79 | .mode = 0444, |
| 105 | .proc_handler = proc_do_uts_string, | 80 | .proc_handler = proc_do_uts_string, |
| 106 | .strategy = sysctl_uts_string, | ||
| 107 | }, | 81 | }, |
| 108 | { | 82 | { |
| 109 | .ctl_name = KERN_NODENAME, | ||
| 110 | .procname = "hostname", | 83 | .procname = "hostname", |
| 111 | .data = init_uts_ns.name.nodename, | 84 | .data = init_uts_ns.name.nodename, |
| 112 | .maxlen = sizeof(init_uts_ns.name.nodename), | 85 | .maxlen = sizeof(init_uts_ns.name.nodename), |
| 113 | .mode = 0644, | 86 | .mode = 0644, |
| 114 | .proc_handler = proc_do_uts_string, | 87 | .proc_handler = proc_do_uts_string, |
| 115 | .strategy = sysctl_uts_string, | ||
| 116 | }, | 88 | }, |
| 117 | { | 89 | { |
| 118 | .ctl_name = KERN_DOMAINNAME, | ||
| 119 | .procname = "domainname", | 90 | .procname = "domainname", |
| 120 | .data = init_uts_ns.name.domainname, | 91 | .data = init_uts_ns.name.domainname, |
| 121 | .maxlen = sizeof(init_uts_ns.name.domainname), | 92 | .maxlen = sizeof(init_uts_ns.name.domainname), |
| 122 | .mode = 0644, | 93 | .mode = 0644, |
| 123 | .proc_handler = proc_do_uts_string, | 94 | .proc_handler = proc_do_uts_string, |
| 124 | .strategy = sysctl_uts_string, | ||
| 125 | }, | 95 | }, |
| 126 | {} | 96 | {} |
| 127 | }; | 97 | }; |
| 128 | 98 | ||
| 129 | static struct ctl_table uts_root_table[] = { | 99 | static struct ctl_table uts_root_table[] = { |
| 130 | { | 100 | { |
| 131 | .ctl_name = CTL_KERN, | ||
| 132 | .procname = "kernel", | 101 | .procname = "kernel", |
| 133 | .mode = 0555, | 102 | .mode = 0555, |
| 134 | .child = uts_kern_table, | 103 | .child = uts_kern_table, |
