Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
chromium
GitHub Repository: chromium/chromium
Path: blob/main/base/allocator/partition_allocator/src/partition_alloc/arm_bti_test_functions.h
41933 views
1
// Copyright 2021 The Chromium Authors
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#ifdef UNSAFE_BUFFERS_BUILD
6
// TODO(crbug.com/40284755): Remove this and spanify to fix the errors.
7
#pragma allow_unsafe_buffers
8
#endif
9
10
#ifndef PARTITION_ALLOC_ARM_BTI_TEST_FUNCTIONS_H_
11
#define PARTITION_ALLOC_ARM_BTI_TEST_FUNCTIONS_H_
12
13
#include "partition_alloc/build_config.h"
14
15
#if PA_BUILDFLAG(PA_ARCH_CPU_ARM64)
16
extern "C" {
17
/**
18
* A valid BTI function. Jumping to this funtion should not cause any problem in
19
* a BTI enabled environment.
20
**/
21
int64_t arm_bti_test_function(int64_t);
22
23
/**
24
* A function without proper BTI landing pad. Jumping here should crash the
25
* program on systems which support BTI.
26
**/
27
int64_t arm_bti_test_function_invalid_offset(int64_t);
28
29
/**
30
* A simple function which immediately returns to sender.
31
**/
32
void arm_bti_test_function_end(void);
33
}
34
#endif // PA_BUILDFLAG(PA_ARCH_CPU_ARM64)
35
36
#endif // PARTITION_ALLOC_ARM_BTI_TEST_FUNCTIONS_H_
37
38