Re: [PATCH] implement generic rtc compat ioctl handling

From: Arnd Bergmann
Date: Mon Nov 14 2005 - 07:07:52 EST


On Freedag 11 November 2005 10:20, Christoph Hellwig wrote:
> +static int rtc_ioctl(unsigned fd, unsigned cmd, unsigned long arg)
> +{
> +       compat_ulong_t __user *val = compat_alloc_user_space(sizeof(*val));
> +       compat_ulong_t __user *uval = (compat_ulong_t __user *)arg;
> +       int ret;
> +
>
This one should really be

compat_ulong_t __user *uval = compat_ptr(arg);

It's not really a problem since the only architecture where compat_ptr()
makes a difference (64 bit s390) doesn't have an RTC driver, but it
should be changed nevertheless.

Also, I suppose the declaration of val is wrong, since the ioctl methods
expect a pointer to an unsigned long, not a compat_ulong_t. If you
change that, the copy_in_user() won't work either.

Arnd <><
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/