This is the repository for paper "Mole: Breaking GPU TEE with GPU-Embedded MCU"
There are mainly the following components in this repository:
parser
: The parser for the GPU MCU firmware.mcu_hacker
: The kernel module to launch the attack on GPU TEE.gpu-program
: The userland hook to the OpenCL program, capturing the OpenCL system calls.shell
: The shellcode to inject into the firmware.benchmark
: The benchmarks tested in the paper.
You need the following dependencies to run the code:
To modify the firmware, we first need to run the shell
to compile the
shellcode to be injected into the firmware. It contains two sources: fw.c
and
reset.c
. By default, fw.c
will be executed on every firmware interrupts
and reset.c
will be executed when the firmware is reset.
cd shell
make
The parser parses the firmware and inject the previous compiled shellcode into the firmware.
cargo run
The above command shall generate a new_csf.bin
file in the parser
directory, which is the tampered firmware.
This is the kernel module for the untrusted kernel to communicate with the GPU, please compile it within the kernel source tree.
This is a userland program to hook the OpenCL system calls. It is used to capture the OpenCL system calls and send them to the kernel module. It needs to be compiled on the victim machine
make
LD_PRELOAD=hook_ocl.so ./<victim_program>