mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
[PATCH] compat_sys_nfsservctl(): handle errors correctly
Correct some error handling on the compat version of the nfsservctl() system. It was detecting errors while copying in the arguments from user space, but then attempting to use the arguments anyway. This didn't seem so good. Signed-off-by: Peter Staubach <staubach@redhat.com> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Cc: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
30087baf88
commit
57070d012c
1 changed files with 4 additions and 1 deletions
|
@ -2170,9 +2170,12 @@ asmlinkage long compat_sys_nfsservctl(int cmd, struct compat_nfsctl_arg __user *
|
|||
|
||||
default:
|
||||
err = -EINVAL;
|
||||
goto done;
|
||||
break;
|
||||
}
|
||||
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
oldfs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
/* The __user pointer casts are valid because of the set_fs() */
|
||||
|
|
Loading…
Reference in a new issue