This project hosts two source files for a kernel proc module. Verified working for kernel v4.14.
- Add these two source file to
kernel/drivers/misc
- Enable build in
kernel/drivers/misc/Makefile
obj-y += hello_cfi.o
obj-y += hello_cfi_asm.o
cat /proc/hello_cfi
echo [0-5] > /proc/hello_cfi
Here not_entry_point function must be written in purely assembly, to avoid compiler generated prologue and epilogue. Detailed explaination in [].
This project is based on cfi_icall.c, credit to trailofbits.