diff options
Diffstat (limited to 'arch/mips/kernel/linux32.c')
-rw-r--r-- | arch/mips/kernel/linux32.c | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index b77fefaff9da..1a2793efdc4e 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c | |||
@@ -265,67 +265,6 @@ SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz, | |||
265 | } | 265 | } |
266 | #endif | 266 | #endif |
267 | 267 | ||
268 | struct sysctl_args32 | ||
269 | { | ||
270 | compat_caddr_t name; | ||
271 | int nlen; | ||
272 | compat_caddr_t oldval; | ||
273 | compat_caddr_t oldlenp; | ||
274 | compat_caddr_t newval; | ||
275 | compat_size_t newlen; | ||
276 | unsigned int __unused[4]; | ||
277 | }; | ||
278 | |||
279 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
280 | |||
281 | SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args) | ||
282 | { | ||
283 | struct sysctl_args32 tmp; | ||
284 | int error; | ||
285 | size_t oldlen; | ||
286 | size_t __user *oldlenp = NULL; | ||
287 | unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7; | ||
288 | |||
289 | if (copy_from_user(&tmp, args, sizeof(tmp))) | ||
290 | return -EFAULT; | ||
291 | |||
292 | if (tmp.oldval && tmp.oldlenp) { | ||
293 | /* Duh, this is ugly and might not work if sysctl_args | ||
294 | is in read-only memory, but do_sysctl does indirectly | ||
295 | a lot of uaccess in both directions and we'd have to | ||
296 | basically copy the whole sysctl.c here, and | ||
297 | glibc's __sysctl uses rw memory for the structure | ||
298 | anyway. */ | ||
299 | if (get_user(oldlen, (u32 __user *)A(tmp.oldlenp)) || | ||
300 | put_user(oldlen, (size_t __user *)addr)) | ||
301 | return -EFAULT; | ||
302 | oldlenp = (size_t __user *)addr; | ||
303 | } | ||
304 | |||
305 | lock_kernel(); | ||
306 | error = do_sysctl((int __user *)A(tmp.name), tmp.nlen, (void __user *)A(tmp.oldval), | ||
307 | oldlenp, (void __user *)A(tmp.newval), tmp.newlen); | ||
308 | unlock_kernel(); | ||
309 | if (oldlenp) { | ||
310 | if (!error) { | ||
311 | if (get_user(oldlen, (size_t __user *)addr) || | ||
312 | put_user(oldlen, (u32 __user *)A(tmp.oldlenp))) | ||
313 | error = -EFAULT; | ||
314 | } | ||
315 | copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)); | ||
316 | } | ||
317 | return error; | ||
318 | } | ||
319 | |||
320 | #else | ||
321 | |||
322 | SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args) | ||
323 | { | ||
324 | return -ENOSYS; | ||
325 | } | ||
326 | |||
327 | #endif /* CONFIG_SYSCTL_SYSCALL */ | ||
328 | |||
329 | SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name) | 268 | SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name) |
330 | { | 269 | { |
331 | int ret = 0; | 270 | int ret = 0; |