]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tee: fix params_from_user() error path in tee_ioctl_supp_recv
authorQihang <q.h.hack.winter@gmail.com>
Thu, 7 May 2026 15:39:17 +0000 (23:39 +0800)
committerJens Wiklander <jens.wiklander@linaro.org>
Wed, 20 May 2026 06:49:09 +0000 (08:49 +0200)
commit6fa9b543f6b4ed15ff72af266b29f316643de289
treea7b60cc6dd083ac11e37c0e4bcc61639583715cd
parent26682f5efc276e3ad96d102019472bfbf03833b2
tee: fix params_from_user() error path in tee_ioctl_supp_recv

params_from_user() may acquire tee_shm references for MEMREF parameters
before failing after partially processing the supplied parameter array.

In tee_ioctl_supp_recv(), those references are currently not released on
that error path.

Fix this by freeing MEMREF references before returning when
params_from_user() fails.

Keep the final cleanup path in tee_ioctl_supp_recv() unchanged since
supp_recv() may consume and replace the supplied parameters, unlike the
other TEE ioctl callback paths.

Signed-off-by: Qihang <q.h.hack.winter@gmail.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
drivers/tee/tee_core.c