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: <20070225054547.GB7941@infradead.org>
Date:	Sun, 25 Feb 2007 05:45:48 +0000
From:	Christoph Hellwig <hch@...radead.org>
To:	Artem Bityutskiy <dedekind@...radead.org>
Cc:	David Woodhouse <dwmw2@...radead.org>,
	Theodore Tso <tytso@....edu>,
	Christoph Hellwig <hch@...radead.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Frank Haverkamp <haver@...t.ibm.com>,
	Josh Boyer <jwboyer@...ux.vnet.ibm.com>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 05/44 take 2] [UBI] internal common header

On Tue, Feb 20, 2007 at 05:24:15PM +0200, Artem Bityutskiy wrote:
> On Tue, 2007-02-20 at 15:15 +0000, David Woodhouse wrote:
> > On Tue, 2007-02-20 at 09:55 -0500, Theodore Tso wrote:
> > > It appears that the reason why you are doing this is because you think
> > > you need the (packed) attribute.  Not needed; Linux assumes all over
> > > the place 16, 32, and 64 types are packed.  If Linux is ever compiled
> > > on an architecture where this isn't true, the compiler will probably
> > > need to be fixed so these assumptions are true, since all manner of
> > > things will break.
> > 
> > No, the packedness is irrelevant -- the reason is just to catch all the
> > places where you might otherwise forget to use byte-swapping accesses.
> 
> Bear in mind we share this header with user-space, so it is safer to use
> packed as well as C99 types.

It's definitively not safe for userspace - packed is not an ISO C thing
and there's no guarantee userspace compilers understand it.   Also you
really don't want to use packed in new code, if you really need oddly
aligned types it's much better to use byte arrays.
-
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