projects/linux·blob master · refs

27 lines · 802 B

1/* SPDX-License-Identifier: GPL-2.0-only */
2
3#ifndef SELFTEST_SHADOWSTACK_TEST_H
4#define SELFTEST_SHADOWSTACK_TEST_H
5#include <stddef.h>
6#include <linux/prctl.h>
7
8/*
9 * A CFI test returns true for success or false for fail.
10 * Takes a test number to index into array, and a void pointer.
11 */
12typedef bool (*shstk_test_func)(unsigned long test_num, void *);
13
14struct shadow_stack_tests {
15 char *name;
16 shstk_test_func t_func;
17};
18
19bool shadow_stack_fork_test(unsigned long test_num, void *ctx);
20bool shadow_stack_map_test(unsigned long test_num, void *ctx);
21bool shadow_stack_protection_test(unsigned long test_num, void *ctx);
22bool shadow_stack_gup_tests(unsigned long test_num, void *ctx);
23bool shadow_stack_signal_test(unsigned long test_num, void *ctx);
24
25int execute_shadow_stack_tests(void);
26
27#endif