addr = unwind_get_return_address(&state); if (!addr) return -EINVAL;
#ifdef CONFIG_RETHOOK /* * Mark stacktraces with krethook functions on them * as unreliable.
*/ if (state.ip == (unsignedlong)arch_rethook_trampoline) return -EINVAL; #endif
if (!consume_entry(cookie, addr)) return -EINVAL;
}
/* Check for stack corruption */ if (unwind_error(&state)) return -EINVAL; return 0;
}
staticinlinebool ip_invalid(unsignedlong ip)
{ /* * Perform some basic checks if an instruction address taken * from unreliable source is invalid.
*/ if (ip & 1) returntrue; if (ip < mmap_min_addr) returntrue; if (ip >= current->mm->context.asce_limit) returntrue; returnfalse;
}
if (is_compat_task()) return; if (!current->mm) return;
ip = instruction_pointer(regs); if (!store_ip(consume_entry, cookie, entry, perf, ip)) return;
sf = (void __user *)user_stack_pointer(regs);
pagefault_disable(); while (1) { if (__get_user(sp, &sf->back_chain)) break; /* * VDSO entry code has a non-standard stack frame layout. * See VDSO user wrapper code for details.
*/ if (!sp && ip_within_vdso(ip)) {
sf_vdso = (void __user *)sf; if (__get_user(ip, &sf_vdso->return_address)) break;
sp = (unsignedlong)sf + STACK_FRAME_VDSO_OVERHEAD;
sf = (void __user *)sp; if (__get_user(sp, &sf->back_chain)) break;
} else {
sf = (void __user *)sp; if (__get_user(ip, &sf->gprs[8])) break;
} /* Sanity check: ABI requires SP to be 8 byte aligned. */ if (sp & 0x7) break; if (ip_invalid(ip)) { /* * If the instruction address is invalid, and this * is the first stack frame, assume r14 has not * been written to the stack yet. Otherwise exit.
*/ if (!first) break;
ip = regs->gprs[14]; if (ip_invalid(ip)) break;
} if (!store_ip(consume_entry, cookie, entry, perf, ip)) break;
first = false;
}
pagefault_enable();
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.3Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.