Re: [RFC][2.5] generic_usercopy() function (resend, forgot the patches)

David Wagner (daw@mozart.cs.berkeley.edu)
30 May 2003 00:25:54 GMT


Michael Hunold wrote:
> /*
>- * helper function -- handles userspace copying for ioctl arguments
>- */
>-int
>-video_usercopy(struct inode *inode, struct file *file,
>- unsigned int cmd, unsigned long arg,
>- int (*func)(struct inode *inode, struct file *file,
>- unsigned int cmd, void *arg))
>-{
...
>- if (copy_from_user(parg, (void *)arg, _IOC_SIZE(cmd)))
...
>- err = func(inode, file, cmd, parg);
...

What about doubly-indirected pointers? i.e., arg is a pointer
to a structure that itself contains a pointer? Can this happen?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/