https://bugzilla.novell.com/show_bug.cgi?id=443693
User matz@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=443693#c14
--- Comment #14 from Michael Matz 2008-11-11 09:01:41 MST ---
It seems -fno-strict-aliasing works around the problem. Looking at rijndael.c
it's obvious that it has heavy aliasing problems:
union
{
u32 tempu32[4]; /* Force correct alignment. */
byte temp[4][4];
} u;
*((u32*)u.temp[0]) = *((u32*)(a )) ^ *((u32*)rk[0][0]);
*((u32*)u.temp[1]) = *((u32*)(a+ 4)) ^ *((u32*)rk[0][1]);
*((u32*)u.temp[2]) = *((u32*)(a+ 8)) ^ *((u32*)rk[0][2]);
*((u32*)u.temp[3]) = *((u32*)(a+12)) ^ *((u32*)rk[0][3]);
*((u32*)(b )) = (*((u32*)T1[u.temp[0][0]])
...
So, it defines a union which could be used for getting around the alias
problems (and all the casts), but the tempu32 member is used nowhere. Aliasing
problems are for instance here:
*((u32*)u.temp[0]) = *((u32*)(a )) ^ *((u32*)rk[0][0]);
vs.
*((u32*)(b )) = (*((u32*)T1[u.temp[0][0]])
The first write stores into a u32, while the later read of u.temp[0][0]
accesses a byte --> potentially boom.
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.