Skip to content
Commit f7ef5860 authored by Zhen Kong's avatar Zhen Kong Committed by Gerrit - the friendly Code Review server
Browse files

crypto: msm: qcrypto: Fix _qcrypto_tfm_complete crash



Null pointer de-reference may occur when there are multiple AES-CCM
crypto users simultaneously. Specifically, _qcrypto_tfm_complete
calls a user completion function and if it is the user's last request,
cra_exit may be called to destroy the tfm context. The tfm context
is no longer valid, and referring to the deleted tfm context after
the callback is invoked may cause a crash. The solution is to look
ahead to ensure that there are more entries in the response queue
to process before calling the user completion callback. If there
are no more entries to process after the callback is invoked, it
won't proceed to look at tfm for additional completed responses to
process.

Change-Id: Ie9fb5212345676010bfa6f1e79ea7e4fab1d000b
Signed-off-by: default avatarZhen Kong <zkong@codeaurora.org>
parent c6314687
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment