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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141016094804.GB1273@katana>
Date:	Thu, 16 Oct 2014 11:48:04 +0200
From:	Wolfram Sang <wsa@...-dreams.de>
To:	Greg KH <gregkh@...uxfoundation.org>
Cc:	Andreas Werner <andreas.werner@....de>,
	linux-kernel@...r.kernel.org, linux-i2c@...r.kernel.org,
	johannes.thumshirn@....de
Subject: Re: [PATCH 1/2] drivers/misc/eeprom/men_eeprod: Introduce MEN Board
 Information EEPROM driver

On Thu, Oct 16, 2014 at 11:34:14AM +0200, Greg KH wrote:
> On Thu, Oct 16, 2014 at 10:58:35AM +0200, Wolfram Sang wrote:
> > > +struct eeprom_data {
> > > +	uint8_t eeprod_id;
> > > +
> > > +	uint8_t revision[3];
> > > +	uint32_t serialnr;
> > > +	uint8_t board_model;
> > > +	char hw_name[6];
> > > +
> > > +	uint8_t reserved;
> > > +
> > > +	__be16 prod_date;
> > > +	__be16 rep_date;
> > > +
> > > +	uint8_t reserved2[4];
> > > +};
> > 
> > And what if the compiler reorders?
> 
> It's not allowed to reorder, but it can add padding wherever it wants
> to, which if this is a on-device structure, can cause problems.  Use
> __packed to prevent that.

Yes, took the wrong word, sorry, I meant __packed.


Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ