Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1189667

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

From Yoshinori Sato <ysato@users.sourceforge.jp>
Newsgroups linux.kernel
Subject Re: [PATCH v3] asm-generic: {get,put}_user ptr argument evaluate only 1 time
Date 2015-07-22 08:10 +0200
Message-ID <pOVo6-6MK-3@gated-at.bofh.it> (permalink)
References <pOz4d-8rH-9@gated-at.bofh.it> <pMJKq-5my-11@gated-at.bofh.it> <pOGp4-279-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 21 Jul 2015 23:06:13 +0900,
David Howells wrote:
> 
> Yoshinori Sato <ysato@users.sourceforge.jp> 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@users.sourceforge.jp>
--
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/

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH v3] asm-generic: {get,put}_user ptr argument evaluate only 1 time Yoshinori Sato <ysato@users.sourceforge.jp> - 2015-07-21 08:20 +0200
  Re: [PATCH v3] asm-generic: {get,put}_user ptr argument evaluate only 1 time Yoshinori Sato <ysato@users.sourceforge.jp> - 2015-07-22 08:10 +0200

csiph-web