[PATCH v6 14/20] elf: Issue audit la_objopen() for vDSO
Florian Weimer
fweimer@redhat.com
Mon Dec 20 13:18:45 GMT 2021
* Adhemerval Zanella:
>>> +unsigned int
>>> +la_version (unsigned int version)
>>> +{
>>> + return LAV_CURRENT;
>>> +}
>>> +
>>> +unsigned int
>>> +la_objopen (struct link_map *map, Lmid_t lmid, uintptr_t *cookie)
>>> +{
>>> + /* The linux-gate.so is placed at a fixed address, thus l_addr being 0,
>>> + and it might be the value reported as the AT_SYSINFO_EHDR. */
>>> + if (map->l_addr == 0 && startswith (map->l_name, "linux-gate.so"))
>>> + fprintf (stderr, "vdso found: %p\n", NULL);
>>> + else if (map->l_addr == getauxval (AT_SYSINFO_EHDR))
>>> + fprintf (stderr, "vdso found: %p\n", (void*) map->l_addr);
>>> +
>>> + return 0;
>>> +}
>>
>> Would it be possible to look at the program headers to get the minimum
>> mapped address for the linux-gate.so object?
>
> It should be possible, but I only saw it on a ia64 machine (which I don't
> have access anymore) and reading the kernel source linux-gate.so is
> provided also for x86, sh, and sparc 32-bits kernels. I am not sure
> if it worth the trouble.
Fair enough, keep the current version then.
Thanks,
Florian
More information about the Libc-alpha
mailing list