Re: [PATCH 1/1] crypto: Undefined behaviour in crypto_aes_expand_key

2009-07-23 Thread Herbert Xu
On Wed, Jul 22, 2009 at 05:57:03PM +0300, Phil Carmody wrote: > It's undefined behaviour in C to write outside the bounds of an array. > The key expansion routine takes a shortcut of creating 8 words at a > time, but this creates 4 additional words which don't fit in the array. > > As everyone is

[PATCH 1/1] crypto: Undefined behaviour in crypto_aes_expand_key

2009-07-22 Thread Phil Carmody
It's undefined behaviour in C to write outside the bounds of an array. The key expansion routine takes a shortcut of creating 8 words at a time, but this creates 4 additional words which don't fit in the array. As everyone is hopefully now aware, GCC is at liberty to make any assumptions and optim