This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: kernel DSO


On Tue, 2004-09-14 at 17:03, Jakub Jelinek wrote:

> I see two problems with this.
> 
> One is symbol versioning, glibc suddenly looses control of the symbol
> versions which the vDSO is overriding, so coming up with a new symbol
> version for one of these functions is hard.

That one shouldn't be too bad as the symbols in question would
be rather "trivial", like memcpy, memset, ... The other ones,
well, if we change their ABI, we change their name and glibc
could still provide a default impl for the "old" one, no ?

> The other is that it badly clashes with prelinking.
> Kernel really wants to randomize the vDSO (otherwise even in PIEs
> you can exploit things by jumping to the known addresses in the vDSO)
> and the vDSO is not under prelink's control, so if say memcpy
> is in the vDSO, suddenly all relocations against memcpy would be
> prelink conflicts.  Even if the vDSO is not randomized,
> assuming the vDSO layout is different between different CPUs
> and/or kernel versions, prelink can't modify its dynamic tags
> and therefore it can't determine whether it was prelinked
> against the exact same vDSO or a different one.

The vdso will be almost identical... except the .dynsym table in the
vdso is "patched" by the kernel at boot for functions like memcpy
to point to memcpy_cpumodel, and that sort of thing.

I don't fully understand how you do randomizing with prelink on
x86, they seem to be totally incompatible concepts to me, but then
I don't know the x86 ABI at all, I would appreciate a short explanation.

Do you actually "fix" the library addresses once for all on a given
setup (at prelink time) and then things don't change ? or does
randomization happens on each launch ? In which case I don't understand
how it works with prelink...

Also, if you look at rtld.c, dl_main() if any lib has l_addr non zero,
prelink is set to 0. However, the vdso will have l_addr non-zero (on
whatever arch/platform) if it's not mapped at the same address as it's
"native" address from the phdr...

Regards,
Ben. 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]