lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <21799.1437487573@warthog.procyon.org.uk>
Date:	Tue, 21 Jul 2015 15:06:13 +0100
From:	David Howells <dhowells@...hat.com>
To:	Yoshinori Sato <ysato@...rs.sourceforge.jp>
Cc:	dhowells@...hat.com, Arnd Bergmann <arnd@...db.de>,
	linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] asm-generic: {get,put}_user ptr argument evaluate only 1 time

Yoshinori Sato <ysato@...rs.sourceforge.jp> wrote:

>  #define get_user(x, ptr)					\
>  ({								\
> +	uintptr_t __uip = (uintptr_t)(ptr);			\

const?

>  	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?

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ