Re: 2.6.13rc3: crypto horribly broken on all 64bit archs

2005-07-19 Thread Andy Isaacson
On Sun, Jul 17, 2005 at 02:20:21PM +0200, Andreas Steinmetz wrote: > from include/linux/kernel.h: > > #define ALIGN(x,a) (((x)+(a)-1)&~((a)-1)) > > from crypto/cipher.c: > > unsigned int alignmask = ... > u8 *src = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); The type foolery you

Re: 2.6.13rc3: crypto horribly broken on all 64bit archs

2005-07-19 Thread Andy Isaacson
On Sun, Jul 17, 2005 at 02:20:21PM +0200, Andreas Steinmetz wrote: from include/linux/kernel.h: #define ALIGN(x,a) (((x)+(a)-1)~((a)-1)) from crypto/cipher.c: unsigned int alignmask = ... u8 *src = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); The type foolery you suggested is

Re: 2.6.13rc3: crypto horribly broken on all 64bit archs

2005-07-18 Thread David S. Miller
From: Herbert Xu <[EMAIL PROTECTED]> Date: Mon, 18 Jul 2005 06:45:54 +1000 > On Sun, Jul 17, 2005 at 02:20:21PM +0200, Andreas Steinmetz wrote: > > > > The compiler first does ~((a)-1)) and then expands the unsigned int to > > unsigned long for the & operation. So we end up with only the lower

Re: 2.6.13rc3: crypto horribly broken on all 64bit archs

2005-07-18 Thread David S. Miller
From: Herbert Xu [EMAIL PROTECTED] Date: Mon, 18 Jul 2005 06:45:54 +1000 On Sun, Jul 17, 2005 at 02:20:21PM +0200, Andreas Steinmetz wrote: The compiler first does ~((a)-1)) and then expands the unsigned int to unsigned long for the operation. So we end up with only the lower 32 bits

Re: 2.6.13rc3: crypto horribly broken on all 64bit archs

2005-07-17 Thread Herbert Xu
On Sun, Jul 17, 2005 at 02:20:21PM +0200, Andreas Steinmetz wrote: > > The compiler first does ~((a)-1)) and then expands the unsigned int to > unsigned long for the & operation. So we end up with only the lower 32 > bits of the address. Who did smoke what to do this? Patch attached. Thanks for

2.6.13rc3: crypto horribly broken on all 64bit archs

2005-07-17 Thread Andreas Steinmetz
from include/linux/kernel.h: #define ALIGN(x,a) (((x)+(a)-1)&~((a)-1)) from crypto/cipher.c: unsigned int alignmask = ... u8 *src = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); ... unsigned int alignmask = ... u8 *tmp = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); ... unsigned int

2.6.13rc3: crypto horribly broken on all 64bit archs

2005-07-17 Thread Andreas Steinmetz
from include/linux/kernel.h: #define ALIGN(x,a) (((x)+(a)-1)~((a)-1)) from crypto/cipher.c: unsigned int alignmask = ... u8 *src = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); ... unsigned int alignmask = ... u8 *tmp = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); ... unsigned int

Re: 2.6.13rc3: crypto horribly broken on all 64bit archs

2005-07-17 Thread Herbert Xu
On Sun, Jul 17, 2005 at 02:20:21PM +0200, Andreas Steinmetz wrote: The compiler first does ~((a)-1)) and then expands the unsigned int to unsigned long for the operation. So we end up with only the lower 32 bits of the address. Who did smoke what to do this? Patch attached. Thanks for the