diff options
author | Mark Brown <broonie@kernel.org> | 2024-11-11 17:18:56 +0100 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2024-11-12 16:05:44 +0100 |
commit | 91a6533811bb81139c5a44d039b9b0a6af238bc8 (patch) | |
tree | 0645e379b2595a286b0f51e516cc401e524c13d6 /tools/testing/selftests | |
parent | kselftest/arm64: Don't leak pipe fds in pac.exec_sign_all() (diff) | |
download | linux-91a6533811bb81139c5a44d039b9b0a6af238bc8.tar.xz linux-91a6533811bb81139c5a44d039b9b0a6af238bc8.zip |
kselftest/arm64: Try harder to generate different keys during PAC tests
We very intermittently see failures in the single_thread_different_keys
PAC test. As noted in the comment in the test the PAC field can be quite
narrow so there is a chance of collisions even with different keys with a
chance of 5% for 7 bit keys, and the potential for narrower keys. The test
tries to avoid this by running repeatedly, but only tries 10 times which
even with a 5% chance of collisions isn't enough.
Increase the number of times we attempt to look for collisions by a factor
of 100, this also affects other tests which are following a similar pattern
with running the test repeatedly and either don't care like with
pac_instruction_not_nop or potentially have the same issue like
exec_sign_all.
The PAC tests are very fast, running in a second or two even in emulation,
so the 100x increased cost is mildly irritating but not a huge issue. The
bulk of the overhead is in the exec_sign_all test which does a fork() and
exec() per iteration.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20241111-arm64-pac-test-collisions-v1-2-171875f37e44@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'tools/testing/selftests')
-rw-r--r-- | tools/testing/selftests/arm64/pauth/pac.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/arm64/pauth/pac.c b/tools/testing/selftests/arm64/pauth/pac.c index 5a07b3958fbf..6d21b2fc758d 100644 --- a/tools/testing/selftests/arm64/pauth/pac.c +++ b/tools/testing/selftests/arm64/pauth/pac.c @@ -13,7 +13,7 @@ #include "../../kselftest_harness.h" #include "helper.h" -#define PAC_COLLISION_ATTEMPTS 10 +#define PAC_COLLISION_ATTEMPTS 1000 /* * The kernel sets TBID by default. So bits 55 and above should remain * untouched no matter what. |