Skip to content

Avoid performance degradation due to vDSO unmapping (BZ#52313)

Jinoh Kang requested to merge winepreloadremap into master

Commit f558741f removes vDSO if it conflicts with reserved ranges:

Remove the AT_SYSINFO and AT_SYSINFO_EHDR values if the sysinfo page
is in one of our reserved ranges.

However, missing vDSO leads to performance issues on some syscalls (e.g. clock_gettime, gettimeofday) and may even lead to crash when run with some ancient C libraries that does not supply a custom signal restorer.

vDSO pages can clash with reserved ranges especially in a 32-bit address space with address space layout randomization (ASLR) turned on.

Recent versions of the Linux kernel introduced support for mremap()-ping vDSO pages, partly in an effort to support checkpoint restore in userspace (CRIU). Special programs that require specific memory layout constraints (such as Wine preloader) can take advantage of this support to modify the address space to meet its requirements.

The following test script has been used to test each changes (use with git rebase --exec=...):

set -e
make -C ../wine64-build -j5
make -C ../wine32-build -j5

cd ../wine64-build
export WINEPRELOADREMAPSTACK
export WINEPRELOADREMAPVDSO
for WINEPRELOADREMAPSTACK in skip never always force auto on-demand ''
do
	for WINEPRELOADREMAPVDSO in skip never always force auto on-demand ''
	do
		./loader/wine64 wineboot
		./loader/wine wineboot
	done
done

Merge request reports

Loading