Re: [PATCH v3] asm-generic: {get,put}_user ptr argument evaluate only 1 time

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

 



On Tue, 21 Jul 2015 23:06:13 +0900,
David Howells wrote:
> 
> Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx> wrote:
> 
> >  #define get_user(x, ptr)					\
> >  ({								\
> > +	uintptr_t __uip = (uintptr_t)(ptr);			\
> 
> const?

OK.

> >  	might_fault();						\
> > -	access_ok(VERIFY_READ, ptr, sizeof(*ptr)) ?		\
> > -		__get_user(x, ptr) :				\
> > +	access_ok(VERIFY_READ, __uip, sizeof(*ptr)) ?		\
> > +		__get_user((x), (__typeof__(*ptr) *)__uip) :	\
> >  		-EFAULT;					\
> >  })
> 
> Would it be better to use void* instead of uintptr_t?

No reason.
I'll changed void*

Thanks.

> David

-- 
Yoshinori Sato
<ysato@xxxxxxxxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux