aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/parisc/kernel/sys_parisc32.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
index e3b30bc36453..e0e4e0bfcc6b 100644
--- a/arch/parisc/kernel/sys_parisc32.c
+++ b/arch/parisc/kernel/sys_parisc32.c
@@ -111,13 +111,14 @@ struct __sysctl_args32 {
111 111
112asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) 112asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
113{ 113{
114#ifndef CONFIG_SYSCTL_SYSCALL
115 return -ENOSYS;
116#else
114 struct __sysctl_args32 tmp; 117 struct __sysctl_args32 tmp;
115 int error; 118 int error;
116 unsigned int oldlen32; 119 unsigned int oldlen32;
117 size_t oldlen, *oldlenp = NULL; 120 size_t oldlen, __user *oldlenp = NULL;
118 unsigned long addr = (((long __force)&args->__unused[0]) + 7) & ~7; 121 unsigned long addr = (((long __force)&args->__unused[0]) + 7) & ~7;
119 extern int do_sysctl(int *name, int nlen, void *oldval, size_t *oldlenp,
120 void *newval, size_t newlen);
121 122
122 DBG(("sysctl32(%p)\n", args)); 123 DBG(("sysctl32(%p)\n", args));
123 124
@@ -144,8 +145,9 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
144 } 145 }
145 146
146 lock_kernel(); 147 lock_kernel();
147 error = do_sysctl((int *)(u64)tmp.name, tmp.nlen, (void *)(u64)tmp.oldval, 148 error = do_sysctl((int __user *)(u64)tmp.name, tmp.nlen,
148 oldlenp, (void *)(u64)tmp.newval, tmp.newlen); 149 (void __user *)(u64)tmp.oldval, oldlenp,
150 (void __user *)(u64)tmp.newval, tmp.newlen);
149 unlock_kernel(); 151 unlock_kernel();
150 if (oldlenp) { 152 if (oldlenp) {
151 if (!error) { 153 if (!error) {
@@ -157,10 +159,11 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
157 error = -EFAULT; 159 error = -EFAULT;
158 } 160 }
159 } 161 }
160 if (copy_to_user(&args->__unused[0], tmp.__unused, sizeof(tmp.__unused))) 162 if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)))
161 error = -EFAULT; 163 error = -EFAULT;
162 } 164 }
163 return error; 165 return error;
166#endif
164} 167}
165 168
166#endif /* CONFIG_SYSCTL */ 169#endif /* CONFIG_SYSCTL */