selftests/vDSO: add tests for vgetrandom
authorJason A. Donenfeld <Jason@zx2c4.com>
Sat, 6 Jul 2024 23:40:16 +0000 (01:40 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 19 Jul 2024 18:22:12 +0000 (20:22 +0200)
commit4920a2590e91bc15068e789aaf4ddc522f772fc5
tree344af21943c0672a371ef7b32b0a38881cbb88fc
parent33385150ac456f6f95a58647583d0a3887620729
selftests/vDSO: add tests for vgetrandom

This adds two tests for vgetrandom. The first one, vdso_test_chacha,
simply checks that the assembly implementation of chacha20 matches that
of libsodium, a basic sanity check that should catch most errors. The
second, vdso_test_getrandom, is a full "libc-like" implementation of the
userspace side of vgetrandom() support. It's meant to be used also as
example code for libcs that might be integrating this.

Cc: linux-kselftest@vger.kernel.org
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
tools/include/asm/rwonce.h [new file with mode: 0644]
tools/testing/selftests/vDSO/.gitignore
tools/testing/selftests/vDSO/Makefile
tools/testing/selftests/vDSO/vdso_test_chacha.c [new file with mode: 0644]
tools/testing/selftests/vDSO/vdso_test_getrandom.c [new file with mode: 0644]