Commit 598aceb6 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Andrei Vagin

vdso: separate validation from vdso_fill_self_symtable()

I'll need to validate compat vdso/vvar positioning in the same way.

travis-ci: success for Rectify 32-bit compatible C/R on x86
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent f7b966b4
...@@ -275,15 +275,8 @@ err: ...@@ -275,15 +275,8 @@ err:
return exit_code; return exit_code;
} }
static int vdso_fill_self_symtable(struct vdso_symtable *s) static int validate_vdso_addr(struct vdso_symtable *s)
{ {
if (vdso_parse_maps(PROC_SELF, s))
return -1;
if (vdso_fill_symtable(s->vma_start, s->vma_end - s->vma_start, s))
return -1;
/* /*
* Validate its structure -- for new vDSO format the * Validate its structure -- for new vDSO format the
* structure must be like * structure must be like
...@@ -310,6 +303,21 @@ static int vdso_fill_self_symtable(struct vdso_symtable *s) ...@@ -310,6 +303,21 @@ static int vdso_fill_self_symtable(struct vdso_symtable *s)
return -1; return -1;
} }
return 0;
}
static int vdso_fill_self_symtable(struct vdso_symtable *s)
{
if (vdso_parse_maps(PROC_SELF, s))
return -1;
if (vdso_fill_symtable(s->vma_start, s->vma_end - s->vma_start, s))
return -1;
if (validate_vdso_addr(s))
return -1;
pr_debug("rt [vdso] %lx-%lx [vvar] %lx-%lx\n", pr_debug("rt [vdso] %lx-%lx [vvar] %lx-%lx\n",
s->vma_start, s->vma_end, s->vma_start, s->vma_end,
s->vvar_start, s->vvar_end); s->vvar_start, s->vvar_end);
......
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