Commit 28c35b18 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Pavel Emelyanov

vdso/compat: Don't unmap missing vdso/vvar vmas

I've met missing vvar on Virtuozzo 7 kernel - just skip
unmapping it.

TODO: check ia32 C/R with kernel CONFIG_VDSO=n
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent baed8b8c
...@@ -41,13 +41,17 @@ void compat_vdso_helper(struct vdso_symtable *native, int pipe_fd, ...@@ -41,13 +41,17 @@ void compat_vdso_helper(struct vdso_symtable *native, int pipe_fd,
long vdso_size; long vdso_size;
long ret; long ret;
vma_size = native->vma_end - native->vma_start; if (native->vma_start != VDSO_BAD_ADDR) {
ret = syscall(__NR_munmap, native->vma_start, vma_size); vma_size = native->vma_end - native->vma_start;
exit_on(ret, err_fd, "Error: Failed to unmap native vdso\n"); ret = syscall(__NR_munmap, native->vma_start, vma_size);
exit_on(ret, err_fd, "Error: Failed to unmap native vdso\n");
}
vma_size = native->vvar_end - native->vvar_start; if (native->vvar_start != VVAR_BAD_ADDR) {
ret = syscall(__NR_munmap, native->vvar_start, vma_size); vma_size = native->vvar_end - native->vvar_start;
exit_on(ret, err_fd, "Error: Failed to unmap native vvar\n"); ret = syscall(__NR_munmap, native->vvar_start, vma_size);
exit_on(ret, err_fd, "Error: Failed to unmap native vvar\n");
}
ret = syscall(__NR_arch_prctl, ARCH_MAP_VDSO_32, native->vma_start); ret = syscall(__NR_arch_prctl, ARCH_MAP_VDSO_32, native->vma_start);
if (ret < 0) if (ret < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment