Re: [PATCH] lib/sha1: remove memsets and allocate workspace on the stack

2011-08-09 Thread Geert Uytterhoeven
On Tue, Aug 9, 2011 at 01:45, Joe Perches wrote: > You should add #include to > lib/sha1.c and perhaps rationalize the use of __u8 > and char for the second argument to sha_transform in > the definition and uses. > > For defense in depth, a bool could be added to sha_transform > like: > > void sh

Re: [PATCH] lib/sha1: remove memsets and allocate workspace on the stack

2011-08-08 Thread Mandeep Singh Baines
Joe Perches (j...@perches.com) wrote: > On Mon, 2011-08-08 at 16:07 -0700, Mandeep Singh Baines wrote: > > The previous implementation required the workspace to be passed in as > > a parameter. This prevents the compiler from being able to store the > > workspace in registers. I've also removed the

Re: [PATCH] lib/sha1: remove memsets and allocate workspace on the stack

2011-08-08 Thread Linus Torvalds
On Mon, Aug 8, 2011 at 4:07 PM, Mandeep Singh Baines wrote: > > There is no loss of security due to removing the memset. It would be a > bug for the stack to leak to userspace. However, a defence-in-depth > argument could be made for keeping the clearing of the workspace. So I'm nervous about thi

Re: [PATCH] lib/sha1: remove memsets and allocate workspace on the stack

2011-08-08 Thread Joe Perches
On Mon, 2011-08-08 at 16:07 -0700, Mandeep Singh Baines wrote: > The previous implementation required the workspace to be passed in as > a parameter. This prevents the compiler from being able to store the > workspace in registers. I've also removed the memset since that also > prevents the compile

[PATCH] lib/sha1: remove memsets and allocate workspace on the stack

2011-08-08 Thread Mandeep Singh Baines
The previous implementation required the workspace to be passed in as a parameter. This prevents the compiler from being able to store the workspace in registers. I've also removed the memset since that also prevents the compiler from storing the workspace in registers. There is no loss of securit