Skip to content
Commit f8502fba authored by Rijo Thomas's avatar Rijo Thomas Committed by Jens Wiklander
Browse files

tee: amdtee: fix race condition in amdtee_open_session



There is a potential race condition in amdtee_open_session that may
lead to use-after-free. For instance, in amdtee_open_session() after
sess->sess_mask is set, and before setting:

    sess->session_info[i] = session_info;

if amdtee_close_session() closes this same session, then 'sess' data
structure will be released, causing kernel panic when 'sess' is
accessed within amdtee_open_session().

The solution is to set the bit sess->sess_mask as the last step in
amdtee_open_session().

Fixes: 757cc3e9 ("tee: add AMD-TEE driver")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarRijo Thomas <Rijo-john.Thomas@amd.com>
Acked-by: default avatarSumit Garg <sumit.garg@linaro.org>
Signed-off-by: Jens Wiklander's avatarJens Wiklander <jens.wiklander@linaro.org>
parent c9c3395d
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