summaryrefslogtreecommitdiff
path: root/scripts/objdiff
diff options
context:
space:
mode:
authorAmirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>2026-02-16 14:24:06 -0800
committerJens Wiklander <jens.wiklander@linaro.org>2026-03-02 14:36:50 +0100
commit387a926ee166814611acecb960207fe2f3c4fd3e (patch)
treedd06e244ffe37215a7775890c24e057d0ad390f8 /scripts/objdiff
parent6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f (diff)
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. Fixes: 70b0d6b0a199 ("tee: optee: Fix supplicant wait loop") Signed-off-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com> Tested-by: Ox Yeh <ox.yeh@mediatek.com> Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'scripts/objdiff')
0 files changed, 0 insertions, 0 deletions