Re: [PATCH v3 00/23] Add generic vdso_base tracking

From: H. Peter Anvin
Date: Wed Oct 11 2023 - 19:21:01 EST


On 6/11/21 11:02, Dmitry Safonov wrote:

Patches set is based on linux-next (next-20201123) and it depends on
changes in x86/cleanups (those reclaim TIF_IA32/TIF_X32) and also
on my changes in akpm (fixing several mremap() issues).

Logically, the patches set divides on:
- patch 1: a cleanup for patches in x86/cleanups
- patches 2-13: cleanups for arch_setup_additional_pages()
- patches 13-14: x86 signal changes for unmapped vdso
- patches 15-22: provide generic vdso_base in mm_struct
- patch 23: selftest for unmapped vDSO & fast syscalls

In the end, besides cleanups, it's now more predictable what happens for
applications with unmapped vdso on architectures those support .mremap()
for vdso/sigpage.

I'm aware of only one user that unmaps vdso - Valgrind [2].
(there possibly are more, but this one is "special", it unmaps vdso, but
not vvar, which confuses CRIU [Checkpoint Restore In Userspace], that's
why I'm aware of it)


There was another discussion that might be relevant: actually associating the vdso with an actual file, and allowing a program to map said file normally if it want access to one that it normally wouldn't have (say, /proc/vdso/x86_64.so versus /proc/vdso/i386.so on the same system.)

The "catch", of course, is that this file will need to be mapped as MAP_SHARED because of vdso data.

-hpa