From a0caa5cd96c8b999c3e4c2ec2a504372899fa8e6 Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Fri, 29 Aug 2025 18:05:32 +0300 Subject: [PATCH] sched/signal/sig_dispatch.c: Correct signal dispatch to specific thread The signal dispatch is called from interrupt handlers as well, so this_task() is wrong. The thread to which the signal is supposed to be delivered is known (stcb), use that. Signed-off-by: Jukka Laitinen --- sched/signal/sig_dispatch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sched/signal/sig_dispatch.c b/sched/signal/sig_dispatch.c index b1cb1e9d4ef..59c98ee7c22 100644 --- a/sched/signal/sig_dispatch.c +++ b/sched/signal/sig_dispatch.c @@ -755,12 +755,12 @@ int nxsig_dispatch(pid_t pid, FAR siginfo_t *info, bool thread) { if (thread) { - /* Before the notification, we should validate the tid and - * and make sure that the notified thread is in same process - * with the current thread. + /* Before the notification, we should validate the tid. If the + * signal is to be delivered to a thread which has exited, it is + * just dropped. */ - if (stcb != NULL && group == this_task()->group) + if (stcb != NULL) { return nxsig_tcbdispatch(stcb, info, false); }