{"id":"CVE-2023-52503","summary":"tee: amdtee: fix use-after-free vulnerability in amdtee_close_session","details":"In the Linux kernel, the following vulnerability has been resolved:\n\ntee: amdtee: fix use-after-free vulnerability in amdtee_close_session\n\nThere is a potential race condition in amdtee_close_session that may\ncause use-after-free in amdtee_open_session. For instance, if a session\nhas refcount == 1, and one thread tries to free this session via:\n\n    kref_put(&sess-\u003erefcount, destroy_session);\n\nthe reference count will get decremented, and the next step would be to\ncall destroy_session(). However, if in another thread,\namdtee_open_session() is called before destroy_session() has completed\nexecution, alloc_session() may return 'sess' that will be freed up\nlater in destroy_session() leading to use-after-free in\namdtee_open_session.\n\nTo fix this issue, treat decrement of sess-\u003erefcount and removal of\n'sess' from session list in destroy_session() as a critical section, so\nthat it is executed atomically.","modified":"2026-04-02T09:42:55.736407Z","published":"2024-03-02T21:52:17.854Z","related":["SUSE-SU-2024:1490-1","SUSE-SU-2024:1659-1","SUSE-SU-2024:1663-1","SUSE-SU-2024:2135-1","SUSE-SU-2024:2203-1","SUSE-SU-2024:2973-1","SUSE-SU-2025:20008-1"],"database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/52xxx/CVE-2023-52503.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/1680c82929bc14d706065f123dab77f2f1293116"},{"type":"WEB","url":"https://git.kernel.org/stable/c/1c95574350cd63bc3c5c2fa06658010768f2a0ce"},{"type":"WEB","url":"https://git.kernel.org/stable/c/60c3e7a00db954947c265b55099c21b216f2a05c"},{"type":"WEB","url":"https://git.kernel.org/stable/c/da7ce52a2f6c468946195b116615297d3d113a27"},{"type":"WEB","url":"https://git.kernel.org/stable/c/f4384b3e54ea813868bb81a861bf5b2406e15d8f"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/52xxx/CVE-2023-52503.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-52503"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"757cc3e9ff1d72d014096399d6e2bf03974d9da1"},{"fixed":"da7ce52a2f6c468946195b116615297d3d113a27"},{"fixed":"1680c82929bc14d706065f123dab77f2f1293116"},{"fixed":"60c3e7a00db954947c265b55099c21b216f2a05c"},{"fixed":"1c95574350cd63bc3c5c2fa06658010768f2a0ce"},{"fixed":"f4384b3e54ea813868bb81a861bf5b2406e15d8f"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-52503.json"}}],"schema_version":"1.7.5"}