Skip to content

Commit

Permalink
[PATCH] compat_sys_nfsservctl(): handle errors correctly
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Neil Brown <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Peter Staubach authored and Linus Torvalds committed Mar 25, 2006
1 parent 30087ba commit 57070d0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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() */
Expand Down

0 comments on commit 57070d0

Please sign in to comment.