linux/drivers/tee/optee
Sumit Garg ec18520f5e tee: optee: Fix supplicant wait loop
commit 70b0d6b0a1 upstream.

OP-TEE supplicant is a user-space daemon and it's possible for it
be hung or crashed or killed in the middle of processing an OP-TEE
RPC call. It becomes more complicated when there is incorrect shutdown
ordering of the supplicant process vs the OP-TEE client application which
can eventually lead to system hang-up waiting for the closure of the
client application.

Allow the client process waiting in kernel for supplicant response to
be killed rather than indefinitely waiting in an unkillable state. Also,
a normal uninterruptible wait should not have resulted in the hung-task
watchdog getting triggered, but the endless loop would.

This fixes issues observed during system reboot/shutdown when supplicant
got hung for some reason or gets crashed/killed which lead to client
getting hung in an unkillable state. It in turn lead to system being in
hung up state requiring hard power off/on to recover.

Fixes: 4fb0a5eb36 ("tee: add OP-TEE driver")
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Cc: stable@vger.kernel.org
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-03-07 16:56:38 +01:00
..
call.c optee: remove vma linked list walk 2022-09-26 19:46:20 -07:00
core.c optee: cache argument shared memory structs 2022-04-25 21:13:05 +02:00
device.c tee: optee: Fix kernel panic caused by incorrect error handling 2024-04-03 15:19:42 +02:00
ffa_abi.c tee: optee: ffa: Fix missing-field-initializers warning 2024-07-25 09:49:17 +02:00
Kconfig tee: simplify shm pool handling 2022-02-16 07:49:41 +01:00
Makefile optee: separate notification functions 2021-11-17 14:08:56 +01:00
notif.c optee: Use bitmap_free() to free bitmap 2022-01-24 12:53:34 +01:00
optee_ffa.h optee: add FF-A capability OPTEE_FFA_SEC_CAP_ARG_OFFSET 2022-04-13 07:37:48 +02:00
optee_msg.h optee: add asynchronous notifications 2021-11-17 14:08:57 +01:00
optee_private.h tee: optee: Drop ffa_ops in optee_ffa structure using ffa_dev->ops directly 2022-09-08 11:30:34 +01:00
optee_rpc_cmd.h optee: separate notification functions 2021-11-17 14:08:56 +01:00
optee_smc.h optee: Remove duplicate 'of' in two places. 2022-07-08 10:51:24 +02:00
optee_trace.h tee: optee: add invoke_fn tracepoints 2021-03-15 12:04:01 +01:00
rpc.c optee: separate notification functions 2021-11-17 14:08:56 +01:00
smc_abi.c optee: fix uninited async notif value 2023-05-30 14:03:22 +01:00
supp.c tee: optee: Fix supplicant wait loop 2025-03-07 16:56:38 +01:00