Commit 167fac26 authored by Jesper Juhl's avatar Jesper Juhl Committed by Linus Torvalds

[PATCH] ds_ioctl.c usercopy check

Patch adds a check of the return value and returns -EFAULT if
__copy_to_user fails.
Signed-off-by: default avatarJesper Juhl <juhl-lkml@dif.dk>
Acked-by: default avatarRussell King <rmk@arm.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8b7ea2cc
......@@ -1060,7 +1060,11 @@ static int ds_ioctl(struct inode * inode, struct file * file,
}
}
if (cmd & IOC_OUT) __copy_to_user(uarg, (char *)&buf, size);
if (cmd & IOC_OUT) {
if (__copy_to_user(uarg, (char *)&buf, size))
err = -EFAULT;
}
return err;
} /* ds_ioctl */
......
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