From 54eb3458476783eee122304c8ea905125078ca18 Mon Sep 17 00:00:00 2001 From: Balazs Gerofi Date: Thu, 23 Jul 2015 16:51:24 +0900 Subject: [PATCH] settid(): prevent modifying tid after thread migration --- kernel/syscall.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/syscall.c b/kernel/syscall.c index 674ac265..e1ea7350 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -1474,7 +1474,9 @@ settid(struct process *proc, int mode, int newcpuid, int oldcpuid) ihk_mc_syscall_arg2(&ctx) = newcpuid; ihk_mc_syscall_arg3(&ctx) = oldcpuid; rc = syscall_generic_forwarding(__NR_gettid, &ctx); - proc->ftn->tid = rc; + if (mode != 2) { + proc->ftn->tid = rc; + } } SYSCALL_DECLARE(gettid)