There is use-after-free design issue with the lifetime tracking of the tee_shm:dmabuf object. If dmabuf in the process of being destroyed, and at the same time other process do a call to the IOCTL command TEE_IOC_OPEN_SESSION or TEE_IOC_INVOKE referencing that shared memory, then exploitable use-after-free could happen. It is hard to trigger the issue, so this is like race condition and to trigger it the CONFIG_CPU_SW_DOMAIN_PAN must be disabled and both the kernel must be configured with CONFIG_PREEMPT. Reference and patch: https://lore.kernel.org/lkml/20211214123540.1789434-1-jens.wiklander@linaro.org/
The candidate patch is: https://lore.kernel.org/lkml/20211214123540.1789434-1-jens.wiklander@linaro.org/
Created kernel tracking bugs for this issue: Affects: fedora-all [bug 2033206]
This was fixed for Fedora with the 5.15.12 stable kernel updates.
This issue has been addressed in the following products: Red Hat Enterprise Linux 8 Via RHSA-2022:1975 https://access.redhat.com/errata/RHSA-2022:1975
This issue has been addressed in the following products: Red Hat Enterprise Linux 8 Via RHSA-2022:1988 https://access.redhat.com/errata/RHSA-2022:1988
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s): https://access.redhat.com/security/cve/cve-2021-44733