diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2008-10-16 01:04:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 14:21:47 -0400 |
commit | f221e726bf4e082a05dcd573379ac859bfba7126 (patch) | |
tree | a05f674caac693dc9aec7e46dd06115389f7ece3 | |
parent | f40cbaa5b0a4719489e6e7947351c99a159aca30 (diff) |
sysctl: simplify ->strategy
name and nlen parameters passed to ->strategy hook are unused, remove
them. In general ->strategy hook should know what it's doing, and don't
do something tricky for which, say, pointer to original userspace array
may be needed (name).
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net> [ networking bits ]
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Matt Mackall <mpm@selenic.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/frv/kernel/pm.c | 6 | ||||
-rw-r--r-- | arch/mips/lasat/sysctl.c | 17 | ||||
-rw-r--r-- | drivers/char/random.c | 2 | ||||
-rw-r--r-- | include/linux/sysctl.h | 2 | ||||
-rw-r--r-- | include/net/ip.h | 2 | ||||
-rw-r--r-- | include/net/ndisc.h | 5 | ||||
-rw-r--r-- | ipc/ipc_sysctl.c | 9 | ||||
-rw-r--r-- | kernel/sysctl.c | 29 | ||||
-rw-r--r-- | kernel/utsname_sysctl.c | 5 | ||||
-rw-r--r-- | net/decnet/dn_dev.c | 4 | ||||
-rw-r--r-- | net/decnet/sysctl_net_decnet.c | 4 | ||||
-rw-r--r-- | net/ipv4/devinet.c | 7 | ||||
-rw-r--r-- | net/ipv4/route.c | 7 | ||||
-rw-r--r-- | net/ipv4/sysctl_net_ipv4.c | 18 | ||||
-rw-r--r-- | net/ipv6/addrconf.c | 1 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 11 |
16 files changed, 56 insertions, 73 deletions
diff --git a/arch/frv/kernel/pm.c b/arch/frv/kernel/pm.c index d1113c5031f5..be722fc1acff 100644 --- a/arch/frv/kernel/pm.c +++ b/arch/frv/kernel/pm.c | |||
@@ -211,7 +211,7 @@ static int cmode_procctl(ctl_table *ctl, int write, struct file *filp, | |||
211 | return try_set_cmode(new_cmode)?:*lenp; | 211 | return try_set_cmode(new_cmode)?:*lenp; |
212 | } | 212 | } |
213 | 213 | ||
214 | static int cmode_sysctl(ctl_table *table, int __user *name, int nlen, | 214 | static int cmode_sysctl(ctl_table *table, |
215 | void __user *oldval, size_t __user *oldlenp, | 215 | void __user *oldval, size_t __user *oldlenp, |
216 | void __user *newval, size_t newlen) | 216 | void __user *newval, size_t newlen) |
217 | { | 217 | { |
@@ -314,7 +314,7 @@ static int p0_procctl(ctl_table *ctl, int write, struct file *filp, | |||
314 | return try_set_p0(new_p0)?:*lenp; | 314 | return try_set_p0(new_p0)?:*lenp; |
315 | } | 315 | } |
316 | 316 | ||
317 | static int p0_sysctl(ctl_table *table, int __user *name, int nlen, | 317 | static int p0_sysctl(ctl_table *table, |
318 | void __user *oldval, size_t __user *oldlenp, | 318 | void __user *oldval, size_t __user *oldlenp, |
319 | void __user *newval, size_t newlen) | 319 | void __user *newval, size_t newlen) |
320 | { | 320 | { |
@@ -358,7 +358,7 @@ static int cm_procctl(ctl_table *ctl, int write, struct file *filp, | |||
358 | return try_set_cm(new_cm)?:*lenp; | 358 | return try_set_cm(new_cm)?:*lenp; |
359 | } | 359 | } |
360 | 360 | ||
361 | static int cm_sysctl(ctl_table *table, int __user *name, int nlen, | 361 | static int cm_sysctl(ctl_table *table, |
362 | void __user *oldval, size_t __user *oldlenp, | 362 | void __user *oldval, size_t __user *oldlenp, |
363 | void __user *newval, size_t newlen) | 363 | void __user *newval, size_t newlen) |
364 | { | 364 | { |
diff --git a/arch/mips/lasat/sysctl.c b/arch/mips/lasat/sysctl.c index 866881ec0cf8..8f88886feb12 100644 --- a/arch/mips/lasat/sysctl.c +++ b/arch/mips/lasat/sysctl.c | |||
@@ -38,14 +38,13 @@ | |||
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | /* Strategy function to write EEPROM after changing string entry */ | 40 | /* Strategy function to write EEPROM after changing string entry */ |
41 | int sysctl_lasatstring(ctl_table *table, int *name, int nlen, | 41 | int sysctl_lasatstring(ctl_table *table, |
42 | void *oldval, size_t *oldlenp, | 42 | void *oldval, size_t *oldlenp, |
43 | void *newval, size_t newlen) | 43 | void *newval, size_t newlen) |
44 | { | 44 | { |
45 | int r; | 45 | int r; |
46 | 46 | ||
47 | r = sysctl_string(table, name, | 47 | r = sysctl_string(table, oldval, oldlenp, newval, newlen); |
48 | nlen, oldval, oldlenp, newval, newlen); | ||
49 | if (r < 0) | 48 | if (r < 0) |
50 | return r; | 49 | return r; |
51 | 50 | ||
@@ -113,13 +112,13 @@ int proc_dolasatrtc(ctl_table *table, int write, struct file *filp, | |||
113 | #endif | 112 | #endif |
114 | 113 | ||
115 | /* Sysctl for setting the IP addresses */ | 114 | /* Sysctl for setting the IP addresses */ |
116 | int sysctl_lasat_intvec(ctl_table *table, int *name, int nlen, | 115 | int sysctl_lasat_intvec(ctl_table *table, |
117 | void *oldval, size_t *oldlenp, | 116 | void *oldval, size_t *oldlenp, |
118 | void *newval, size_t newlen) | 117 | void *newval, size_t newlen) |
119 | { | 118 | { |
120 | int r; | 119 | int r; |
121 | 120 | ||
122 | r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen); | 121 | r = sysctl_intvec(table, oldval, oldlenp, newval, newlen); |
123 | if (r < 0) | 122 | if (r < 0) |
124 | return r; | 123 | return r; |
125 | 124 | ||
@@ -131,7 +130,7 @@ int sysctl_lasat_intvec(ctl_table *table, int *name, int nlen, | |||
131 | 130 | ||
132 | #ifdef CONFIG_DS1603 | 131 | #ifdef CONFIG_DS1603 |
133 | /* Same for RTC */ | 132 | /* Same for RTC */ |
134 | int sysctl_lasat_rtc(ctl_table *table, int *name, int nlen, | 133 | int sysctl_lasat_rtc(ctl_table *table, |
135 | void *oldval, size_t *oldlenp, | 134 | void *oldval, size_t *oldlenp, |
136 | void *newval, size_t newlen) | 135 | void *newval, size_t newlen) |
137 | { | 136 | { |
@@ -140,7 +139,7 @@ int sysctl_lasat_rtc(ctl_table *table, int *name, int nlen, | |||
140 | rtctmp = read_persistent_clock(); | 139 | rtctmp = read_persistent_clock(); |
141 | if (rtctmp < 0) | 140 | if (rtctmp < 0) |
142 | rtctmp = 0; | 141 | rtctmp = 0; |
143 | r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen); | 142 | r = sysctl_intvec(table, oldval, oldlenp, newval, newlen); |
144 | if (r < 0) | 143 | if (r < 0) |
145 | return r; | 144 | return r; |
146 | if (newval && newlen) | 145 | if (newval && newlen) |
@@ -211,13 +210,13 @@ int proc_lasat_ip(ctl_table *table, int write, struct file *filp, | |||
211 | } | 210 | } |
212 | #endif | 211 | #endif |
213 | 212 | ||
214 | static int sysctl_lasat_prid(ctl_table *table, int *name, int nlen, | 213 | static int sysctl_lasat_prid(ctl_table *table, |
215 | void *oldval, size_t *oldlenp, | 214 | void *oldval, size_t *oldlenp, |
216 | void *newval, size_t newlen) | 215 | void *newval, size_t newlen) |
217 | { | 216 | { |
218 | int r; | 217 | int r; |
219 | 218 | ||
220 | r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen); | 219 | r = sysctl_intvec(table, oldval, oldlenp, newval, newlen); |
221 | if (r < 0) | 220 | if (r < 0) |
222 | return r; | 221 | return r; |
223 | if (newval && newlen) { | 222 | if (newval && newlen) { |
diff --git a/drivers/char/random.c b/drivers/char/random.c index 6af435b89867..c8752eaad483 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
@@ -1205,7 +1205,7 @@ static int proc_do_uuid(ctl_table *table, int write, struct file *filp, | |||
1205 | return proc_dostring(&fake_table, write, filp, buffer, lenp, ppos); | 1205 | return proc_dostring(&fake_table, write, filp, buffer, lenp, ppos); |
1206 | } | 1206 | } |
1207 | 1207 | ||
1208 | static int uuid_strategy(ctl_table *table, int __user *name, int nlen, | 1208 | static int uuid_strategy(ctl_table *table, |
1209 | void __user *oldval, size_t __user *oldlenp, | 1209 | void __user *oldval, size_t __user *oldlenp, |
1210 | void __user *newval, size_t newlen) | 1210 | void __user *newval, size_t newlen) |
1211 | { | 1211 | { |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index d0437f36921f..39d471d1163b 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -972,7 +972,7 @@ extern int sysctl_perm(struct ctl_table_root *root, | |||
972 | 972 | ||
973 | typedef struct ctl_table ctl_table; | 973 | typedef struct ctl_table ctl_table; |
974 | 974 | ||
975 | typedef int ctl_handler (struct ctl_table *table, int __user *name, int nlen, | 975 | typedef int ctl_handler (struct ctl_table *table, |
976 | void __user *oldval, size_t __user *oldlenp, | 976 | void __user *oldval, size_t __user *oldlenp, |
977 | void __user *newval, size_t newlen); | 977 | void __user *newval, size_t newlen); |
978 | 978 | ||
diff --git a/include/net/ip.h b/include/net/ip.h index 1cbccaf0de3f..bc026ecb513f 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -396,7 +396,7 @@ extern void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, | |||
396 | int ipv4_doint_and_flush(ctl_table *ctl, int write, | 396 | int ipv4_doint_and_flush(ctl_table *ctl, int write, |
397 | struct file* filp, void __user *buffer, | 397 | struct file* filp, void __user *buffer, |
398 | size_t *lenp, loff_t *ppos); | 398 | size_t *lenp, loff_t *ppos); |
399 | int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen, | 399 | int ipv4_doint_and_flush_strategy(ctl_table *table, |
400 | void __user *oldval, size_t __user *oldlenp, | 400 | void __user *oldval, size_t __user *oldlenp, |
401 | void __user *newval, size_t newlen); | 401 | void __user *newval, size_t newlen); |
402 | #ifdef CONFIG_PROC_FS | 402 | #ifdef CONFIG_PROC_FS |
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index a01b7c4dc763..11dd0137c6a5 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
@@ -129,9 +129,8 @@ extern int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, | |||
129 | void __user *buffer, | 129 | void __user *buffer, |
130 | size_t *lenp, | 130 | size_t *lenp, |
131 | loff_t *ppos); | 131 | loff_t *ppos); |
132 | int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl, int __user *name, | 132 | int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl, |
133 | int nlen, void __user *oldval, | 133 | void __user *oldval, size_t __user *oldlenp, |
134 | size_t __user *oldlenp, | ||
135 | void __user *newval, size_t newlen); | 134 | void __user *newval, size_t newlen); |
136 | #endif | 135 | #endif |
137 | 136 | ||
diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c index 69bc85978ba0..0dfebc509426 100644 --- a/ipc/ipc_sysctl.c +++ b/ipc/ipc_sysctl.c | |||
@@ -131,7 +131,7 @@ static int proc_ipcauto_dointvec_minmax(ctl_table *table, int write, | |||
131 | 131 | ||
132 | #ifdef CONFIG_SYSCTL_SYSCALL | 132 | #ifdef CONFIG_SYSCTL_SYSCALL |
133 | /* The generic sysctl ipc data routine. */ | 133 | /* The generic sysctl ipc data routine. */ |
134 | static int sysctl_ipc_data(ctl_table *table, int __user *name, int nlen, | 134 | static int sysctl_ipc_data(ctl_table *table, |
135 | void __user *oldval, size_t __user *oldlenp, | 135 | void __user *oldval, size_t __user *oldlenp, |
136 | void __user *newval, size_t newlen) | 136 | void __user *newval, size_t newlen) |
137 | { | 137 | { |
@@ -169,14 +169,13 @@ static int sysctl_ipc_data(ctl_table *table, int __user *name, int nlen, | |||
169 | return 1; | 169 | return 1; |
170 | } | 170 | } |
171 | 171 | ||
172 | static int sysctl_ipc_registered_data(ctl_table *table, int __user *name, | 172 | static int sysctl_ipc_registered_data(ctl_table *table, |
173 | int nlen, void __user *oldval, size_t __user *oldlenp, | 173 | void __user *oldval, size_t __user *oldlenp, |
174 | void __user *newval, size_t newlen) | 174 | void __user *newval, size_t newlen) |
175 | { | 175 | { |
176 | int rc; | 176 | int rc; |
177 | 177 | ||
178 | rc = sysctl_ipc_data(table, name, nlen, oldval, oldlenp, newval, | 178 | rc = sysctl_ipc_data(table, oldval, oldlenp, newval, newlen); |
179 | newlen); | ||
180 | 179 | ||
181 | if (newval && newlen && rc > 0) | 180 | if (newval && newlen && rc > 0) |
182 | /* | 181 | /* |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index ec88fcc9a0d2..9792c315676a 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -1500,7 +1500,6 @@ void register_sysctl_root(struct ctl_table_root *root) | |||
1500 | /* Perform the actual read/write of a sysctl table entry. */ | 1500 | /* Perform the actual read/write of a sysctl table entry. */ |
1501 | static int do_sysctl_strategy(struct ctl_table_root *root, | 1501 | static int do_sysctl_strategy(struct ctl_table_root *root, |
1502 | struct ctl_table *table, | 1502 | struct ctl_table *table, |
1503 | int __user *name, int nlen, | ||
1504 | void __user *oldval, size_t __user *oldlenp, | 1503 | void __user *oldval, size_t __user *oldlenp, |
1505 | void __user *newval, size_t newlen) | 1504 | void __user *newval, size_t newlen) |
1506 | { | 1505 | { |
@@ -1514,8 +1513,7 @@ static int do_sysctl_strategy(struct ctl_table_root *root, | |||
1514 | return -EPERM; | 1513 | return -EPERM; |
1515 | 1514 | ||
1516 | if (table->strategy) { | 1515 | if (table->strategy) { |
1517 | rc = table->strategy(table, name, nlen, oldval, oldlenp, | 1516 | rc = table->strategy(table, oldval, oldlenp, newval, newlen); |
1518 | newval, newlen); | ||
1519 | if (rc < 0) | 1517 | if (rc < 0) |
1520 | return rc; | 1518 | return rc; |
1521 | if (rc > 0) | 1519 | if (rc > 0) |
@@ -1525,8 +1523,7 @@ static int do_sysctl_strategy(struct ctl_table_root *root, | |||
1525 | /* If there is no strategy routine, or if the strategy returns | 1523 | /* If there is no strategy routine, or if the strategy returns |
1526 | * zero, proceed with automatic r/w */ | 1524 | * zero, proceed with automatic r/w */ |
1527 | if (table->data && table->maxlen) { | 1525 | if (table->data && table->maxlen) { |
1528 | rc = sysctl_data(table, name, nlen, oldval, oldlenp, | 1526 | rc = sysctl_data(table, oldval, oldlenp, newval, newlen); |
1529 | newval, newlen); | ||
1530 | if (rc < 0) | 1527 | if (rc < 0) |
1531 | return rc; | 1528 | return rc; |
1532 | } | 1529 | } |
@@ -1558,7 +1555,7 @@ repeat: | |||
1558 | table = table->child; | 1555 | table = table->child; |
1559 | goto repeat; | 1556 | goto repeat; |
1560 | } | 1557 | } |
1561 | error = do_sysctl_strategy(root, table, name, nlen, | 1558 | error = do_sysctl_strategy(root, table, |
1562 | oldval, oldlenp, | 1559 | oldval, oldlenp, |
1563 | newval, newlen); | 1560 | newval, newlen); |
1564 | return error; | 1561 | return error; |
@@ -2707,7 +2704,7 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, | |||
2707 | */ | 2704 | */ |
2708 | 2705 | ||
2709 | /* The generic sysctl data routine (used if no strategy routine supplied) */ | 2706 | /* The generic sysctl data routine (used if no strategy routine supplied) */ |
2710 | int sysctl_data(struct ctl_table *table, int __user *name, int nlen, | 2707 | int sysctl_data(struct ctl_table *table, |
2711 | void __user *oldval, size_t __user *oldlenp, | 2708 | void __user *oldval, size_t __user *oldlenp, |
2712 | void __user *newval, size_t newlen) | 2709 | void __user *newval, size_t newlen) |
2713 | { | 2710 | { |
@@ -2741,7 +2738,7 @@ int sysctl_data(struct ctl_table *table, int __user *name, int nlen, | |||
2741 | } | 2738 | } |
2742 | 2739 | ||
2743 | /* The generic string strategy routine: */ | 2740 | /* The generic string strategy routine: */ |
2744 | int sysctl_string(struct ctl_table *table, int __user *name, int nlen, | 2741 | int sysctl_string(struct ctl_table *table, |
2745 | void __user *oldval, size_t __user *oldlenp, | 2742 | void __user *oldval, size_t __user *oldlenp, |
2746 | void __user *newval, size_t newlen) | 2743 | void __user *newval, size_t newlen) |
2747 | { | 2744 | { |
@@ -2787,7 +2784,7 @@ int sysctl_string(struct ctl_table *table, int __user *name, int nlen, | |||
2787 | * are between the minimum and maximum values given in the arrays | 2784 | * are between the minimum and maximum values given in the arrays |
2788 | * table->extra1 and table->extra2, respectively. | 2785 | * table->extra1 and table->extra2, respectively. |
2789 | */ | 2786 | */ |
2790 | int sysctl_intvec(struct ctl_table *table, int __user *name, int nlen, | 2787 | int sysctl_intvec(struct ctl_table *table, |
2791 | void __user *oldval, size_t __user *oldlenp, | 2788 | void __user *oldval, size_t __user *oldlenp, |
2792 | void __user *newval, size_t newlen) | 2789 | void __user *newval, size_t newlen) |
2793 | { | 2790 | { |
@@ -2823,7 +2820,7 @@ int sysctl_intvec(struct ctl_table *table, int __user *name, int nlen, | |||
2823 | } | 2820 | } |
2824 | 2821 | ||
2825 | /* Strategy function to convert jiffies to seconds */ | 2822 | /* Strategy function to convert jiffies to seconds */ |
2826 | int sysctl_jiffies(struct ctl_table *table, int __user *name, int nlen, | 2823 | int sysctl_jiffies(struct ctl_table *table, |
2827 | void __user *oldval, size_t __user *oldlenp, | 2824 | void __user *oldval, size_t __user *oldlenp, |
2828 | void __user *newval, size_t newlen) | 2825 | void __user *newval, size_t newlen) |
2829 | { | 2826 | { |
@@ -2857,7 +2854,7 @@ int sysctl_jiffies(struct ctl_table *table, int __user *name, int nlen, | |||
2857 | } | 2854 | } |
2858 | 2855 | ||
2859 | /* Strategy function to convert jiffies to seconds */ | 2856 | /* Strategy function to convert jiffies to seconds */ |
2860 | int sysctl_ms_jiffies(struct ctl_table *table, int __user *name, int nlen, | 2857 | int sysctl_ms_jiffies(struct ctl_table *table, |
2861 | void __user *oldval, size_t __user *oldlenp, | 2858 | void __user *oldval, size_t __user *oldlenp, |
2862 | void __user *newval, size_t newlen) | 2859 | void __user *newval, size_t newlen) |
2863 | { | 2860 | { |
@@ -2912,35 +2909,35 @@ asmlinkage long sys_sysctl(struct __sysctl_args __user *args) | |||
2912 | return error; | 2909 | return error; |
2913 | } | 2910 | } |
2914 | 2911 | ||
2915 | int sysctl_data(struct ctl_table *table, int __user *name, int nlen, | 2912 | int sysctl_data(struct ctl_table *table, |
2916 | void __user *oldval, size_t __user *oldlenp, | 2913 | void __user *oldval, size_t __user *oldlenp, |
2917 | void __user *newval, size_t newlen) | 2914 | void __user *newval, size_t newlen) |
2918 | { | 2915 | { |
2919 | return -ENOSYS; | 2916 | return -ENOSYS; |
2920 | } | 2917 | } |
2921 | 2918 | ||
2922 | int sysctl_string(struct ctl_table *table, int __user *name, int nlen, | 2919 | int sysctl_string(struct ctl_table *table, |
2923 | void __user *oldval, size_t __user *oldlenp, | 2920 | void __user *oldval, size_t __user *oldlenp, |
2924 | void __user *newval, size_t newlen) | 2921 | void __user *newval, size_t newlen) |
2925 | { | 2922 | { |
2926 | return -ENOSYS; | 2923 | return -ENOSYS; |
2927 | } | 2924 | } |
2928 | 2925 | ||
2929 | int sysctl_intvec(struct ctl_table *table, int __user *name, int nlen, | 2926 | int sysctl_intvec(struct ctl_table *table, |
2930 | void __user *oldval, size_t __user *oldlenp, | 2927 | void __user *oldval, size_t __user *oldlenp, |
2931 | void __user *newval, size_t newlen) | 2928 | void __user *newval, size_t newlen) |
2932 | { | 2929 | { |
2933 | return -ENOSYS; | 2930 | return -ENOSYS; |
2934 | } | 2931 | } |
2935 | 2932 | ||
2936 | int sysctl_jiffies(struct ctl_table *table, int __user *name, int nlen, | 2933 | int sysctl_jiffies(struct ctl_table *table, |
2937 | void __user *oldval, size_t __user *oldlenp, | 2934 | void __user *oldval, size_t __user *oldlenp, |
2938 | void __user *newval, size_t newlen) | 2935 | void __user *newval, size_t newlen) |
2939 | { | 2936 | { |
2940 | return -ENOSYS; | 2937 | return -ENOSYS; |
2941 | } | 2938 | } |
2942 | 2939 | ||
2943 | int sysctl_ms_jiffies(struct ctl_table *table, int __user *name, int nlen, | 2940 | int sysctl_ms_jiffies(struct ctl_table *table, |
2944 | void __user *oldval, size_t __user *oldlenp, | 2941 | void __user *oldval, size_t __user *oldlenp, |
2945 | void __user *newval, size_t newlen) | 2942 | void __user *newval, size_t newlen) |
2946 | { | 2943 | { |
diff --git a/kernel/utsname_sysctl.c b/kernel/utsname_sysctl.c index 4ab9659d269e..3b34b3545936 100644 --- a/kernel/utsname_sysctl.c +++ b/kernel/utsname_sysctl.c | |||
@@ -60,7 +60,7 @@ static int proc_do_uts_string(ctl_table *table, int write, struct file *filp, | |||
60 | 60 | ||
61 | #ifdef CONFIG_SYSCTL_SYSCALL | 61 | #ifdef CONFIG_SYSCTL_SYSCALL |
62 | /* The generic string strategy routine: */ | 62 | /* The generic string strategy routine: */ |
63 | static int sysctl_uts_string(ctl_table *table, int __user *name, int nlen, | 63 | static int sysctl_uts_string(ctl_table *table, |
64 | void __user *oldval, size_t __user *oldlenp, | 64 | void __user *oldval, size_t __user *oldlenp, |
65 | void __user *newval, size_t newlen) | 65 | void __user *newval, size_t newlen) |
66 | { | 66 | { |
@@ -69,8 +69,7 @@ static int sysctl_uts_string(ctl_table *table, int __user *name, int nlen, | |||
69 | write = newval && newlen; | 69 | write = newval && newlen; |
70 | memcpy(&uts_table, table, sizeof(uts_table)); | 70 | memcpy(&uts_table, table, sizeof(uts_table)); |
71 | uts_table.data = get_uts(table, write); | 71 | uts_table.data = get_uts(table, write); |
72 | r = sysctl_string(&uts_table, name, nlen, | 72 | r = sysctl_string(&uts_table, oldval, oldlenp, newval, newlen); |
73 | oldval, oldlenp, newval, newlen); | ||
74 | put_uts(table, write, uts_table.data); | 73 | put_uts(table, write, uts_table.data); |
75 | return r; | 74 | return r; |
76 | } | 75 | } |
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index 2f0ac3c3eb71..96f9fcef2958 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c | |||
@@ -166,7 +166,7 @@ static int max_priority[] = { 127 }; /* From DECnet spec */ | |||
166 | 166 | ||
167 | static int dn_forwarding_proc(ctl_table *, int, struct file *, | 167 | static int dn_forwarding_proc(ctl_table *, int, struct file *, |
168 | void __user *, size_t *, loff_t *); | 168 | void __user *, size_t *, loff_t *); |
169 | static int dn_forwarding_sysctl(ctl_table *table, int __user *name, int nlen, | 169 | static int dn_forwarding_sysctl(ctl_table *table, |
170 | void __user *oldval, size_t __user *oldlenp, | 170 | void __user *oldval, size_t __user *oldlenp, |
171 | void __user *newval, size_t newlen); | 171 | void __user *newval, size_t newlen); |
172 | 172 | ||
@@ -318,7 +318,7 @@ static int dn_forwarding_proc(ctl_table *table, int write, | |||
318 | #endif | 318 | #endif |
319 | } | 319 | } |
320 | 320 | ||
321 | static int dn_forwarding_sysctl(ctl_table *table, int __user *name, int nlen, | 321 | static int dn_forwarding_sysctl(ctl_table *table, |
322 | void __user *oldval, size_t __user *oldlenp, | 322 | void __user *oldval, size_t __user *oldlenp, |
323 | void __user *newval, size_t newlen) | 323 | void __user *newval, size_t newlen) |
324 | { | 324 | { |
diff --git a/net/decnet/sysctl_net_decnet.c b/net/decnet/sysctl_net_decnet.c index 228067c571ba..36400b266896 100644 --- a/net/decnet/sysctl_net_decnet.c +++ b/net/decnet/sysctl_net_decnet.c | |||
@@ -132,7 +132,7 @@ static int parse_addr(__le16 *addr, char *str) | |||
132 | } | 132 | } |
133 | 133 | ||
134 | 134 | ||
135 | static int dn_node_address_strategy(ctl_table *table, int __user *name, int nlen, | 135 | static int dn_node_address_strategy(ctl_table *table, |
136 | void __user *oldval, size_t __user *oldlenp, | 136 | void __user *oldval, size_t __user *oldlenp, |
137 | void __user *newval, size_t newlen) | 137 | void __user *newval, size_t newlen) |
138 | { | 138 | { |
@@ -217,7 +217,7 @@ static int dn_node_address_handler(ctl_table *table, int write, | |||
217 | } | 217 | } |
218 | 218 | ||
219 | 219 | ||
220 | static int dn_def_dev_strategy(ctl_table *table, int __user *name, int nlen, | 220 | static int dn_def_dev_strategy(ctl_table *table, |
221 | void __user *oldval, size_t __user *oldlenp, | 221 | void __user *oldval, size_t __user *oldlenp, |
222 | void __user *newval, size_t newlen) | 222 | void __user *newval, size_t newlen) |
223 | { | 223 | { |
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index b12dae2b0b2d..5154e729cf16 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -1283,7 +1283,7 @@ static int devinet_conf_proc(ctl_table *ctl, int write, | |||
1283 | return ret; | 1283 | return ret; |
1284 | } | 1284 | } |
1285 | 1285 | ||
1286 | static int devinet_conf_sysctl(ctl_table *table, int __user *name, int nlen, | 1286 | static int devinet_conf_sysctl(ctl_table *table, |
1287 | void __user *oldval, size_t __user *oldlenp, | 1287 | void __user *oldval, size_t __user *oldlenp, |
1288 | void __user *newval, size_t newlen) | 1288 | void __user *newval, size_t newlen) |
1289 | { | 1289 | { |
@@ -1379,12 +1379,11 @@ int ipv4_doint_and_flush(ctl_table *ctl, int write, | |||
1379 | return ret; | 1379 | return ret; |
1380 | } | 1380 | } |
1381 | 1381 | ||
1382 | int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen, | 1382 | int ipv4_doint_and_flush_strategy(ctl_table *table, |
1383 | void __user *oldval, size_t __user *oldlenp, | 1383 | void __user *oldval, size_t __user *oldlenp, |
1384 | void __user *newval, size_t newlen) | 1384 | void __user *newval, size_t newlen) |
1385 | { | 1385 | { |
1386 | int ret = devinet_conf_sysctl(table, name, nlen, oldval, oldlenp, | 1386 | int ret = devinet_conf_sysctl(table, oldval, oldlenp, newval, newlen); |
1387 | newval, newlen); | ||
1388 | struct net *net = table->extra2; | 1387 | struct net *net = table->extra2; |
1389 | 1388 | ||
1390 | if (ret == 1) | 1389 | if (ret == 1) |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index a6d7c584f53b..942be04e7955 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -2908,8 +2908,6 @@ static int ipv4_sysctl_rtcache_flush(ctl_table *__ctl, int write, | |||
2908 | } | 2908 | } |
2909 | 2909 | ||
2910 | static int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table, | 2910 | static int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table, |
2911 | int __user *name, | ||
2912 | int nlen, | ||
2913 | void __user *oldval, | 2911 | void __user *oldval, |
2914 | size_t __user *oldlenp, | 2912 | size_t __user *oldlenp, |
2915 | void __user *newval, | 2913 | void __user *newval, |
@@ -2972,16 +2970,13 @@ static int ipv4_sysctl_rt_secret_interval(ctl_table *ctl, int write, | |||
2972 | } | 2970 | } |
2973 | 2971 | ||
2974 | static int ipv4_sysctl_rt_secret_interval_strategy(ctl_table *table, | 2972 | static int ipv4_sysctl_rt_secret_interval_strategy(ctl_table *table, |
2975 | int __user *name, | ||
2976 | int nlen, | ||
2977 | void __user *oldval, | 2973 | void __user *oldval, |
2978 | size_t __user *oldlenp, | 2974 | size_t __user *oldlenp, |
2979 | void __user *newval, | 2975 | void __user *newval, |
2980 | size_t newlen) | 2976 | size_t newlen) |
2981 | { | 2977 | { |
2982 | int old = ip_rt_secret_interval; | 2978 | int old = ip_rt_secret_interval; |
2983 | int ret = sysctl_jiffies(table, name, nlen, oldval, oldlenp, newval, | 2979 | int ret = sysctl_jiffies(table, oldval, oldlenp, newval, newlen); |
2984 | newlen); | ||
2985 | 2980 | ||
2986 | rt_secret_reschedule(old); | 2981 | rt_secret_reschedule(old); |
2987 | 2982 | ||
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index 276d047fb85a..1bb10df8ce7d 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c | |||
@@ -64,8 +64,8 @@ static int ipv4_local_port_range(ctl_table *table, int write, struct file *filp, | |||
64 | } | 64 | } |
65 | 65 | ||
66 | /* Validate changes from sysctl interface. */ | 66 | /* Validate changes from sysctl interface. */ |
67 | static int ipv4_sysctl_local_port_range(ctl_table *table, int __user *name, | 67 | static int ipv4_sysctl_local_port_range(ctl_table *table, |
68 | int nlen, void __user *oldval, | 68 | void __user *oldval, |
69 | size_t __user *oldlenp, | 69 | size_t __user *oldlenp, |
70 | void __user *newval, size_t newlen) | 70 | void __user *newval, size_t newlen) |
71 | { | 71 | { |
@@ -80,7 +80,7 @@ static int ipv4_sysctl_local_port_range(ctl_table *table, int __user *name, | |||
80 | }; | 80 | }; |
81 | 81 | ||
82 | inet_get_local_port_range(range, range + 1); | 82 | inet_get_local_port_range(range, range + 1); |
83 | ret = sysctl_intvec(&tmp, name, nlen, oldval, oldlenp, newval, newlen); | 83 | ret = sysctl_intvec(&tmp, oldval, oldlenp, newval, newlen); |
84 | if (ret == 0 && newval && newlen) { | 84 | if (ret == 0 && newval && newlen) { |
85 | if (range[1] < range[0]) | 85 | if (range[1] < range[0]) |
86 | ret = -EINVAL; | 86 | ret = -EINVAL; |
@@ -109,8 +109,8 @@ static int proc_tcp_congestion_control(ctl_table *ctl, int write, struct file * | |||
109 | return ret; | 109 | return ret; |
110 | } | 110 | } |
111 | 111 | ||
112 | static int sysctl_tcp_congestion_control(ctl_table *table, int __user *name, | 112 | static int sysctl_tcp_congestion_control(ctl_table *table, |
113 | int nlen, void __user *oldval, | 113 | void __user *oldval, |
114 | size_t __user *oldlenp, | 114 | size_t __user *oldlenp, |
115 | void __user *newval, size_t newlen) | 115 | void __user *newval, size_t newlen) |
116 | { | 116 | { |
@@ -122,7 +122,7 @@ static int sysctl_tcp_congestion_control(ctl_table *table, int __user *name, | |||
122 | int ret; | 122 | int ret; |
123 | 123 | ||
124 | tcp_get_default_congestion_control(val); | 124 | tcp_get_default_congestion_control(val); |
125 | ret = sysctl_string(&tbl, name, nlen, oldval, oldlenp, newval, newlen); | 125 | ret = sysctl_string(&tbl, oldval, oldlenp, newval, newlen); |
126 | if (ret == 1 && newval && newlen) | 126 | if (ret == 1 && newval && newlen) |
127 | ret = tcp_set_default_congestion_control(val); | 127 | ret = tcp_set_default_congestion_control(val); |
128 | return ret; | 128 | return ret; |
@@ -165,8 +165,8 @@ static int proc_allowed_congestion_control(ctl_table *ctl, | |||
165 | return ret; | 165 | return ret; |
166 | } | 166 | } |
167 | 167 | ||
168 | static int strategy_allowed_congestion_control(ctl_table *table, int __user *name, | 168 | static int strategy_allowed_congestion_control(ctl_table *table, |
169 | int nlen, void __user *oldval, | 169 | void __user *oldval, |
170 | size_t __user *oldlenp, | 170 | size_t __user *oldlenp, |
171 | void __user *newval, | 171 | void __user *newval, |
172 | size_t newlen) | 172 | size_t newlen) |
@@ -179,7 +179,7 @@ static int strategy_allowed_congestion_control(ctl_table *table, int __user *nam | |||
179 | return -ENOMEM; | 179 | return -ENOMEM; |
180 | 180 | ||
181 | tcp_get_available_congestion_control(tbl.data, tbl.maxlen); | 181 | tcp_get_available_congestion_control(tbl.data, tbl.maxlen); |
182 | ret = sysctl_string(&tbl, name, nlen, oldval, oldlenp, newval, newlen); | 182 | ret = sysctl_string(&tbl, oldval, oldlenp, newval, newlen); |
183 | if (ret == 1 && newval && newlen) | 183 | if (ret == 1 && newval && newlen) |
184 | ret = tcp_set_allowed_congestion_control(tbl.data); | 184 | ret = tcp_set_allowed_congestion_control(tbl.data); |
185 | kfree(tbl.data); | 185 | kfree(tbl.data); |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 7b6a584b62dd..eea9542728ca 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -3982,7 +3982,6 @@ int addrconf_sysctl_forward(ctl_table *ctl, int write, struct file * filp, | |||
3982 | } | 3982 | } |
3983 | 3983 | ||
3984 | static int addrconf_sysctl_forward_strategy(ctl_table *table, | 3984 | static int addrconf_sysctl_forward_strategy(ctl_table *table, |
3985 | int __user *name, int nlen, | ||
3986 | void __user *oldval, | 3985 | void __user *oldval, |
3987 | size_t __user *oldlenp, | 3986 | size_t __user *oldlenp, |
3988 | void __user *newval, size_t newlen) | 3987 | void __user *newval, size_t newlen) |
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 840b15780a36..7f39e9b36456 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -1730,9 +1730,8 @@ int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, struct file * f | |||
1730 | return ret; | 1730 | return ret; |
1731 | } | 1731 | } |
1732 | 1732 | ||
1733 | int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl, int __user *name, | 1733 | int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl, |
1734 | int nlen, void __user *oldval, | 1734 | void __user *oldval, size_t __user *oldlenp, |
1735 | size_t __user *oldlenp, | ||
1736 | void __user *newval, size_t newlen) | 1735 | void __user *newval, size_t newlen) |
1737 | { | 1736 | { |
1738 | struct net_device *dev = ctl->extra1; | 1737 | struct net_device *dev = ctl->extra1; |
@@ -1745,13 +1744,11 @@ int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl, int __user *name, | |||
1745 | 1744 | ||
1746 | switch (ctl->ctl_name) { | 1745 | switch (ctl->ctl_name) { |
1747 | case NET_NEIGH_REACHABLE_TIME: | 1746 | case NET_NEIGH_REACHABLE_TIME: |
1748 | ret = sysctl_jiffies(ctl, name, nlen, | 1747 | ret = sysctl_jiffies(ctl, oldval, oldlenp, newval, newlen); |
1749 | oldval, oldlenp, newval, newlen); | ||
1750 | break; | 1748 | break; |
1751 | case NET_NEIGH_RETRANS_TIME_MS: | 1749 | case NET_NEIGH_RETRANS_TIME_MS: |
1752 | case NET_NEIGH_REACHABLE_TIME_MS: | 1750 | case NET_NEIGH_REACHABLE_TIME_MS: |
1753 | ret = sysctl_ms_jiffies(ctl, name, nlen, | 1751 | ret = sysctl_ms_jiffies(ctl, oldval, oldlenp, newval, newlen); |
1754 | oldval, oldlenp, newval, newlen); | ||
1755 | break; | 1752 | break; |
1756 | default: | 1753 | default: |
1757 | ret = 0; | 1754 | ret = 0; |