Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some issues with testing the test_kdfsan_kocher. c file at different optimization levels #10

Open
corvus10086 opened this issue Oct 11, 2024 · 0 comments

Comments

@corvus10086
Copy link

Hello

I'm a PhD student at Xidian University, and I'm trying to reproduce the detection of 15 Spectre attack instances mentioned in a paper and conduct further experiments.

I run the command task qemu:kocher-test to test 15 examples of Spectre attacks in the test_kdfsan_kocher.c file. The output results included all 15 instances. Next, I will attempt to modify the optimization level of the test_kdfsan_kocher.c file in the Makefile under the kdfsan-linux/lib directory. The original optimization level was O0. I changed it to O1, O2, or O3, and after running the command task kernel:config build kernel:bzImage, a bunch of warnings were generated. Below is part of the warning.

vmlinux.o: warning: objtool: dfs$asan.module_dtor()+0x10: call without frame pointer save/setup
vmlinux.o: warning: objtool: dfs$asan.module_dtor()+0x10: call without frame pointer save/setup
vmlinux.o: warning: objtool: .text.dfsw$printk: unexpected end of section
vmlinux.o: warning: objtool: .text.dfsw$panic: unexpected end of section
vmlinux.o: warning: objtool: dfs$__setup_rt_frame()+0x1100: call to kspecem_hook_restart() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$cp_stat64()+0x3cf: call to kspecem_hook_restart() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$type_show()+0x4: undefined stack state
vmlinux.o: warning: objtool: dfs$copy_fpstate_to_sigframe()+0x12ce: call to kspecem_hook_restart() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$fpu__restore_sig()+0x13bd: call to kspecem_hook_restart() with UACCESS enabled
vmlinux.o: warning: objtool: .text.dfs$__acpi_get_override_irq: unexpected end of section
vmlinux.o: warning: objtool: .text.dfs$irq_is_level: unexpected end of section
vmlinux.o: warning: objtool: dfs$ia32_setup_frame()+0x6da: call to kspecem_hook_restart() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$ia32_setup_rt_frame()+0x3d5: call to kspecem_hook_restart() with UACCESS enabled
vmlinux.o: warning: objtool: .text.dfsw$__efi_call: unexpected end of section
vmlinux.o: warning: objtool: .text.dfsw$__efi64_thunk: unexpected end of section
vmlinux.o: warning: objtool: dfs$__do_sys_waitid()+0x6fa: call to kspecem_hook_restart() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$__do_compat_sys_waitid()+0x6e0: call to kspecem_hook_restart() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$do_futex()+0x3f87: call to kspecem_hook_restart() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$handle_futex_death()+0x8cc: call to kspecem_hook_restart() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$futex_lock_pi_atomic()+0x13bb: call to kspecem_hook_restart() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$fixup_pi_state_owner()+0xbc8: call to kspecem_hook_restart() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$__se_compat_sys_sched_setaffinity()+0x47e: call to kspecem_hook_restart() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$__se_compat_sys_sched_getaffinity()+0x5b3: call to kspecem_hook_restart() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$compat_get_bitmap()+0x287: call to kspecem_hook_restart() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$compat_put_bitmap()+0x290: call to kspecem_hook_restart() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$__sanitizer_cov_trace_pc()+0x30: call to kspecem_hook_check_spec_length() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$__sanitizer_cov_trace_cmp1()+0x4b: call to kspecem_hook_check_spec_length() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$__sanitizer_cov_trace_cmp2()+0x4b: call to kspecem_hook_check_spec_length() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$__sanitizer_cov_trace_cmp4()+0x4b: call to kspecem_hook_check_spec_length() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$__sanitizer_cov_trace_cmp8()+0x49: call to kspecem_hook_check_spec_length() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$__sanitizer_cov_trace_const_cmp1()+0x4b: call to kspecem_hook_check_spec_length() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$__sanitizer_cov_trace_const_cmp2()+0x4b: call to kspecem_hook_check_spec_length() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$__sanitizer_cov_trace_const_cmp4()+0x4b: call to kspecem_hook_check_spec_length() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$__sanitizer_cov_trace_const_cmp8()+0x49: call to kspecem_hook_check_spec_length() with UACCESS enabled
vmlinux.o: warning: objtool: dfs$__sanitizer_cov_trace_switch()+0x88: call to kspecem_hook_check_spec_length() with UACCESS enabled
vmlinux.o: warning: objtool: .text.dfs$rb_event_length: unexpected end of section
vmlinux.o: warning: objtool: .text.dfs$ring_buffer_discard_commit: unexpected end of section
vmlinux.o: warning: objtool: .text.dfs$rb_buffer_peek: unexpected end of section
vmlinux.o: warning: objtool: .text.dfs$rb_advance_reader: unexpected end of section
vmlinux.o: warning: objtool: .text.dfs$rb_advance_iter: unexpected end of section
vmlinux.o: warning: objtool: dfs$kasan_report()+0xb: call to kspecem_hook_store() with UACCESS enabled
vmlinux.o: warning: objtool: kasan_report_original()+0x316: call to kspecem_hook_check_spec_length() with UACCESS enabled

At first, I ignored these warnings, but only when the optimization level was O1 did the output results match the expectations. The report for dfs$testkocher_victim_function_v08 disappeared (because the cmov instruction was used for optimization). However, at optimization levels O2 and O3, the reports for all 15 functions disappeared. I feel like this isn't normal, or is there something wrong with the way I'm testing those 15 examples?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant