Skip to contentSkip to conversation

CVE-2026-53273: tee: optee: prevent use-after-free when the client exits before the supplicant

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Jun 25

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

tee: optee: prevent use-after-free when the client exits before the supplicant

Commit 70b0d6b0a199 ("tee: optee: Fix supplicant wait loop") made the client wait as killable so it can be interrupted during shutdown or after a supplicant crash. This changes the original lifetime expectations:
the client task can now terminate while the supplicant is still processing its request.

If the client exits first it removes the request from its queue and kfree()s it, while the request ID remains in supp->idr. A subsequent lookup on the supplicant path then dereferences freed memory, leading to a use-after-free.

Serialise access to the request with supp->mutex:

* Hold supp->mutex in optee_supp_recv() and optee_supp_send() while looking up and touching the request.
* Let optee_supp_thrd_req() notice that the client has terminated and signal optee_supp_send() accordingly.

With these changes the request cannot be freed while the supplicant still has a reference, eliminating the race.

The Linux kernel CVE team has assigned CVE-2026-53273 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 5.10.235 with commit 0180cf0373f84fff61b16f8c062553a13dd7cfca and fixed in 5.10.259 with commit 416259cb5bffecaaae5f76539deb535a8c1b2c34
	Issue introduced in 5.15.179 with commit c0a9a948159153be145f9471435695373904ee6d and fixed in 5.15.210 with commit 724d0caffd4204b46f78efe22f18f8338031c6e1
	Issue introduced in 6.1.130 with commit ec18520f5edc20a00c34a8c9fdd6507c355e880f and fixed in 6.1.176 with commit ae847ab29ded2d7cece4d5970f0edefa4137bf2f
	Issue introduced in 6.6.80 with commit d61cc1a435e6894bfb0dd3370c6f765d2d12825d and fixed in 6.6.143 with commit 9a0dc9279d0907b198f205a693aedf696b08145d
	Issue introduced in 6.12.17 with commit fd9d2d6124c293e40797a080adf8a9c237efd8b8 and fixed in 6.12.94 with commit d366a01475f927402c96a3fe78bfc06b924fc87d
	Issue introduced in 6.14 with commit 70b0d6b0a199c5a3ee6c72f5e61681ed6f759612 and fixed in 6.18.36 with commit d5b57bb314d79e99bebb58a53588fa11dd4dbf69
	Issue introduced in 6.14 with commit 70b0d6b0a199c5a3ee6c72f5e61681ed6f759612 and fixed in 7.0.13 with commit 373152c94e57e9592b68c100e224fbd943cfd608
	Issue introduced in 6.14 with commit 70b0d6b0a199c5a3ee6c72f5e61681ed6f759612 and fixed in 7.1 with commit 387a926ee166814611acecb960207fe2f3c4fd3e
	Issue introduced in 5.4.291 with commit 3eb4911364c764572e9db4ab900a57689a54e8ce
	Issue introduced in 6.13.5 with commit 21234efe2a8474a6d2d01ea9573319de7858ce44

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-53273

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
drivers/tee/optee/supp.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/416259cb5bffecaaae5f76539deb535a8c1b2c34
	https://git.kernel.org/stable/c/724d0caffd4204b46f78efe22f18f8338031c6e1
	https://git.kernel.org/stable/c/ae847ab29ded2d7cece4d5970f0edefa4137bf2f
	https://git.kernel.org/stable/c/9a0dc9279d0907b198f205a693aedf696b08145d
	https://git.kernel.org/stable/c/d366a01475f927402c96a3fe78bfc06b924fc87d
	https://git.kernel.org/stable/c/d5b57bb314d79e99bebb58a53588fa11dd4dbf69
	https://git.kernel.org/stable/c/373152c94e57e9592b68c100e224fbd943cfd608
	https://git.kernel.org/stable/c/387a926ee166814611acecb960207fe2f3c4fd3e