[CRIU] Error (pie-util-vdso.c:190): vdso: Not all dynamic entries are present

Tycho Andersen tycho.andersen at canonical.com
Tue Jun 7 09:25:19 PDT 2016


Hi Dmitry,

On Tue, Jun 07, 2016 at 06:36:49PM +0300, Dmitry Safonov wrote:
> >Ok, I fetched your kernel.
> >Here is it:
> >[ubuntu-unstable]$ git checkout 66b7a6c3fa35ea617c60d938bd2028eb6141c2f0
> >[ubuntu-unstable]$ make clean
> >...
> >[ubuntu-unstable]$ make -j5 arch/x86/entry/vdso/
> >...
> >[ubuntu-unstable]$ readelf --program-headers arch/x86/entry/vdso/vdso64.so
> >
> >Elf file type is EXEC (Executable file)
> >Entry point 0x5c0
> >There are 4 program headers, starting at offset 64
> >
> >Program Headers:
> >  Type           Offset             VirtAddr           PhysAddr
> >                 FileSiz            MemSiz              Flags  Align
> >  LOAD           0x0000000000000000 0x0000000000000000 0x0000000000000000
> >                 0x0000000000000979 0x0000000000000979  R E    1000
> >  DYNAMIC        0x0000000000000000 0x0000000000000000 0x0000000000000000
> >                 0x0000000000000000 0x0000000000000000  R      8
> >readelf: Error: no .dynamic section in the dynamic segment
> >  NOTE           0x0000000000000460 0x0000000000000460 0x0000000000000460
> >                 0x000000000000003c 0x000000000000003c  R      4
> >  GNU_EH_FRAME   0x000000000000049c 0x000000000000049c 0x000000000000049c
> >                 0x0000000000000034 0x0000000000000034  R      4
> >
> > Section to Segment mapping:
> >  Segment Sections...
> >   00     .rodata .note .eh_frame_hdr .eh_frame .text .altinstructions
> >.altinstr_replacement
> >   01
> >   02     .note
> >   03     .eh_frame_hdr
> >
> >
> >See? There is no .dynamic section :)
> >
> >Ok, lets find, what broke it...
> >[ubuntu-unstable]$ git checkout f8830b2956a3~1
> >[ubuntu-unstable]$ make clean
> >...
> >[ubuntu-unstable]$ make -j5 arch/x86/entry/vdso/
> >...
> >[ubuntu-unstable]$ readelf --program-headers arch/x86/entry/vdso/vdso64.so
> >
> >Elf file type is DYN (Shared object file)
> >Entry point 0x910
> >There are 4 program headers, starting at offset 64
> >
> >Program Headers:
> >  Type           Offset             VirtAddr           PhysAddr
> >                 FileSiz            MemSiz              Flags  Align
> >  LOAD           0x0000000000000000 0x0000000000000000 0x0000000000000000
> >                 0x0000000000000cb9 0x0000000000000cb9  R E    1000
> >  DYNAMIC        0x0000000000000360 0x0000000000000360 0x0000000000000360
> >                 0x0000000000000110 0x0000000000000110  R      8
> >  NOTE           0x00000000000007b0 0x00000000000007b0 0x00000000000007b0
> >                 0x000000000000003c 0x000000000000003c  R      4
> >  GNU_EH_FRAME   0x00000000000007ec 0x00000000000007ec 0x00000000000007ec
> >                 0x0000000000000034 0x0000000000000034  R      4
> >
> > Section to Segment mapping:
> >  Segment Sections...
> >   00     .hash .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_d
> >.dynamic .rodata .note .eh_frame_hdr .eh_frame .text .altinstructions
> >.altinstr_replacement
> >   01     .dynamic
> >   02     .note
> >   03     .eh_frame_hdr
> >
> >
> >And here it is. Not sure that this commit f8830b2956a3 ("disable -pie
> >when gcc has it enabled by default") has broke it, but it looks quite
> >suspicious.
> >
> >Anyway, I'm not sure, maybe we could re-arrange vdso code in CRIU
> >that it wouldn't need .dynamic? I'm not sure, maybe I'll check it
> >when I'll have some more time :)
> 
> But it's very unclear, what can we do if there is no .dynamic
> We really need symbols and their location information.
> So, vDSO looks quite useless without it. I'm surprised that
> your glibc works with that (is it?). Maybe it fails back to raw
> syscall instructions instead of fast syscalls - I don't know
> if you have check that after that patch.

Thanks for the analysis. I just tested, and sure enough it does fall
back to real syscalls, so that seems like a big problem :)

I'll check with our kernel guys and see, but based on looking at the
code we do need the .dynamic section so we can reposition things.

Tycho


More information about the CRIU mailing list