From 833de0b14957537acbd7f8967d918924faed9f93 Mon Sep 17 00:00:00 2001 From: WoolenSky Date: Wed, 10 Dec 2025 10:07:29 +0800 Subject: [PATCH] ignore sigusr1 for normal system Signed-off-by: WoolenSky --- auth/auth_base_impl.c | 12 ++++++++++++ auth/auth_base_impl.h | 2 ++ core/smc_smp.c | 8 ++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/auth/auth_base_impl.c b/auth/auth_base_impl.c index 552b473..fdc15f3 100644 --- a/auth/auth_base_impl.c +++ b/auth/auth_base_impl.c @@ -343,6 +343,18 @@ int check_teecd_auth(void) } #endif +bool is_hidl_or_cadaemon(void) +{ + bool ret = false; +#if defined(CONFIG_ANDROID_HIDL) || defined(CONFIG_MDC_HAL_AUTH) + ret |= check_proc_uid_path(CA_HIDL_PATH_UID_AUTH_CTX); +#endif +#ifdef CONFIG_CADAEMON_AUTH + ret |= check_proc_uid_path(CADAEMON_PATH_UID_AUTH_CTX); +#endif + return ret; +} + #ifdef CONFIG_TEE_TELEPORT_AUTH int check_tee_teleport_auth(void) { diff --git a/auth/auth_base_impl.h b/auth/auth_base_impl.h index fe8da14..82d950f 100644 --- a/auth/auth_base_impl.h +++ b/auth/auth_base_impl.h @@ -103,6 +103,8 @@ int check_teecd_auth(void) #endif /* CLIENT_AUTH || TEECD_AUTH */ +bool is_hidl_or_cadaemon(void); + #ifdef CONFIG_TEE_TELEPORT_AUTH int check_tee_teleport_auth(void); #endif diff --git a/core/smc_smp.c b/core/smc_smp.c index d3d5a9a..6040cf5 100644 --- a/core/smc_smp.c +++ b/core/smc_smp.c @@ -70,6 +70,7 @@ #include "shared_mem.h" #include "internal_functions.h" #include "smc_call.h" +#include "auth_base_impl.h" #define PREEMPT_COUNT 10000 #define HZ_COUNT 10 @@ -637,8 +638,11 @@ bool sigkill_pending(struct task_struct *tsk) return false; } - flag = (sigismember(&tsk->pending.signal, SIGKILL) != 0) || - (sigismember(&tsk->pending.signal, SIGUSR1) != 0); + flag = (sigismember(&tsk->pending.signal, SIGKILL) != 0); +#if defined(CONFIG_ANDROID_HIDL) || defined(CONFIG_MDC_HAL_AUTH) || defined(CONFIG_CADAEMON_AUTH) + if (is_hidl_or_cadaemon()) + flag |= (sigismember(&tsk->pending.signal, SIGUSR1) != 0); +#endif if (tsk->signal) return flag || sigismember(&tsk->signal->shared_pending.signal, -- Gitee