summaryrefslogtreecommitdiff
path: root/lib/test_dynamic_debug.c
diff options
context:
space:
mode:
authorRijo Thomas <Rijo-john.Thomas@amd.com>2023-02-28 15:11:20 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-30 12:51:41 +0200
commitb3ef9e6fe09f1a132af28c623edcf4d4f39d9f35 (patch)
treecf582967d4e3352bf53725f4e78503d50c4599a5 /lib/test_dynamic_debug.c
parenta4c2888656022953fcf3728a2870849fe6071d46 (diff)
tee: amdtee: fix race condition in amdtee_open_session
commit f8502fba45bd30e1a6a354d9d898bc99d1a11e6d upstream. 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: 757cc3e9ff1d ("tee: add AMD-TEE driver") Cc: stable@vger.kernel.org Signed-off-by: Rijo Thomas <Rijo-john.Thomas@amd.com> Acked-by: Sumit Garg <sumit.garg@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/test_dynamic_debug.c')
0 files changed, 0 insertions, 0 deletions