Jinoh Kang (@iamahuman) commented about dlls/ntdll/unix/signal_x86_64.c:
/* send EXCEPTION_EXECUTE_FAULT only if data execution prevention is enabled */ if (!(flags & MEM_EXECUTE_OPTION_DISABLE)) rec.ExceptionInformation[0] = EXCEPTION_READ_FAULT; }
if (is_wow64() && (CS_sig(ucontext) == cs64_sel) && check_invalid_gs( ucontext, &context.c ))
Pardon my mistake earlier. GS restoration is actually unncessary in system code. The condition should be `CS_sig(ucontext) == cs64_sel && virtual_is_valid_code_address( instr, 1 )`.
Also, since you're probably on macOS, have you tried !6866?