if (likely(instruction_pointer(regs) - sd->offset < sd->len)) returnfalse;
if (unlikely(arch_syscall_is_vdso_sigreturn(regs))) returnfalse;
if (likely(sd->selector)) { /* * access_ok() is performed once, at prctl time, when * the selector is loaded by userspace.
*/ if (unlikely(__get_user(state, sd->selector))) {
force_exit_sig(SIGSEGV); returntrue;
}
if (likely(state == SYSCALL_DISPATCH_FILTER_ALLOW)) returnfalse;
if (state != SYSCALL_DISPATCH_FILTER_BLOCK) {
force_exit_sig(SIGSYS); returntrue;
}
}
staticint task_set_syscall_user_dispatch(struct task_struct *task, unsignedlong mode, unsignedlong offset, unsignedlong len, char __user *selector)
{ switch (mode) { case PR_SYS_DISPATCH_OFF: if (offset || len || selector) return -EINVAL; break; case PR_SYS_DISPATCH_EXCLUSIVE_ON: /* * Validate the direct dispatcher region just for basic * sanity against overflow and a 0-sized dispatcher * region. If the user is able to submit a syscall from * an address, that address is obviously valid.
*/ if (offset && offset + len <= offset) return -EINVAL; break; case PR_SYS_DISPATCH_INCLUSIVE_ON: if (len == 0 || offset + len <= offset) return -EINVAL; /* * Invert the range, the check in syscall_user_dispatch() * supports wrap-around.
*/
offset = offset + len;
len = -len; break; default: return -EINVAL;
}
/* * access_ok() will clear memory tags for tagged addresses * if current has memory tagging enabled. * * To enable a tracer to set a tracees selector the * selector address must be untagged for access_ok(), * otherwise an untagged tracer will always fail to set a * tagged tracees selector.
*/ if (mode != PR_SYS_DISPATCH_OFF && selector &&
!access_ok(untagged_addr(selector), sizeof(*selector))) return -EFAULT;
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.