spec-fault
"predicts" whether accessing said memory will trigger a fault via side-channel speculative execution.
the demo above uses spec-fault
to detect memory breakpoints and protect critical memory from debuggers.
- compile
lib/spec-fault.c
and includelib/spec-fault.h
. - use
spec_fault_read
to check for read faults. - use
spec_fault_write
to check for write faults. - a return value of
true
indicates a (possible) fault.
although the GIF above does look pretty cool:
- like any other timing-based technique, this method is never 100% accurate.
- while a memory breakpoint does cause a fault, not every fault is due to a breakpoint.
- currently, altering a page's flags makes
spec_fault_write
report a fault indefinitely.
please bear these issues in mind when evaluating this project.