xref: /aosp_15_r20/trusty/kernel/lib/ubsan/exemptlist (revision 344aa361028b423587d4ef3fa52a23d194628137)
1*344aa361SAndroid Build Coastguard Worker#!special-case-list-v1
2*344aa361SAndroid Build Coastguard Worker#
3*344aa361SAndroid Build Coastguard Worker# Copyright (c) 2019, Google, Inc. All rights reserved
4*344aa361SAndroid Build Coastguard Worker#
5*344aa361SAndroid Build Coastguard Worker# Permission is hereby granted, free of charge, to any person obtaining
6*344aa361SAndroid Build Coastguard Worker# a copy of this software and associated documentation files
7*344aa361SAndroid Build Coastguard Worker# (the "Software"), to deal in the Software without restriction,
8*344aa361SAndroid Build Coastguard Worker# including without limitation the rights to use, copy, modify, merge,
9*344aa361SAndroid Build Coastguard Worker# publish, distribute, sublicense, and/or sell copies of the Software,
10*344aa361SAndroid Build Coastguard Worker# and to permit persons to whom the Software is furnished to do so,
11*344aa361SAndroid Build Coastguard Worker# subject to the following conditions:
12*344aa361SAndroid Build Coastguard Worker#
13*344aa361SAndroid Build Coastguard Worker# The above copyright notice and this permission notice shall be
14*344aa361SAndroid Build Coastguard Worker# included in all copies or substantial portions of the Software.
15*344aa361SAndroid Build Coastguard Worker#
16*344aa361SAndroid Build Coastguard Worker# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17*344aa361SAndroid Build Coastguard Worker# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18*344aa361SAndroid Build Coastguard Worker# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19*344aa361SAndroid Build Coastguard Worker# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20*344aa361SAndroid Build Coastguard Worker# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21*344aa361SAndroid Build Coastguard Worker# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22*344aa361SAndroid Build Coastguard Worker# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23*344aa361SAndroid Build Coastguard Worker#
24*344aa361SAndroid Build Coastguard Worker
25*344aa361SAndroid Build Coastguard Worker# Entries in this section disable sanitizers listed in enable.mk.
26*344aa361SAndroid Build Coastguard Worker[alignment|bool|builtin|bounds|enum|float-cast-overflow|float-divide-by-zero|implicit-unsigned-integer-truncation|implicit-signed-integer-truncation|implicit-integer-sign-change|integer-divide-by-zero|pointer-overflow|return|shift|signed-integer-overflow|unreachable|unsigned-integer-overflow|vla-bound]
27*344aa361SAndroid Build Coastguard Worker
28*344aa361SAndroid Build Coastguard Worker# dlmalloc is fragile enough that it isn't worth the risk to try to make it
29*344aa361SAndroid Build Coastguard Worker# UBSan clean
30*344aa361SAndroid Build Coastguard Workersrc:*/dlmalloc.c
31*344aa361SAndroid Build Coastguard Worker
32*344aa361SAndroid Build Coastguard Worker# Fixing errors in boringssl is more likely to cause problems than fix them
33*344aa361SAndroid Build Coastguard Workersrc:external/boringssl/*
34*344aa361SAndroid Build Coastguard Worker
35*344aa361SAndroid Build Coastguard Worker# ocb.c implements pseudo-bignum math, and so plays fast and loose with signs
36*344aa361SAndroid Build Coastguard Worker# We would either need to annotate many of the functions in here, or rewrite
37*344aa361SAndroid Build Coastguard Worker# it dangerously to avoid this exemption.
38*344aa361SAndroid Build Coastguard Workersrc:*/system/keymaster/key_blob_utils/ocb.c
39*344aa361SAndroid Build Coastguard Worker
40*344aa361SAndroid Build Coastguard Worker# test-runner is missing important facilities for error reporting (e.g. printf)
41*344aa361SAndroid Build Coastguard Worker# and is not a actual product, just testing infrastructure.
42*344aa361SAndroid Build Coastguard Workersrc:external/trusty/bootloader/*
43*344aa361SAndroid Build Coastguard Worker
44*344aa361SAndroid Build Coastguard Worker# If we are inside Musl's ldso or crt components, we're too early in process
45*344aa361SAndroid Build Coastguard Worker# start for a lot of information to be correct, and our error reporting
46*344aa361SAndroid Build Coastguard Worker# facilities won't work yet.
47*344aa361SAndroid Build Coastguard Workersrc:external/trusty/musl/crt/*
48*344aa361SAndroid Build Coastguard Workersrc:external/trusty/musl/ldso/*
49*344aa361SAndroid Build Coastguard Worker
50*344aa361SAndroid Build Coastguard Worker# Musl is fond of negating unsigned integers to round values up.
51*344aa361SAndroid Build Coastguard Worker# There are also a few not-quite-buggy unsigned overflows and signed constants
52*344aa361SAndroid Build Coastguard Worker# being coerced to unsigned values.
53*344aa361SAndroid Build Coastguard Worker[unsigned-integer-overflow|implicit-integer-sign-change]
54*344aa361SAndroid Build Coastguard Workersrc:external/trusty/musl/src/*
55*344aa361SAndroid Build Coastguard Worker
56*344aa361SAndroid Build Coastguard Worker# Signature of memset is void* memset(void *s, int c, size_t n);
57*344aa361SAndroid Build Coastguard Worker# i.e. it has to convert its second argument to a 8-bit type, which can result
58*344aa361SAndroid Build Coastguard Worker# in a truncation.
59*344aa361SAndroid Build Coastguard Worker[implicit-signed-integer-truncation]
60*344aa361SAndroid Build Coastguard Workersrc:external/trusty/musl/src/string/memset.c
61*344aa361SAndroid Build Coastguard Worker
62*344aa361SAndroid Build Coastguard Worker# Allow unsigned overflow in keymaster until keymaster's checks are reworked.
63*344aa361SAndroid Build Coastguard Worker# The cases we know can overflow *are* overflow checks.
64*344aa361SAndroid Build Coastguard Worker[unsigned-integer-overflow|pointer-overflow]
65*344aa361SAndroid Build Coastguard Workersrc:*/system/keymaster/android_keymaster/authorization_set.cpp
66*344aa361SAndroid Build Coastguard Workersrc:*/system/keymaster/android_keymaster/serializable.cpp
67*344aa361SAndroid Build Coastguard Worker
68*344aa361SAndroid Build Coastguard Worker# Exempt libfreetype from overflow sanitization.
69*344aa361SAndroid Build Coastguard Worker[unsigned-integer-overflow|implicit-integer-sign-change|pointer-overflow|cfi]
70*344aa361SAndroid Build Coastguard Workersrc:*/external/freetype/*
71*344aa361SAndroid Build Coastguard Worker
72*344aa361SAndroid Build Coastguard Worker# Exempt libfdt from implicit integer sign changes
73*344aa361SAndroid Build Coastguard Worker[implicit-integer-sign-change]
74*344aa361SAndroid Build Coastguard Workersrc:external/dtc/libfdt/*
75*344aa361SAndroid Build Coastguard Worker
76*344aa361SAndroid Build Coastguard Worker# Exempt some libbinder functions from CFI because they make indirect
77*344aa361SAndroid Build Coastguard Worker# calls from C++ into Rust and the latter does not support CFI.
78*344aa361SAndroid Build Coastguard Worker# TODO(b/181755948): Remove these lines when that changes.
79*344aa361SAndroid Build Coastguard Worker[cfi-icall]
80*344aa361SAndroid Build Coastguard Worker# This is the file path as seen by clang
81*344aa361SAndroid Build Coastguard Workersrc:frameworks/native/libs/binder/trusty/binder_rpc_unstable/../../libbinder_rpc_unstable.cpp
82*344aa361SAndroid Build Coastguard Workersrc:frameworks/native/libs/binder/ndk/ibinder.cpp
83*344aa361SAndroid Build Coastguard Workersrc:frameworks/native/libs/binder/ndk/parcel.cpp
84*344aa361SAndroid Build Coastguard Workersrc:frameworks/native/libs/binder/trusty/rust/binder_rpc_server_bindgen/cpp/ARpcServerTrusty.cpp
85