uti: Make per_proc_data of tracee survive over the signal-kill of the tracee

Change-Id: I8ff1dddb526ef2fd948cfe1b8f3aa8403c2006d6
This commit is contained in:
Masamichi Takagi
2018-08-31 21:50:35 +09:00
parent bb4317beaf
commit 9102b176c4

View File

@ -2415,6 +2415,11 @@ mcexec_util_thread2(ihk_os_t os, unsigned long arg, struct file *file)
host_threads = thread;
write_unlock_irqrestore(&host_thread_lock, flags);
/* Make per-proc-data survive over the signal-kill of tracee. Note
that the singal-kill calls close() and then release_hanlde()
destroys it. */
ppd = mcctrl_get_per_proc_data(usrdata, task_tgid_vnr(current));
return 0;
}
@ -2483,6 +2488,12 @@ mcexec_terminate_thread(ihk_os_t os, unsigned long *param, struct file *file)
(usrdata->ikc2linux[smp_processor_id()] ?
usrdata->ikc2linux[smp_processor_id()] :
usrdata->ikc2linux[0]));
/* Destroy per_proc_data with the following two puts. Note that
it survived the signal-kill of tracee thanks to the additional put
done in mcexec_util_thread2 */
mcctrl_put_per_proc_data(ppd);
err:
if(ppd)
mcctrl_put_per_proc_data(ppd);