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:	Tue, 12 May 2015 12:53:34 -0700
From:	Joe Perches <joe@...ches.com>
To:	Mateusz Kulikowski <mateusz.kulikowski@...il.com>
Cc:	gregkh@...uxfoundation.org, dan.carpenter@...cle.com,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 01/33] staging: rtl8192e: Declare ethernet addresses
 as __aligned(2)

On Tue, 2015-05-12 at 21:44 +0200, Mateusz Kulikowski wrote:
> On 10.05.2015 00:29, Joe Perches wrote:
> > On Sat, 2015-05-09 at 23:18 +0200, Mateusz Kulikowski wrote:
> >> Add __aligned(2) into ethernet addresses allocated on stack or in non-packed
> >> structures. Use ETH_ALEN as array length in places where it was hardcoded to 6.
> > []
> >> diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
> > []
> >> @@ -321,7 +321,8 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
> >>  	u8 ICVer8192, ICVer8256;
> >>  	u16 i, usValue, IC_Version;
> >>  	u16 EEPROMId;
> >> -	u8 bMac_Tmp_Addr[6] = {0x00, 0xe0, 0x4c, 0x00, 0x00, 0x01};
> >> +	u8 bMac_Tmp_Addr[ETH_ALEN] __aligned(2) = {0x00, 0xe0, 0x4c,
> >> +						   0x00, 0x00, 0x01};
> > 
> > While this is safe, as this follows a u16, it's unnecessary.
> > 
> > Also, ideally, this would be
> > 	u8 foo[ETH_ALEN] = {
> > 		1, 2, 3, 4, 5, 6
> > 	};
> > or just left on a single line.
> 
> I put __aligned to most places to show authors intention and to prevent someone from breaking it by 
> (for example) removing u16 above due some refactoring.
> 
> If you insist - I will remove it.

I'm not very insistent.


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