mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-29 07:47:59 +00:00
Updated ubsan
This commit is contained in:
parent
95de1f4a3e
commit
3f2cc6e3ff
@ -92,7 +92,13 @@ extern void __asan_unregister_globals(void) { ubsan("unregister_globals"); }
|
|||||||
extern void __asan_init(void) { ubsan("init"); }
|
extern void __asan_init(void) { ubsan("init"); }
|
||||||
extern void __asan_version_mismatch_check_v8(void) { ubsan("version_mismatch_check_v8"); }
|
extern void __asan_version_mismatch_check_v8(void) { ubsan("version_mismatch_check_v8"); }
|
||||||
extern void __asan_option_detect_stack_use_after_return(void) { ubsan("stack use after return"); }
|
extern void __asan_option_detect_stack_use_after_return(void) { ubsan("stack use after return"); }
|
||||||
extern __noreturn void __asan_handle_no_return(void) { ubsan("no_return"); }
|
|
||||||
|
extern __noreturn void __asan_handle_no_return(void)
|
||||||
|
{
|
||||||
|
ubsan("no_return");
|
||||||
|
while (1)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
#define is_aligned(value, alignment) !(value & (alignment - 1))
|
#define is_aligned(value, alignment) !(value & (alignment - 1))
|
||||||
|
|
||||||
@ -249,3 +255,15 @@ void __ubsan_handle_missing_return(struct unreachable_data *data)
|
|||||||
if (UBSANMsg(data->location.file, data->location.line, data->location.column))
|
if (UBSANMsg(data->location.file, data->location.line, data->location.column))
|
||||||
ubsan("Missing return.");
|
ubsan("Missing return.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void __ubsan_vptr_type_cache(uintptr_t *cache, uintptr_t ptr)
|
||||||
|
{
|
||||||
|
ubsan("Vptr type cache.");
|
||||||
|
*cache = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void __ubsan_handle_dynamic_type_cache_miss(struct dynamic_type_cache_miss_data *data, uintptr_t ptr)
|
||||||
|
{
|
||||||
|
if (UBSANMsg(data->location.file, data->location.line, data->location.column))
|
||||||
|
ubsan("Dynamic type cache miss.");
|
||||||
|
}
|
@ -85,4 +85,10 @@ struct shift_out_of_bounds_data
|
|||||||
struct type_descriptor *right_type;
|
struct type_descriptor *right_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct dynamic_type_cache_miss_data
|
||||||
|
{
|
||||||
|
struct source_location location;
|
||||||
|
struct type_descriptor *type;
|
||||||
|
};
|
||||||
|
|
||||||
#endif // !__FENNIX_KERNEL_UBSAN_H__
|
#endif // !__FENNIX_KERNEL_UBSAN_H__
|
||||||
|
Loading…
x
Reference in New Issue
Block a user