Index: sys/arch/i386/i386/trap.c =================================================================== RCS file: /cvsroot/src/sys/arch/i386/i386/trap.c,v retrieving revision 1.301 diff -p -u -r1.301 trap.c --- sys/arch/i386/i386/trap.c 29 May 2019 14:28:37 -0000 1.301 +++ sys/arch/i386/i386/trap.c 6 Jun 2019 06:25:21 -0000 @@ -582,17 +582,20 @@ kernelfault: if (frame->tf_err & PGEX_X) { /* SMEP might have brought us here */ - if (cr2 > VM_MIN_ADDRESS && cr2 <= VM_MAXUSER_ADDRESS) - panic("prevented execution of %p (SMEP)", + if (cr2 > VM_MIN_ADDRESS && cr2 <= VM_MAXUSER_ADDRESS) { + printf("prevented execution of %p (SMEP)", (void *)cr2); + goto we_re_toast; + } } if ((frame->tf_err & PGEX_P) && cr2 < VM_MAXUSER_ADDRESS) { /* SMAP might have brought us here */ if (onfault_handler(pcb, frame) == NULL) { - panic("prevented access to %p (SMAP)", + printf("prevented access to %p (SMAP)", (void *)cr2); + goto we_re_toast; } } Index: sys/arch/amd64/amd64/trap.c =================================================================== RCS file: /cvsroot/src/sys/arch/amd64/amd64/trap.c,v retrieving revision 1.120 diff -p -u -r1.120 trap.c --- sys/arch/amd64/amd64/trap.c 15 May 2019 13:49:10 -0000 1.120 +++ sys/arch/amd64/amd64/trap.c 6 Jun 2019 06:25:21 -0000 @@ -481,13 +481,10 @@ trap(struct trapframe *frame) if (frame->tf_err & PGEX_X) { /* SMEP might have brought us here */ if (cr2 < VM_MAXUSER_ADDRESS) { - if (cr2 == 0) - panic("prevented jump to null" - " instruction pointer (SMEP)"); - else - panic("prevented execution of" - " user address %p (SMEP)", - (void *)cr2); + printf("prevented execution of" + " user address %p (SMEP)", + (void *)cr2); + goto we_re_toast; } } @@ -495,8 +492,9 @@ trap(struct trapframe *frame) cr2 < VM_MAXUSER_ADDRESS) { /* SMAP might have brought us here */ if (onfault_handler(pcb, frame) == NULL) { - panic("prevented access to %p (SMAP)", + printf("prevented access to %p (SMAP)", (void *)cr2); + goto we_re_toast; } }