#include "lkdtm.h"
#include <asm/page.h>
static int called_count;
static noinline void lkdtm_increment_void(int *counter)
{ … }
static noinline int lkdtm_increment_int(int *counter)
{ … }
static noinline void lkdtm_indirect_call(void (*func)(int *))
{ … }
static void lkdtm_CFI_FORWARD_PROTO(void)
{ … }
#ifdef CONFIG_ARM64_PTR_AUTH_KERNEL
# ifdef CONFIG_ARM64_BTI_KERNEL
#define __no_pac …
# else
# ifdef CONFIG_CC_HAS_BRANCH_PROT_PAC_RET
#define __no_pac …
# else
#define __no_pac …
# endif
# endif
#define __no_ret_protection …
#else
#define __no_ret_protection …
#endif
#define no_pac_addr(addr) …
#ifdef CONFIG_RISCV
#define FRAME_RA_OFFSET …
#else
#define FRAME_RA_OFFSET …
#endif
static noinline __no_ret_protection
void set_return_addr_unchecked(unsigned long *expected, unsigned long *addr)
{ … }
static noinline
void set_return_addr(unsigned long *expected, unsigned long *addr)
{ … }
static volatile int force_check;
static void lkdtm_CFI_BACKWARD(void)
{ … }
static struct crashtype crashtypes[] = …;
struct crashtype_category cfi_crashtypes = …;