Re: [PATCH] implement generic rtc compat ioctl handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux