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: <1461681643.2726.140.camel@perches.com>
Date:	Tue, 26 Apr 2016 07:40:43 -0700
From:	Joe Perches <joe@...ches.com>
To:	Gustavo Padovan <gustavo.padovan@...labora.co.uk>,
	Lucas Stach <l.stach@...gutronix.de>
Cc:	Gustavo Padovan <gustavo@...ovan.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	devel@...verdev.osuosl.org, Daniel Stone <daniels@...labora.com>,
	Daniel Vetter <daniel.vetter@...ll.ch>,
	Riley Andrews <riandrews@...roid.com>,
	dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
	Arve Hjønnevåg <arve@...roid.com>,
	Daniel Vetter <daniel.vetter@...el.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	John Harrison <John.C.Harrison@...el.com>
Subject: Re: [PATCH v12 1/2] kernel.h: add u64_to_user_ptr()

On Tue, 2016-04-26 at 11:29 -0300, Gustavo Padovan wrote:
> 2016-04-26 Lucas Stach <l.stach@...gutronix.de>:
> > Am Donnerstag, den 21.04.2016, 12:38 -0300 schrieb Gustavo Padovan:
> > > From: Gustavo Padovan <gustavo.padovan@...labora.co.uk>
> > > 
> > > This function had copies in 3 different files. Unify them in kernel.h.
> > > 
> > > Cc: Joe Perches <joe@...ches.com>
> > > Cc: Andrew Morton <akpm@...ux-foundation.org>
> > > Cc: David Airlie <airlied@...ux.ie>
> > > Cc: Daniel Vetter <daniel.vetter@...el.com>
> > > Cc: Rob Clark <robdclark@...il.com>
> > > Signed-off-by: Gustavo Padovan <gustavo.padovan@...labora.co.uk>
> > > 
> > Though I normally prefer static inline functions, I see the benefits of
> > using the macro form here.

An inline could still work
	static inline void __user *u64_to_user_ptr(u64 address)
	{
		return (void __user *)(uintptr_t)address;
	}
if the macro was
	#define u64_to_user_ptr(x)		\
	({					\
		typecheck(u64, x);		\
		(u64_to_user_ptr)(x);		\
	})

the parenthesis around the u64_to_user_ptr
in the macro should prevent expansion.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ