mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-08-22 00:42:01 +02:00

Add some tests that verify that BTI functions correctly for static binaries built with and without BTI support, verifying that SIGILL is generated when expected and is not generated in other situations. Since BTI support is still being rolled out in distributions these tests are built entirely free standing, no libc support is used at all so none of the standard helper functions for kselftest can be used and we open code everything. This also means we aren't testing the kernel support for the dynamic linker, though the test program can be readily adapted for that once it becomes something that we can reliably build and run. These tests were originally written by Dave Martin, I've adapted them for kselftest, mainly around the build system and the output format. Signed-off-by: Mark Brown <broonie@kernel.org> Cc: Dave Martin <Dave.Martin@arm.com> Link: https://lore.kernel.org/r/20210309193731.57247-1-broonie@kernel.org Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
24 lines
524 B
C
24 lines
524 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Copyright (C) 2019 Arm Limited
|
|
* Original author: Dave Martin <Dave.Martin@arm.com>
|
|
*/
|
|
|
|
#ifndef BTITEST_H
|
|
#define BTITEST_H
|
|
|
|
/* Trampolines for calling the test stubs: */
|
|
void call_using_br_x0(void (*)(void));
|
|
void call_using_br_x16(void (*)(void));
|
|
void call_using_blr(void (*)(void));
|
|
|
|
/* Test stubs: */
|
|
void nohint_func(void);
|
|
void bti_none_func(void);
|
|
void bti_c_func(void);
|
|
void bti_j_func(void);
|
|
void bti_jc_func(void);
|
|
void paciasp_func(void);
|
|
|
|
#endif /* !BTITEST_H */
|