fix some vDSO bugs.

- vDSO sometimes becomes invalid.
- vDSO is not succeeded for child process.
- vDSO becomes invalid when execve.
refs #744
This commit is contained in:
Tomoki Shirasawa
2016-09-04 23:13:00 +09:00
parent f74dcfc2a1
commit 20ea65b38c
5 changed files with 7 additions and 2 deletions

View File

@ -1563,6 +1563,7 @@ static int vdso_get_vdso_info(void)
struct ihk_ikc_channel_desc *ch = cpu_local_var(syscall_channel);
dkprintf("vdso_get_vdso_info()\n");
memset(&vdso, '\0', sizeof vdso);
vdso.busy = 1;
vdso.vdso_npages = 0;

View File

@ -100,8 +100,6 @@ void get_vdso_info(ihk_os_t os, long vdso_rpa)
vdso_pa = ihk_device_map_memory(dev, vdso_rpa, sizeof(*vdso));
vdso = ihk_device_map_virtual(dev, vdso_pa, sizeof(*vdso), NULL, 0);
memset(vdso, 0, sizeof(*vdso));
/* VDSO pages */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)
size = vdso_image->size;

View File

@ -2198,6 +2198,7 @@ fork_err:
strcpy(desc->shell_path, shell_path);
}
desc->enable_vdso = enable_vdso;
__dprintf("execve(): load_elf_desc() for %s OK, num sections: %d\n",
path, desc->num_sections);

View File

@ -332,6 +332,9 @@ int prepare_process_ranges_args_envs(struct thread *thread,
goto err;
}
}
else {
vm->vdso_addr = NULL;
}
p->rprocess = (unsigned long)thread;
p->rpgtable = virt_to_phys(as->page_table);

View File

@ -387,6 +387,8 @@ clone_thread(struct thread *org, unsigned long pc, unsigned long sp,
goto err_free_proc;
}
thread->vm->vdso_addr = org->vm->vdso_addr;
thread->vm->vvar_addr = org->vm->vvar_addr;
thread->proc->maxrss = org->proc->maxrss;
thread->vm->currss = org->vm->currss;