Merge "Fix x86_64 check for signal handler." am: 36991d8e26 am: 0a8f898eee

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1430216

Change-Id: I080066696d9d4d29766d65a588d343da5137b470
This commit is contained in:
Christopher Ferris 2020-09-18 18:56:11 +00:00 committed by Automerger Merge Worker
commit fb5b39c235

View file

@ -141,15 +141,14 @@ bool RegsX86_64::StepIfSignalHandler(uint64_t elf_offset, Elf* elf, Memory* proc
return false; return false;
} }
uint16_t data2; uint8_t data2;
if (!elf_memory->ReadFully(elf_offset + 8, &data2, sizeof(data2)) || data2 != 0x0f05) { if (!elf_memory->ReadFully(elf_offset + 8, &data2, sizeof(data2)) || data2 != 0x05) {
return false; return false;
} }
// __restore_rt: // __restore_rt:
// 0x48 0xc7 0xc0 0x0f 0x00 0x00 0x00 mov $0xf,%rax // 0x48 0xc7 0xc0 0x0f 0x00 0x00 0x00 mov $0xf,%rax
// 0x0f 0x05 syscall // 0x0f 0x05 syscall
// 0x0f nopl 0x0($rax)
// Read the mcontext data from the stack. // Read the mcontext data from the stack.
// sp points to the ucontext data structure, read only the mcontext part. // sp points to the ucontext data structure, read only the mcontext part.