During execution of loop on line 2. it is possible that sym_mapping still will not be initialized
On line 3. unitialized value from sym_mapping array will be used and after some modifications written back to a buffer containing bpf program.
As a result it is possible to obtain the access to parts of stack memory.
Impact Details
Could be used to bypass ASLR/DEP protections from fd_net tile.
Proof of concept
Proof of Concept
How to reproduce:
get the archive from provided gist link, it contains slightly modified fd_ebpf.c file and testcase.
You need to run base64 decoder to unpack it:
$ base64 -d gist.txt > repro.tgz
$ tar zxf repro.tgz
That is we crash if we notice the use of unitialized values from sym_mapping array.
copy new fd_ebpf.c over src/waltz/ebpf/fd_ebpf.c file and build fuzzers
run fuzz_ebpf fuzzer and observe it crash:
./fuzz_ebpf test.bin
Running: test1.bin
Setting mapping value for index 5
Last index is 6
Aplying relocs for index 4
Value s = 4142434451525354
Usage of unitialized value from sym_mapping detected!