diff options
author | Josh Poimboeuf <jpoimboe@redhat.com> | 2016-05-16 15:16:18 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-01 12:17:59 -0700 |
commit | 3718e19da2f1d32867a57bcbe53d6b535fc0909c (patch) | |
tree | df4922993f517e381e905c3bcd50d568e85a17d8 /include | |
parent | 2a956fd6bd8aedd2e040387a2b200b7ad0b9a81b (diff) | |
download | lwn-3718e19da2f1d32867a57bcbe53d6b535fc0909c.tar.gz lwn-3718e19da2f1d32867a57bcbe53d6b535fc0909c.zip |
crypto: sha1-mb - make sha1_x8_avx2() conform to C function ABI
commit 4a6b27b79da5ccc6b85dc05bbe6a091e58be896a upstream.
Megha Dey reported a kernel panic in crypto code. The problem is that
sha1_x8_avx2() clobbers registers r12-r15 without saving and restoring
them.
Before commit aec4d0e301f1 ("x86/asm/crypto: Simplify stack usage in
sha-mb functions"), those registers were saved and restored by the
callers of the function. I removed them with that commit because I
didn't realize sha1_x8_avx2() clobbered them.
Fix the potential undefined behavior associated with clobbering the
registers and make the behavior less surprising by changing the
registers to be callee saved/restored to conform with the C function
call ABI.
Also, rdx (aka RSP_SAVE) doesn't need to be saved: I verified that none
of the callers rely on it being saved, and it's not a callee-saved
register in the C ABI.
Fixes: aec4d0e301f1 ("x86/asm/crypto: Simplify stack usage in sha-mb functions")
Reported-by: Megha Dey <megha.dey@linux.intel.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions