From: Mathias Krause Date: Mon, 24 Mar 2014 16:10:38 +0000 (+0100) Subject: crypto: x86/sha1 - fix stack alignment of AVX2 variant X-Git-Tag: v3.15-rc1~111^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c8c17cc7a8806dde074d7c0bf4d519dd4d028c5;p=pandora-kernel.git crypto: x86/sha1 - fix stack alignment of AVX2 variant The AVX2 implementation might waste up to a page of stack memory because of a wrong alignment calculation. This will, in the worst case, increase the stack usage of sha1_transform_avx2() alone to 5.4 kB -- way to big for a kernel function. Even worse, it might also allocate *less* bytes than needed if the stack pointer is already aligned bacause in that case the 'sub %rbx, %rsp' is effectively moving the stack pointer upwards, not downwards. Fix those issues by changing and simplifying the alignment calculation to use a 32 byte alignment, the alignment really needed. Cc: Chandramouli Narayanan Signed-off-by: Mathias Krause Reviewed-by: H. Peter Anvin Reviewed-by: Marek Vasut Signed-off-by: Herbert Xu --- Reading git-diff-tree failed