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]
Date:	Mon, 20 Jan 2014 15:30:46 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	James Hogan <james.hogan@...tec.com>
Cc:	Chen Gang <gang.chen.5i5j@...il.com>, devel@...verdev.osuosl.org,
	andreas.dilger@...el.com, Greg KH <gregkh@...uxfoundation.org>,
	bergwolf@...il.com,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	oleg.drokin@...el.com, jacques-charles.lafoucriere@....fr,
	jinshan.xiong@...el.com, linux-metag@...r.kernel.org
Subject: Re: [PATCH] drivers: staging: lustre: lustre: include: add
 "__attribute__((packed))" for the related union

Ah.  From so metag is a new arch and not a compiler like the changelog
says.

On Mon, Jan 20, 2014 at 11:56:47AM +0000, James Hogan wrote:
> struct a {
> 	struct b {
> 		unsigned int x;
> 		unsigned short y;
> 	} x;
> 	unsigned short y;
> } __packed;

This is not the code we are discussing.  It should look like:

struct a {
	union {
		short x;
		short y;
	}
	short z;
};

Any normal person would assume that sizeof(struct a) would be 4 but
apparently on metag it is 8.  That totally defeats the point of using
a union in the first place.  It's easy enough to add a __packed to the
lustre declaration but I expect this to cause an endless stream of bugs.

It it is really stupid.

regards,
dan carpenter

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