coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ubsan.c File Reference
#include <stdint.h>
#include <console/console.h>
Include dependency graph for ubsan.c:

Go to the source code of this file.

Data Structures

struct  ubsan_source_location
 
struct  ubsan_type_descriptor
 
struct  ubsan_type_mismatch_data
 
struct  ubsan_overflow_data
 
struct  ubsan_pointer_overflow_data
 
struct  ubsan_shift_out_of_bounds_data
 
struct  ubsan_out_of_bounds_data
 
struct  ubsan_unreachable_data
 
struct  ubsan_vla_bound_data
 
struct  ubsan_float_cast_overflow_data
 
struct  ubsan_invalid_value_data
 
struct  ubsan_function_type_mismatch_data
 
struct  ubsan_nonnull_return_data
 
struct  ubsan_nonnull_arg_data
 
struct  ubsan_cfi_bad_icall_data
 

Macros

#define ABORT_VARIANT(name, params, call)
 
#define ABORT_VARIANT_VP(name)    ABORT_VARIANT(name, (void *a), (a))
 
#define ABORT_VARIANT_VP_VP(name)    ABORT_VARIANT(name, (void *a, void *b), (a, b))
 
#define ABORT_VARIANT_VP_IP(name)    ABORT_VARIANT(name, (void *a, intptr_t b), (a, b))
 
#define ABORT_VARIANT_VP_VP_VP(name)    ABORT_VARIANT(name, (void *a, void *b, void *c), (a, b, c))
 

Typedefs

typedef uintptr_t ubsan_value_handle_t
 

Functions

static void __noreturn ubsan_abort (const struct ubsan_source_location *location, const char *violation)
 
void __ubsan_handle_type_mismatch_v1 (void *data_raw, void *pointer_raw)
 
 ABORT_VARIANT_VP_VP (type_mismatch_v1)
 
void __ubsan_handle_add_overflow (void *data_raw, void *lhs_raw, void *rhs_raw)
 
 ABORT_VARIANT_VP_VP_VP (add_overflow)
 
void __ubsan_handle_sub_overflow (void *data_raw, void *lhs_raw, void *rhs_raw)
 
 ABORT_VARIANT_VP_VP_VP (sub_overflow)
 
void __ubsan_handle_mul_overflow (void *data_raw, void *lhs_raw, void *rhs_raw)
 
 ABORT_VARIANT_VP_VP_VP (mul_overflow)
 
void __ubsan_handle_negate_overflow (void *data_raw, void *old_value_raw)
 
 ABORT_VARIANT_VP_VP (negate_overflow)
 
void __ubsan_handle_divrem_overflow (void *data_raw, void *lhs_raw, void *rhs_raw)
 
 ABORT_VARIANT_VP_VP_VP (divrem_overflow)
 
void __ubsan_handle_pointer_overflow (void *data_raw, void *base_raw, void *result_raw)
 
 ABORT_VARIANT_VP_VP_VP (pointer_overflow)
 
void __ubsan_handle_shift_out_of_bounds (void *data_raw, void *lhs_raw, void *rhs_raw)
 
 ABORT_VARIANT_VP_VP_VP (shift_out_of_bounds)
 
void __ubsan_handle_out_of_bounds (void *data_raw, void *index_raw)
 
 ABORT_VARIANT_VP_VP (out_of_bounds)
 
void __noreturn __ubsan_handle_builtin_unreachable (void *data_raw)
 
void __noreturn __ubsan_handle_missing_return (void *data_raw)
 
void __ubsan_handle_vla_bound_not_positive (void *data_raw, void *bound_raw)
 
 ABORT_VARIANT_VP_VP (vla_bound_not_positive)
 
void __ubsan_handle_float_cast_overflow (void *data_raw, void *from_raw)
 
 ABORT_VARIANT_VP_VP (float_cast_overflow)
 
void __ubsan_handle_load_invalid_value (void *data_raw, void *value_raw)
 
 ABORT_VARIANT_VP_VP (load_invalid_value)
 
void __ubsan_handle_function_type_mismatch (void *data_raw, void *value_raw)
 
 ABORT_VARIANT_VP_VP (function_type_mismatch)
 
void __ubsan_handle_nonnull_return (void *data_raw)
 
 ABORT_VARIANT_VP (nonnull_return)
 
void __ubsan_handle_nonnull_arg (void *data_raw, intptr_t index_raw)
 
 ABORT_VARIANT_VP_IP (nonnull_arg)
 
void __ubsan_handle_cfi_bad_icall (void *data_raw, void *value_raw)
 
 ABORT_VARIANT_VP_VP (cfi_bad_icall)
 

Macro Definition Documentation

◆ ABORT_VARIANT

#define ABORT_VARIANT (   name,
  params,
  call 
)
Value:
__noreturn void __ubsan_handle_##name##_abort params; \
__noreturn void __ubsan_handle_##name##_abort params { \
__ubsan_handle_##name call; \
__builtin_unreachable(); \
}
const char * name
Definition: mmu.c:92
static struct sdram_info params
Definition: sdram_configs.c:83
#define __noreturn
Definition: compiler.h:31

Definition at line 48 of file ubsan.c.

◆ ABORT_VARIANT_VP

#define ABORT_VARIANT_VP (   name)     ABORT_VARIANT(name, (void *a), (a))

Definition at line 55 of file ubsan.c.

◆ ABORT_VARIANT_VP_IP

#define ABORT_VARIANT_VP_IP (   name)     ABORT_VARIANT(name, (void *a, intptr_t b), (a, b))

Definition at line 59 of file ubsan.c.

◆ ABORT_VARIANT_VP_VP

#define ABORT_VARIANT_VP_VP (   name)     ABORT_VARIANT(name, (void *a, void *b), (a, b))

Definition at line 57 of file ubsan.c.

◆ ABORT_VARIANT_VP_VP_VP

#define ABORT_VARIANT_VP_VP_VP (   name)     ABORT_VARIANT(name, (void *a, void *b, void *c), (a, b, c))

Definition at line 61 of file ubsan.c.

Typedef Documentation

◆ ubsan_value_handle_t

Definition at line 24 of file ubsan.c.

Function Documentation

◆ __ubsan_handle_add_overflow()

void __ubsan_handle_add_overflow ( void data_raw,
void lhs_raw,
void rhs_raw 
)

Definition at line 91 of file ubsan.c.

References ubsan_overflow_data::location, ubsan_abort(), and void().

Here is the call graph for this function:

◆ __ubsan_handle_builtin_unreachable()

void __noreturn __ubsan_handle_builtin_unreachable ( void data_raw)

Definition at line 217 of file ubsan.c.

References ubsan_unreachable_data::location, and ubsan_abort().

Here is the call graph for this function:

◆ __ubsan_handle_cfi_bad_icall()

void __ubsan_handle_cfi_bad_icall ( void data_raw,
void value_raw 
)

Definition at line 335 of file ubsan.c.

References ubsan_cfi_bad_icall_data::location, ubsan_abort(), value, and void().

Here is the call graph for this function:

◆ __ubsan_handle_divrem_overflow()

void __ubsan_handle_divrem_overflow ( void data_raw,
void lhs_raw,
void rhs_raw 
)

Definition at line 145 of file ubsan.c.

References ubsan_overflow_data::location, ubsan_abort(), and void().

Here is the call graph for this function:

◆ __ubsan_handle_float_cast_overflow()

void __ubsan_handle_float_cast_overflow ( void data_raw,
void from_raw 
)

Definition at line 253 of file ubsan.c.

References ubsan_float_cast_overflow_data::location, ubsan_abort(), and void().

Here is the call graph for this function:

◆ __ubsan_handle_function_type_mismatch()

void __ubsan_handle_function_type_mismatch ( void data_raw,
void value_raw 
)

Definition at line 285 of file ubsan.c.

References ubsan_function_type_mismatch_data::location, ubsan_abort(), value, and void().

Here is the call graph for this function:

◆ __ubsan_handle_load_invalid_value()

void __ubsan_handle_load_invalid_value ( void data_raw,
void value_raw 
)

Definition at line 269 of file ubsan.c.

References ubsan_invalid_value_data::location, ubsan_abort(), value, and void().

Here is the call graph for this function:

◆ __ubsan_handle_missing_return()

void __noreturn __ubsan_handle_missing_return ( void data_raw)

Definition at line 224 of file ubsan.c.

References ubsan_unreachable_data::location, and ubsan_abort().

Here is the call graph for this function:

◆ __ubsan_handle_mul_overflow()

void __ubsan_handle_mul_overflow ( void data_raw,
void lhs_raw,
void rhs_raw 
)

Definition at line 119 of file ubsan.c.

References ubsan_overflow_data::location, ubsan_abort(), and void().

Here is the call graph for this function:

◆ __ubsan_handle_negate_overflow()

void __ubsan_handle_negate_overflow ( void data_raw,
void old_value_raw 
)

Definition at line 133 of file ubsan.c.

References ubsan_overflow_data::location, ubsan_abort(), and void().

Here is the call graph for this function:

◆ __ubsan_handle_nonnull_arg()

void __ubsan_handle_nonnull_arg ( void data_raw,
intptr_t  index_raw 
)

Definition at line 319 of file ubsan.c.

References ubsan_nonnull_arg_data::location, ubsan_abort(), and void().

Here is the call graph for this function:

◆ __ubsan_handle_nonnull_return()

void __ubsan_handle_nonnull_return ( void data_raw)

Definition at line 301 of file ubsan.c.

References ubsan_nonnull_return_data::location, and ubsan_abort().

Here is the call graph for this function:

◆ __ubsan_handle_out_of_bounds()

void __ubsan_handle_out_of_bounds ( void data_raw,
void index_raw 
)

Definition at line 202 of file ubsan.c.

References ubsan_out_of_bounds_data::location, ubsan_abort(), and void().

Here is the call graph for this function:

◆ __ubsan_handle_pointer_overflow()

void __ubsan_handle_pointer_overflow ( void data_raw,
void base_raw,
void result_raw 
)

Definition at line 163 of file ubsan.c.

References base, ubsan_pointer_overflow_data::location, ubsan_abort(), and void().

Here is the call graph for this function:

◆ __ubsan_handle_shift_out_of_bounds()

void __ubsan_handle_shift_out_of_bounds ( void data_raw,
void lhs_raw,
void rhs_raw 
)

Definition at line 182 of file ubsan.c.

References ubsan_shift_out_of_bounds_data::location, ubsan_abort(), and void().

Here is the call graph for this function:

◆ __ubsan_handle_sub_overflow()

void __ubsan_handle_sub_overflow ( void data_raw,
void lhs_raw,
void rhs_raw 
)

Definition at line 105 of file ubsan.c.

References ubsan_overflow_data::location, ubsan_abort(), and void().

Here is the call graph for this function:

◆ __ubsan_handle_type_mismatch_v1()

void __ubsan_handle_type_mismatch_v1 ( void data_raw,
void pointer_raw 
)

Definition at line 71 of file ubsan.c.

References ubsan_type_mismatch_data::alignment, ubsan_type_mismatch_data::location, and ubsan_abort().

Here is the call graph for this function:

◆ __ubsan_handle_vla_bound_not_positive()

void __ubsan_handle_vla_bound_not_positive ( void data_raw,
void bound_raw 
)

Definition at line 236 of file ubsan.c.

References ubsan_vla_bound_data::location, ubsan_abort(), and void().

Here is the call graph for this function:

◆ ABORT_VARIANT_VP()

ABORT_VARIANT_VP ( nonnull_return  )

◆ ABORT_VARIANT_VP_IP()

ABORT_VARIANT_VP_IP ( nonnull_arg  )

◆ ABORT_VARIANT_VP_VP() [1/8]

ABORT_VARIANT_VP_VP ( cfi_bad_icall  )

◆ ABORT_VARIANT_VP_VP() [2/8]

ABORT_VARIANT_VP_VP ( float_cast_overflow  )

◆ ABORT_VARIANT_VP_VP() [3/8]

ABORT_VARIANT_VP_VP ( function_type_mismatch  )

◆ ABORT_VARIANT_VP_VP() [4/8]

ABORT_VARIANT_VP_VP ( load_invalid_value  )

◆ ABORT_VARIANT_VP_VP() [5/8]

ABORT_VARIANT_VP_VP ( negate_overflow  )

◆ ABORT_VARIANT_VP_VP() [6/8]

ABORT_VARIANT_VP_VP ( out_of_bounds  )

◆ ABORT_VARIANT_VP_VP() [7/8]

ABORT_VARIANT_VP_VP ( type_mismatch_v1  )

◆ ABORT_VARIANT_VP_VP() [8/8]

ABORT_VARIANT_VP_VP ( vla_bound_not_positive  )

◆ ABORT_VARIANT_VP_VP_VP() [1/6]

ABORT_VARIANT_VP_VP_VP ( add_overflow  )

◆ ABORT_VARIANT_VP_VP_VP() [2/6]

ABORT_VARIANT_VP_VP_VP ( divrem_overflow  )

◆ ABORT_VARIANT_VP_VP_VP() [3/6]

ABORT_VARIANT_VP_VP_VP ( mul_overflow  )

◆ ABORT_VARIANT_VP_VP_VP() [4/6]

ABORT_VARIANT_VP_VP_VP ( pointer_overflow  )

◆ ABORT_VARIANT_VP_VP_VP() [5/6]

ABORT_VARIANT_VP_VP_VP ( shift_out_of_bounds  )

◆ ABORT_VARIANT_VP_VP_VP() [6/6]

ABORT_VARIANT_VP_VP_VP ( sub_overflow  )

◆ ubsan_abort()