Files
linux-kernel-module-cheat/userland/arch/x86_64/div_zero.S
2019-07-07 00:00:01 +00:00

18 lines
392 B
ArmAsm

/* https://cirosantilli.com/linux-kernel-module-cheat#x86-binary-arithmetic-instructions
*
* SIGFPE :-)
*
* Signal handlind discussed at:
* https://stackoverflow.com/questions/39431879/c-handle-signal-sigfpe-and-continue-execution/39431923#39431923
*/
#include <lkmc.h>
LKMC_PROLOGUE
/* rdx:rax / 0 */
mov $0, %rdx
mov $1, %rax
mov $0, %rbx
div %rbx
LKMC_EPILOGUE