From c88077aaebcca7b93d8ccebc08aefe76c242c276 Mon Sep 17 00:00:00 2001 From: Louie Lu Date: Tue, 22 Nov 2016 17:33:57 +0800 Subject: [PATCH] Fix: ipc_deliver must check from_thr intend Close #138 --- kernel/ipc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/ipc.c b/kernel/ipc.c index 3a574aaa..c800a8fa 100644 --- a/kernel/ipc.c +++ b/kernel/ipc.c @@ -341,7 +341,9 @@ uint32_t ipc_deliver(void *data) thr->ipc_from != L4_ANYTHREAD && thr->ipc_from != TID_TO_GLOBALID(THREAD_INTERRUPT)) { from_thr = thread_by_globalid(thr->ipc_from); - if (from_thr->state == T_SEND_BLOCKED) + /* NOTE: Must check from_thr intend to send*/ + if (from_thr->state == T_SEND_BLOCKED && + from_thr->utcb->intended_receiver == thr->t_globalid) do_ipc(from_thr, thr); } break;