From: Marek Vasut Date: Fri, 14 Mar 2014 01:37:04 +0000 (+0100) Subject: crypto: hash - Fix the pointer voodoo in unaligned ahash X-Git-Tag: v3.2.89~17 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cd39b9d24d65e47bb85c2f793f315ddd5475118;p=pandora-kernel.git crypto: hash - Fix the pointer voodoo in unaligned ahash commit ab6bf4e5e5e4298e8649e635bee25542cccbfd97 upstream. Add documentation for the pointer voodoo that is happening in crypto/ahash.c in ahash_op_unaligned(). This code is quite confusing, so add a beefy chunk of documentation. Moreover, make sure the mangled request is completely restored after finishing this unaligned operation. This means restoring all of .result, .base.data and .base.complete . Also, remove the crypto_completion_t complete = ... line present in the ahash_op_unaligned_done() function. This type actually declares a function pointer, which is very confusing. Finally, yet very important nonetheless, make sure the req->priv is free()'d only after the original request is restored in ahash_op_unaligned_done(). The req->priv data must not be free()'d before that in ahash_op_unaligned_finish(), since we would be accessing previously free()'d data in ahash_op_unaligned_done() and cause corruption. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Fabio Estevam Cc: Herbert Xu Cc: Shawn Guo Cc: Tom Lendacky Signed-off-by: Herbert Xu Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed