Commit dac8853b authored by Anton Blanchard's avatar Anton Blanchard Committed by Linus Torvalds

[PATCH] Problems disabling SYSCTL

Create a cond_syscall for sys32_sysctl and make all architectures use it.
Also fix the architectures that dont wrap their 32bit compat sysctl code.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 017568f3
...@@ -1973,10 +1973,10 @@ struct sysctl32 { ...@@ -1973,10 +1973,10 @@ struct sysctl32 {
unsigned int __unused[4]; unsigned int __unused[4];
}; };
#ifdef CONFIG_SYSCTL
asmlinkage long asmlinkage long
sys32_sysctl (struct sysctl32 __user *args) sys32_sysctl (struct sysctl32 __user *args)
{ {
#ifdef CONFIG_SYSCTL
struct sysctl32 a32; struct sysctl32 a32;
mm_segment_t old_fs = get_fs (); mm_segment_t old_fs = get_fs ();
void __user *oldvalp, *newvalp; void __user *oldvalp, *newvalp;
...@@ -2015,10 +2015,8 @@ sys32_sysctl (struct sysctl32 __user *args) ...@@ -2015,10 +2015,8 @@ sys32_sysctl (struct sysctl32 __user *args)
return -EFAULT; return -EFAULT;
return ret; return ret;
#else
return -ENOSYS;
#endif
} }
#endif
asmlinkage long asmlinkage long
sys32_newuname (struct new_utsname __user *name) sys32_newuname (struct new_utsname __user *name)
......
...@@ -1192,13 +1192,6 @@ asmlinkage long sys32_sysctl(struct sysctl_args32 *args) ...@@ -1192,13 +1192,6 @@ asmlinkage long sys32_sysctl(struct sysctl_args32 *args)
return error; return error;
} }
#else /* CONFIG_SYSCTL */
asmlinkage long sys32_sysctl(struct sysctl_args32 *args)
{
return -ENOSYS;
}
#endif /* CONFIG_SYSCTL */ #endif /* CONFIG_SYSCTL */
asmlinkage long sys32_newuname(struct new_utsname * name) asmlinkage long sys32_newuname(struct new_utsname * name)
......
...@@ -165,12 +165,6 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 *args) ...@@ -165,12 +165,6 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 *args)
return error; return error;
} }
#else /* CONFIG_SYSCTL */
asmlinkage long sys32_sysctl(struct __sysctl_args *args)
{
return -ENOSYS;
}
#endif /* CONFIG_SYSCTL */ #endif /* CONFIG_SYSCTL */
asmlinkage long sys32_sched_rr_get_interval(pid_t pid, asmlinkage long sys32_sched_rr_get_interval(pid_t pid,
......
...@@ -1106,6 +1106,7 @@ asmlinkage long sys32_umask(u32 mask) ...@@ -1106,6 +1106,7 @@ asmlinkage long sys32_umask(u32 mask)
return sys_umask((int)mask); return sys_umask((int)mask);
} }
#ifdef CONFIG_SYSCTL
struct __sysctl_args32 { struct __sysctl_args32 {
u32 name; u32 name;
int nlen; int nlen;
...@@ -1155,6 +1156,7 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) ...@@ -1155,6 +1156,7 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
} }
return error; return error;
} }
#endif
asmlinkage int sys32_olduname(struct oldold_utsname __user * name) asmlinkage int sys32_olduname(struct oldold_utsname __user * name)
{ {
......
...@@ -906,6 +906,7 @@ asmlinkage long sys32_adjtimex(struct timex32 *utp) ...@@ -906,6 +906,7 @@ asmlinkage long sys32_adjtimex(struct timex32 *utp)
return ret; return ret;
} }
#ifdef CONFIG_SYSCTL
struct __sysctl_args32 { struct __sysctl_args32 {
u32 name; u32 name;
int nlen; int nlen;
...@@ -953,6 +954,7 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 *args) ...@@ -953,6 +954,7 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 *args)
} }
return error; return error;
} }
#endif
struct stat64_emu31 { struct stat64_emu31 {
unsigned long long st_dev; unsigned long long st_dev;
......
...@@ -653,6 +653,7 @@ sys32_pause(void) ...@@ -653,6 +653,7 @@ sys32_pause(void)
} }
#ifdef CONFIG_SYSCTL
struct sysctl_ia32 { struct sysctl_ia32 {
unsigned int name; unsigned int name;
int nlen; int nlen;
...@@ -667,9 +668,6 @@ struct sysctl_ia32 { ...@@ -667,9 +668,6 @@ struct sysctl_ia32 {
asmlinkage long asmlinkage long
sys32_sysctl(struct sysctl_ia32 __user *args32) sys32_sysctl(struct sysctl_ia32 __user *args32)
{ {
#ifndef CONFIG_SYSCTL
return -ENOSYS;
#else
struct sysctl_ia32 a32; struct sysctl_ia32 a32;
mm_segment_t old_fs = get_fs (); mm_segment_t old_fs = get_fs ();
void *oldvalp, *newvalp; void *oldvalp, *newvalp;
...@@ -710,8 +708,8 @@ sys32_sysctl(struct sysctl_ia32 __user *args32) ...@@ -710,8 +708,8 @@ sys32_sysctl(struct sysctl_ia32 __user *args32)
return -EFAULT; return -EFAULT;
return ret; return ret;
#endif
} }
#endif
/* warning: next two assume little endian */ /* warning: next two assume little endian */
asmlinkage long asmlinkage long
......
...@@ -82,3 +82,4 @@ cond_syscall(sys_pciconfig_read) ...@@ -82,3 +82,4 @@ cond_syscall(sys_pciconfig_read)
cond_syscall(sys_pciconfig_write) cond_syscall(sys_pciconfig_write)
cond_syscall(sys_pciconfig_iobase) cond_syscall(sys_pciconfig_iobase)
cond_syscall(sys32_ipc) cond_syscall(sys32_ipc)
cond_syscall(sys32_sysctl)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment