From 9e72630517b6dd27cfdf0e553592c713742a16f9 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Wed, 22 Dec 2021 21:40:54 -0600 Subject: [PATCH] Security: Invalid memory access in interrupt handlers. When I converted the data_main into a pointer from a value, I failed to remove the references on these variables. The compiler does not catch these because they are cast to a void *. --- level_3/fake/c/private-build-load.c | 2 +- level_3/fake/c/private-make-load_fakefile.c | 4 ++-- level_3/fake/c/private-make-operate.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/level_3/fake/c/private-build-load.c b/level_3/fake/c/private-build-load.c index 2e706fa..c251133 100644 --- a/level_3/fake/c/private-build-load.c +++ b/level_3/fake/c/private-build-load.c @@ -114,7 +114,7 @@ extern "C" { f_fss_delimits_t delimits = f_fss_delimits_t_initialize; { - f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_fss, 0, (void *) &main, 0); + f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_fss, 0, (void *) main, 0); *status = fll_fss_extended_read(buffer, state, &range, &objects, &contents, 0, 0, &delimits, 0); } diff --git a/level_3/fake/c/private-make-load_fakefile.c b/level_3/fake/c/private-make-load_fakefile.c index 05355d9..8fd4fa0 100644 --- a/level_3/fake/c/private-make-load_fakefile.c +++ b/level_3/fake/c/private-make-load_fakefile.c @@ -53,7 +53,7 @@ extern "C" { f_fss_comments_t comments = f_fss_comments_t_initialize; { - f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_fss, 0, (void *) &main, 0); + f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_fss, 0, (void *) main, 0); *status = fll_fss_basic_list_read(data_make->buffer, state, &range, &list_objects, &list_contents, &delimits, 0, &comments); } @@ -86,7 +86,7 @@ extern "C" { f_fss_set_t settings = f_fss_set_t_initialize; - f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_fss, 0, (void *) &main, 0); + f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_fss, 0, (void *) main, 0); const f_string_static_t name_settings = macro_f_string_static_t_initialize(fake_make_section_settings_s, fake_make_section_settings_s_length); const f_string_static_t name_main = macro_f_string_static_t_initialize(fake_make_section_main_s, fake_make_section_main_s_length); diff --git a/level_3/fake/c/private-make-operate.c b/level_3/fake/c/private-make-operate.c index aa2133e..e02456d 100644 --- a/level_3/fake/c/private-make-operate.c +++ b/level_3/fake/c/private-make-operate.c @@ -159,7 +159,7 @@ extern "C" { f_iki_content_t iki_content = f_iki_content_t_initialize; f_iki_delimits_t iki_delimits = f_iki_delimits_t_initialize; - f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_iki, 0, (void *) &main, 0); + f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_iki, 0, (void *) main, 0); f_string_range_t range = f_string_range_t_initialize; f_string_map_multis_t *parameter = &data_make->setting_make.parameter; -- 1.8.3.1