On 12/10/2023 12:36, Aditya Deshpande wrote:
Hello,
This patch series implements a pure-capability vDSO which purecap userspace applications can directly use. It also fixes the vDSO selftests so that they can be built as purecap binaries, therefore allowing the new purecap vDSO to be tested. The existing aarch64 vDSO implementation is unchanged - it has simply been redefined as the compat vDSO. Therefore, processes using both the standard and purecap ABIs will have a vDSO to use.
I have tested both vDSOs using the patched versions of the selftests. I have tested the selftests by by feeding it broken vDSOs and seeing ensuring they fail appropriately.
The first patch fixes the tests, the second patch builds the purecap vDSO, and the third patch sets up the mapping for it and makes it available for use. If you think the patches should be ordered differently, and/or if we should possibly combine the building and mapping patches into one vDSO implementation patch, please let me know.
Thanks, Aditya
GitLab Issue:
GitLab Review Branch:
Aditya Deshpande (3): selftests/vDSO: Add support for purecap vDSO testing arm64: vdso: Build a pure-capability vDSO arm64: vDSO: Map the purecap vDSO into userspace application address space
Well done, this is a very good start! The patches look correct, and logically split; once the duplication is reduced (see comments inline on each patch) they should be in a good shape for merging.
Kevin
arch/arm64/Makefile | 6 + arch/arm64/include/asm/elf.h | 16 ++- arch/arm64/include/asm/vdso.h | 1 + arch/arm64/include/asm/vdso/gettimeofday.h | 92 ++++++++++++++ arch/arm64/kernel/Makefile | 4 +- arch/arm64/kernel/vdso-purecap-wrap.S | 22 ++++ arch/arm64/kernel/vdso-purecap/.gitignore | 2 + arch/arm64/kernel/vdso-purecap/Makefile | 101 ++++++++++++++++ arch/arm64/kernel/vdso-purecap/note.S | 23 ++++ arch/arm64/kernel/vdso-purecap/sigreturn.S | 80 ++++++++++++ arch/arm64/kernel/vdso-purecap/vdso.lds.S | 114 ++++++++++++++++++ .../arm64/kernel/vdso-purecap/vgettimeofday.c | 25 ++++ arch/arm64/kernel/vdso.c | 58 ++++++++- fs/compat_binfmt_elf.c | 16 +++ include/linux/compiler.h | 9 ++ include/linux/elf.h | 2 +- include/linux/user_ptr.h | 1 + tools/testing/selftests/vDSO/Makefile | 16 +-- tools/testing/selftests/vDSO/vdso_config.h | 11 ++ tools/testing/selftests/vDSO/vdso_test_abi.c | 4 +- .../selftests/vDSO/vdso_test_gettimeofday.c | 6 +- 21 files changed, 587 insertions(+), 22 deletions(-) create mode 100644 arch/arm64/kernel/vdso-purecap-wrap.S create mode 100644 arch/arm64/kernel/vdso-purecap/.gitignore create mode 100644 arch/arm64/kernel/vdso-purecap/Makefile create mode 100644 arch/arm64/kernel/vdso-purecap/note.S create mode 100644 arch/arm64/kernel/vdso-purecap/sigreturn.S create mode 100644 arch/arm64/kernel/vdso-purecap/vdso.lds.S create mode 100644 arch/arm64/kernel/vdso-purecap/vgettimeofday.c