In the Linux kernel, the following vulnerability has been resolved:
tee: amdtee: fix race condition in amdteeopensession
There is a potential race condition in amdteeopensession that may lead to use-after-free. For instance, in amdteeopensession() after sess->sess_mask is set, and before setting:
sess->session_info[i] = session_info;
if amdteeclosesession() closes this same session, then 'sess' data structure will be released, causing kernel panic when 'sess' is accessed within amdteeopensession().
The solution is to set the bit sess->sessmask as the last step in amdteeopen_session().