Open OrangeGzY opened 2 years ago
And I modify the struct bpf_insn __insns[]
, After that it load succeed, and exec
root@ubuntu:~/ebpf-fuzzer# ./test_sample
update_storage_map done.
97, processed 6 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
.
exec_prog done.
[2]: 494a4b4c4d4e4f40
repro failed
So I'm wondering if the struct bpf_insn __insns[]
generation can still be optimized :)In order to avoid this kind of situation
So I'm wondering if the
struct bpf_insn __insns[]
generation can still be optimized :)In order to avoid this kind of situation
Yes, it can be optimized.
For the first question, you can check your config
file and the guest log in the instance_* folder.
Thanks to your great idea and project !
When I run the project with the correct kernel CONFIG (including CONFIG_BPF_SYSCALL=y , CONFIG_BPF_JIT=y),
but I still got the ouput:
After that, I tried to run:
And then got a test file in /tmp/test_sample.c
So I compile this file in the host and it succeed.
Finally I run the file, but I got :
Then I check the test_sample.c and open some fprintf() for error, and re-compile test_sample.c , which finally got:
It seems that the
struct bpf_insn __insns[]
load failed which made the fuzzer in a abnormal state?The test_sample.c is :