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: Zhen Kong <zkong@codeaurora.org>
Loading
Please register or sign in to comment