Commit 69a66e13 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Andrei Vagin

vdso: Move parsing of self/maps outside vdso_fill_self_symtable()

As ASLR randomizes {vdso,vvar}_start between criu launches,
vdso_parse_maps() should be called each launch:
- on restore to know {vdso,vvar}_start position for later parking
  in restorer's save zone
- on checkpointing to get vdso's pfn for pre-v3.16 kernels
  which lose "[vdso]" hint in maps file.

But vdso_fill_symtable() call may be omitted if symtable is
inside kdat file.
Reviewed-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 1fdaed0a
......@@ -327,8 +327,7 @@ static int validate_vdso_addr(struct vdso_maps *s)
static int vdso_fill_self_symtable(struct vdso_maps *s)
{
if (vdso_parse_maps(PROC_SELF, s))
if (s->vdso_start == VDSO_BAD_ADDR || s->sym.vdso_size == VDSO_BAD_SIZE)
return -1;
if (vdso_fill_symtable(s->vdso_start, s->sym.vdso_size, &s->sym))
......@@ -469,6 +468,11 @@ static int vdso_fill_compat_symtable(struct vdso_maps *native,
int vdso_init(void)
{
if (vdso_parse_maps(PROC_SELF, &vdso_maps)) {
pr_err("Failed reading self/maps for filling vdso/vvar bounds\n");
return -1;
}
if (vdso_fill_self_symtable(&vdso_maps)) {
pr_err("Failed to fill self vdso symtable\n");
return -1;
......
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