Update kernel

This commit is contained in:
EnderIce2
2024-01-19 06:47:42 +02:00
parent fd15592608
commit 96daa43d38
282 changed files with 25486 additions and 15700 deletions

View File

@ -51,309 +51,309 @@ __ubsan_handle_cfi_check_fail
void __asan_report_load1(void *unknown)
{
ubsan("load1");
UNUSED(unknown);
ubsan("load1");
UNUSED(unknown);
}
void __asan_report_load2(void *unknown)
{
ubsan("load2");
UNUSED(unknown);
ubsan("load2");
UNUSED(unknown);
}
void __asan_report_load4(void *unknown)
{
ubsan("load4");
UNUSED(unknown);
ubsan("load4");
UNUSED(unknown);
}
void __asan_report_load8(void *unknown)
{
ubsan("load8");
UNUSED(unknown);
ubsan("load8");
UNUSED(unknown);
}
void __asan_report_load16(void *unknown)
{
ubsan("load16");
UNUSED(unknown);
ubsan("load16");
UNUSED(unknown);
}
void __asan_report_load_n(void *unknown, uintptr_t size)
{
ubsan("loadn");
UNUSED(unknown);
UNUSED(size);
ubsan("loadn");
UNUSED(unknown);
UNUSED(size);
}
void __asan_report_store1(void *unknown)
{
ubsan("store1");
UNUSED(unknown);
ubsan("store1");
UNUSED(unknown);
}
void __asan_report_store2(void *unknown)
{
ubsan("store2");
UNUSED(unknown);
ubsan("store2");
UNUSED(unknown);
}
void __asan_report_store4(void *unknown)
{
ubsan("store4");
UNUSED(unknown);
ubsan("store4");
UNUSED(unknown);
}
void __asan_report_store8(void *unknown)
{
ubsan("store8");
UNUSED(unknown);
ubsan("store8");
UNUSED(unknown);
}
void __asan_report_store16(void *unknown)
{
ubsan("store16");
UNUSED(unknown);
ubsan("store16");
UNUSED(unknown);
}
void __asan_report_store_n(void *unknown, uintptr_t size)
{
ubsan("storen");
UNUSED(unknown);
UNUSED(size);
ubsan("storen");
UNUSED(unknown);
UNUSED(size);
}
void __asan_report_load1_noabort(void *unknown)
{
ubsan("load1");
UNUSED(unknown);
ubsan("load1");
UNUSED(unknown);
}
void __asan_report_load2_noabort(void *unknown)
{
ubsan("load2");
UNUSED(unknown);
ubsan("load2");
UNUSED(unknown);
}
void __asan_report_load4_noabort(void *unknown)
{
ubsan("load4");
UNUSED(unknown);
ubsan("load4");
UNUSED(unknown);
}
void __asan_report_load8_noabort(void *unknown)
{
ubsan("load8");
UNUSED(unknown);
ubsan("load8");
UNUSED(unknown);
}
void __asan_report_load16_noabort(void *unknown)
{
ubsan("load16");
UNUSED(unknown);
ubsan("load16");
UNUSED(unknown);
}
void __asan_report_load_n_noabort(void *unknown, uintptr_t size)
{
ubsan("loadn");
UNUSED(unknown);
UNUSED(size);
ubsan("loadn");
UNUSED(unknown);
UNUSED(size);
}
void __asan_report_store1_noabort(void *unknown)
{
ubsan("store1");
UNUSED(unknown);
ubsan("store1");
UNUSED(unknown);
}
void __asan_report_store2_noabort(void *unknown)
{
ubsan("store2");
UNUSED(unknown);
ubsan("store2");
UNUSED(unknown);
}
void __asan_report_store4_noabort(void *unknown)
{
ubsan("store4");
UNUSED(unknown);
ubsan("store4");
UNUSED(unknown);
}
void __asan_report_store8_noabort(void *unknown)
{
ubsan("store8");
UNUSED(unknown);
ubsan("store8");
UNUSED(unknown);
}
void __asan_report_store16_noabort(void *unknown)
{
ubsan("store16");
UNUSED(unknown);
ubsan("store16");
UNUSED(unknown);
}
void __asan_report_store_n_noabort(void *unknown, uintptr_t size)
{
ubsan("storen");
UNUSED(unknown);
UNUSED(size);
ubsan("storen");
UNUSED(unknown);
UNUSED(size);
}
void __asan_stack_malloc_0(uintptr_t size)
{
ubsan("stack malloc 0");
UNUSED(size);
ubsan("stack malloc 0");
UNUSED(size);
}
void __asan_stack_malloc_1(uintptr_t size)
{
ubsan("stack malloc 1");
UNUSED(size);
ubsan("stack malloc 1");
UNUSED(size);
}
void __asan_stack_malloc_2(uintptr_t size)
{
ubsan("stack malloc 2");
UNUSED(size);
ubsan("stack malloc 2");
UNUSED(size);
}
void __asan_stack_malloc_3(uintptr_t size)
{
ubsan("stack malloc 3");
UNUSED(size);
ubsan("stack malloc 3");
UNUSED(size);
}
void __asan_stack_malloc_4(uintptr_t size)
{
ubsan("stack malloc 4");
UNUSED(size);
ubsan("stack malloc 4");
UNUSED(size);
}
void __asan_stack_malloc_5(uintptr_t size)
{
ubsan("stack malloc 5");
UNUSED(size);
ubsan("stack malloc 5");
UNUSED(size);
}
void __asan_stack_malloc_6(uintptr_t size)
{
ubsan("stack malloc 6");
UNUSED(size);
ubsan("stack malloc 6");
UNUSED(size);
}
void __asan_stack_malloc_7(uintptr_t size)
{
ubsan("stack malloc 7");
UNUSED(size);
ubsan("stack malloc 7");
UNUSED(size);
}
void __asan_stack_malloc_8(uintptr_t size)
{
ubsan("stack malloc 8");
UNUSED(size);
ubsan("stack malloc 8");
UNUSED(size);
}
void __asan_stack_malloc_9(uintptr_t size)
{
ubsan("stack malloc 9");
UNUSED(size);
ubsan("stack malloc 9");
UNUSED(size);
}
void __asan_stack_free_0(void *ptr, uintptr_t size)
{
ubsan("stack free 0");
UNUSED(ptr);
UNUSED(size);
ubsan("stack free 0");
UNUSED(ptr);
UNUSED(size);
}
void __asan_stack_free_1(void *ptr, uintptr_t size)
{
ubsan("stack free 1");
UNUSED(ptr);
UNUSED(size);
ubsan("stack free 1");
UNUSED(ptr);
UNUSED(size);
}
void __asan_stack_free_2(void *ptr, uintptr_t size)
{
ubsan("stack free 2");
UNUSED(ptr);
UNUSED(size);
ubsan("stack free 2");
UNUSED(ptr);
UNUSED(size);
}
void __asan_stack_free_3(void *ptr, uintptr_t size)
{
ubsan("stack free 3");
UNUSED(ptr);
UNUSED(size);
ubsan("stack free 3");
UNUSED(ptr);
UNUSED(size);
}
void __asan_stack_free_4(void *ptr, uintptr_t size)
{
ubsan("stack free 4");
UNUSED(ptr);
UNUSED(size);
ubsan("stack free 4");
UNUSED(ptr);
UNUSED(size);
}
void __asan_stack_free_5(void *ptr, uintptr_t size)
{
ubsan("stack free 5");
UNUSED(ptr);
UNUSED(size);
ubsan("stack free 5");
UNUSED(ptr);
UNUSED(size);
}
void __asan_stack_free_6(void *ptr, uintptr_t size)
{
ubsan("stack free 6");
UNUSED(ptr);
UNUSED(size);
ubsan("stack free 6");
UNUSED(ptr);
UNUSED(size);
}
void __asan_stack_free_7(void *ptr, uintptr_t size)
{
ubsan("stack free 7");
UNUSED(ptr);
UNUSED(size);
ubsan("stack free 7");
UNUSED(ptr);
UNUSED(size);
}
void __asan_stack_free_8(void *ptr, uintptr_t size)
{
ubsan("stack free 8");
UNUSED(ptr);
UNUSED(size);
ubsan("stack free 8");
UNUSED(ptr);
UNUSED(size);
}
void __asan_stack_free_9(void *ptr, uintptr_t size)
{
ubsan("stack free 9");
UNUSED(ptr);
UNUSED(size);
ubsan("stack free 9");
UNUSED(ptr);
UNUSED(size);
}
void __asan_poison_stack_memory(void *addr, uintptr_t size)
{
ubsan("poison stack memory");
UNUSED(addr);
UNUSED(size);
ubsan("poison stack memory");
UNUSED(addr);
UNUSED(size);
}
void __asan_unpoison_stack_memory(void *addr, uintptr_t size)
{
ubsan("unpoison stack memory");
UNUSED(addr);
UNUSED(size);
ubsan("unpoison stack memory");
UNUSED(addr);
UNUSED(size);
}
void __asan_before_dynamic_init(const char *module_name)
{
ubsan("before dynamic init");
UNUSED(module_name);
ubsan("before dynamic init");
UNUSED(module_name);
}
void __asan_after_dynamic_init(void) { ubsan("after dynamic init"); }
void __asan_register_globals(void *unknown, size_t size)
{
ubsan("register_globals");
UNUSED(unknown);
UNUSED(size);
ubsan("register_globals");
UNUSED(unknown);
UNUSED(size);
}
void __asan_unregister_globals(void) { ubsan("unregister_globals"); }
@ -364,155 +364,155 @@ void __asan_option_detect_stack_use_after_return(void) { ubsan("stack use after
__noreturn void __asan_handle_no_return(void)
{
ubsan("no_return");
while (1)
;
ubsan("no_return");
while (1)
;
}
#define is_aligned(value, alignment) !(value & (alignment - 1))
const char *Type_Check_Kinds[] = {
"Load of",
"Store to",
"Reference binding to",
"Member access within",
"Member call on",
"Constructor call on",
"Downcast of",
"Downcast of",
"Upcast of",
"Cast to virtual base of",
"Load of",
"Store to",
"Reference binding to",
"Member access within",
"Member call on",
"Constructor call on",
"Downcast of",
"Downcast of",
"Upcast of",
"Cast to virtual base of",
};
void __ubsan_handle_type_mismatch_v1(struct type_mismatch_v1_data *type_mismatch, uintptr_t pointer)
{
struct source_location *location = &type_mismatch->location;
if (pointer == 0)
{
ubsan("\t\tIn File: %s:%i:%i", location->file, location->line, location->column);
ubsan("Null pointer access.");
}
else if (type_mismatch->alignment != 0 && is_aligned(pointer, type_mismatch->alignment))
{
ubsan("\t\tIn File: %s:%i:%i", location->file, location->line, location->column);
ubsan("Unaligned memory access %#lx.", pointer);
}
else
{
ubsan("\t\tIn File: %s:%i:%i", location->file, location->line, location->column);
ubsan("%s address %#lx with insufficient space for object of type %s",
Type_Check_Kinds[type_mismatch->type_check_kind],
(void *)pointer, type_mismatch->type->name);
}
struct source_location *location = &type_mismatch->location;
if (pointer == 0)
{
ubsan("\t\tIn File: %s:%i:%i", location->file, location->line, location->column);
ubsan("Null pointer access.");
}
else if (type_mismatch->alignment != 0 && is_aligned(pointer, type_mismatch->alignment))
{
ubsan("\t\tIn File: %s:%i:%i", location->file, location->line, location->column);
ubsan("Unaligned memory access %#lx.", pointer);
}
else
{
ubsan("\t\tIn File: %s:%i:%i", location->file, location->line, location->column);
ubsan("%s address %#lx with insufficient space for object of type %s",
Type_Check_Kinds[type_mismatch->type_check_kind],
(void *)pointer, type_mismatch->type->name);
}
}
void __ubsan_handle_add_overflow(struct overflow_data *data)
{
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Addition overflow.");
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Addition overflow.");
}
void __ubsan_handle_sub_overflow(struct overflow_data *data)
{
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Subtraction overflow.");
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Subtraction overflow.");
}
void __ubsan_handle_mul_overflow(struct overflow_data *data)
{
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Multiplication overflow.");
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Multiplication overflow.");
}
void __ubsan_handle_divrem_overflow(struct overflow_data *data)
{
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Division overflow.");
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Division overflow.");
}
void __ubsan_handle_negate_overflow(struct overflow_data *data)
{
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Negation overflow.");
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Negation overflow.");
}
void __ubsan_handle_pointer_overflow(struct overflow_data *data)
{
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Pointer overflow.");
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Pointer overflow.");
}
void __ubsan_handle_shift_out_of_bounds(struct shift_out_of_bounds_data *data)
{
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Shift out of bounds.");
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Shift out of bounds.");
}
void __ubsan_handle_load_invalid_value(struct invalid_value_data *data)
{
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Invalid load value.");
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Invalid load value.");
}
void __ubsan_handle_out_of_bounds(struct array_out_of_bounds_data *data)
{
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Array out of bounds.");
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Array out of bounds.");
}
void __ubsan_handle_vla_bound_not_positive(struct negative_vla_data *data)
{
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Variable-length argument is negative.");
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Variable-length argument is negative.");
}
void __ubsan_handle_nonnull_return(struct nonnull_return_data *data)
{
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Non-null return is null.");
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Non-null return is null.");
}
void __ubsan_handle_nonnull_return_v1(struct nonnull_return_data *data)
{
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Non-null return is null.");
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Non-null return is null.");
}
void __ubsan_handle_nonnull_arg(struct nonnull_arg_data *data)
{
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Non-null argument is null.");
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Non-null argument is null.");
}
void __ubsan_handle_builtin_unreachable(struct unreachable_data *data)
{
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Unreachable code reached.");
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Unreachable code reached.");
}
void __ubsan_handle_invalid_builtin(struct invalid_builtin_data *data)
{
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Invalid builtin.");
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Invalid builtin.");
}
void __ubsan_handle_missing_return(struct unreachable_data *data)
{
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Missing return.");
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Missing return.");
}
void __ubsan_vptr_type_cache(uintptr_t *cache, uintptr_t ptr)
{
ubsan("Vptr type cache.");
*cache = ptr;
ubsan("Vptr type cache.");
*cache = ptr;
}
void __ubsan_handle_dynamic_type_cache_miss(struct dynamic_type_cache_miss_data *data, uintptr_t ptr)
{
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Dynamic type cache miss.");
UNUSED(ptr);
ubsan("\t\tIn File: %s:%i:%i", data->location.file, data->location.line, data->location.column);
ubsan("Dynamic type cache miss.");
UNUSED(ptr);
}
#endif