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] [day] [month] [year] [list]
Message-ID: <1308331877.2653.65.camel@localhost>
Date:	Fri, 17 Jun 2011 19:31:17 +0200
From:	Jonas Bonn <jonas@...thpole.se>
To:	linux-kernel@...r.kernel.org
Cc:	linux@...ts.openrisc.net
Subject: Re: [PATCH 1/1] Apply transparent_union attribute to union semun


Hi,
I never got any feedback on this patch... is this an acceptable solution
for upstream?  ...or is the usage of this GCC extension discouraged?
/Jonas

On Fri, 2011-05-27 at 00:27 +0200, jonas@...thpole.se wrote:
> From: Jonas Bonn <jonas@...thpole.se>
> 
> The syscall handler for semctl is written under the assumption that the
> toolchain will pass "small" unions as function parameters directly instead
> of by reference.  The union semun is "small" and thus fits this description.
> 
> Since it is assumed that the union will be passed directly and not by
> reference, it is safe to access the union members without going via
> get_user.
> 
> The OpenRISC architecture, however, passes all unions by reference, thus
> breaking the above assumption.
> 
> The technically correct fix here is to mark the union as being transparent
> so that the ABI of the union's first element determines the parameter
> passing method and thus make explicit what's already implied in the function
> definition.
> 
> Signed-off-by: Jonas Bonn <jonas@...thpole.se>
> ---
>  include/linux/sem.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/include/linux/sem.h b/include/linux/sem.h
> index f2961af..6985c7d 100644
> --- a/include/linux/sem.h
> +++ b/include/linux/sem.h
> @@ -48,7 +48,7 @@ union semun {
>  	unsigned short __user *array;	/* array for GETALL & SETALL */
>  	struct seminfo __user *__buf;	/* buffer for IPC_INFO */
>  	void __user *__pad;
> -};
> +} __attribute__ ((transparent_union));
>  
>  struct  seminfo {
>  	int semmap;


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