aboutsummaryrefslogtreecommitdiff
path: root/fs/autofs4/dev-ioctl.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2009-04-30 15:36:52 +0000
committerSteve French <sfrench@us.ibm.com>2009-04-30 15:36:52 +0000
commit912bc6ae3de99c7bada4577d4341ace4ee59b5be (patch)
tree28fd1a4bb9e4b05aa833285b46df169f12c0e24d /fs/autofs4/dev-ioctl.c
parentd37dc42ab6f040b8f0f2962ab219c5b2accf748d (diff)
parent091438dd5668396328a3419abcbc6591159eb8d1 (diff)
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'fs/autofs4/dev-ioctl.c')
-rw-r--r--fs/autofs4/dev-ioctl.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/autofs4/dev-ioctl.c b/fs/autofs4/dev-ioctl.c
index 9e5ae8a4f5c..84168c0dcc2 100644
--- a/fs/autofs4/dev-ioctl.c
+++ b/fs/autofs4/dev-ioctl.c
@@ -54,11 +54,10 @@ static int check_name(const char *name)
* Check a string doesn't overrun the chunk of
* memory we copied from user land.
*/
-static int invalid_str(char *str, void *end)
+static int invalid_str(char *str, size_t size)
{
- while ((void *) str <= end)
- if (!*str++)
- return 0;
+ if (memchr(str, 0, size))
+ return 0;
return -EINVAL;
}
@@ -138,8 +137,7 @@ static int validate_dev_ioctl(int cmd, struct autofs_dev_ioctl *param)
}
if (param->size > sizeof(*param)) {
- err = invalid_str(param->path,
- (void *) ((size_t) param + param->size));
+ err = invalid_str(param->path, param->size - sizeof(*param));
if (err) {
AUTOFS_WARN(
"path string terminator missing for cmd(0x%08x)",
@@ -488,7 +486,7 @@ static int autofs_dev_ioctl_requester(struct file *fp,
}
path = param->path;
- devid = sbi->sb->s_dev;
+ devid = new_encode_dev(sbi->sb->s_dev);
param->requester.uid = param->requester.gid = -1;