Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170002
b: refs/heads/master
c: f78a9a5
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman committed Nov 6, 2009
1 parent 2b94640 commit eb0398a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 73 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aff639cdcfe7450e04109be3759faa8f1e5572f5
refs/heads/master: f78a9a5a56418d955f3119cf7380ea911ab4baf6
71 changes: 0 additions & 71 deletions trunk/arch/parisc/kernel/sys_parisc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,77 +90,6 @@ asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23,
return -ENOSYS;
}

#ifdef CONFIG_SYSCTL

struct __sysctl_args32 {
u32 name;
int nlen;
u32 oldval;
u32 oldlenp;
u32 newval;
u32 newlen;
u32 __unused[4];
};

asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
{
#ifndef CONFIG_SYSCTL_SYSCALL
return -ENOSYS;
#else
struct __sysctl_args32 tmp;
int error;
unsigned int oldlen32;
size_t oldlen, __user *oldlenp = NULL;
unsigned long addr = (((long __force)&args->__unused[0]) + 7) & ~7;

DBG(("sysctl32(%p)\n", args));

if (copy_from_user(&tmp, args, sizeof(tmp)))
return -EFAULT;

if (tmp.oldval && tmp.oldlenp) {
/* Duh, this is ugly and might not work if sysctl_args
is in read-only memory, but do_sysctl does indirectly
a lot of uaccess in both directions and we'd have to
basically copy the whole sysctl.c here, and
glibc's __sysctl uses rw memory for the structure
anyway. */
/* a possibly better hack than this, which will avoid the
* problem if the struct is read only, is to push the
* 'oldlen' value out to the user's stack instead. -PB
*/
if (get_user(oldlen32, (u32 *)(u64)tmp.oldlenp))
return -EFAULT;
oldlen = oldlen32;
if (put_user(oldlen, (size_t *)addr))
return -EFAULT;
oldlenp = (size_t *)addr;
}

lock_kernel();
error = do_sysctl((int __user *)(u64)tmp.name, tmp.nlen,
(void __user *)(u64)tmp.oldval, oldlenp,
(void __user *)(u64)tmp.newval, tmp.newlen);
unlock_kernel();
if (oldlenp) {
if (!error) {
if (get_user(oldlen, (size_t *)addr)) {
error = -EFAULT;
} else {
oldlen32 = oldlen;
if (put_user(oldlen32, (u32 *)(u64)tmp.oldlenp))
error = -EFAULT;
}
}
if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)))
error = -EFAULT;
}
return error;
#endif
}

#endif /* CONFIG_SYSCTL */

asmlinkage long sys32_sched_rr_get_interval(pid_t pid,
struct compat_timespec __user *interval)
{
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/parisc/kernel/syscall_table.S
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
ENTRY_SAME(getsid)
ENTRY_SAME(fdatasync)
/* struct __sysctl_args is a mess */
ENTRY_DIFF(sysctl)
ENTRY_COMP(sysctl)
ENTRY_SAME(mlock) /* 150 */
ENTRY_SAME(munlock)
ENTRY_SAME(mlockall)
Expand Down

0 comments on commit eb0398a

Please sign in to comment.