kselftest/arm64/gcs: Use nolibc's getauxval()
Nolibc now does have getauxval(), use it. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Mark Brown <broonie@kernel.org> Signed-off-by: Will Deacon <will@kernel.org>
This commit is contained in:
committed by
Will Deacon
parent
740cdafd0d
commit
a985fe6383
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <asm/mman.h>
|
#include <asm/mman.h>
|
||||||
|
#include <asm/hwcap.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
|
|
||||||
#include "kselftest.h"
|
#include "kselftest.h"
|
||||||
@@ -386,14 +387,13 @@ int main(void)
|
|||||||
|
|
||||||
ksft_print_header();
|
ksft_print_header();
|
||||||
|
|
||||||
/*
|
if (!(getauxval(AT_HWCAP) & HWCAP_GCS))
|
||||||
* We don't have getauxval() with nolibc so treat a failure to
|
ksft_exit_skip("SKIP GCS not supported\n");
|
||||||
* read GCS state as a lack of support and skip.
|
|
||||||
*/
|
|
||||||
ret = my_syscall5(__NR_prctl, PR_GET_SHADOW_STACK_STATUS,
|
ret = my_syscall5(__NR_prctl, PR_GET_SHADOW_STACK_STATUS,
|
||||||
&gcs_mode, 0, 0, 0);
|
&gcs_mode, 0, 0, 0);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
ksft_exit_skip("Failed to read GCS state: %d\n", ret);
|
ksft_exit_fail_msg("Failed to read GCS state: %d\n", ret);
|
||||||
|
|
||||||
if (!(gcs_mode & PR_SHADOW_STACK_ENABLE)) {
|
if (!(gcs_mode & PR_SHADOW_STACK_ENABLE)) {
|
||||||
gcs_mode = PR_SHADOW_STACK_ENABLE;
|
gcs_mode = PR_SHADOW_STACK_ENABLE;
|
||||||
|
|||||||
Reference in New Issue
Block a user