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->sessmask is set, and before setting: sess->sessioninfo[i] = sessioninfo; 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 amdteeopensession().