Re: [PATCH v1 2/4] x86/tdx: Add validation of userspace MMIO instructions
From: Thomas Gleixner
Date: Tue Jul 30 2024 - 14:35:59 EST
On Tue, Jul 30 2024 at 19:35, Alexey Gladkov wrote:
>
> + vaddr = (unsigned long)insn_get_addr_ref(&insn, regs);
> +
> + if (user_mode(regs)) {
> + if (mmap_read_lock_killable(current->mm))
> + return -EINTR;
> +
> + ret = valid_vaddr(ve, mmio, size, vaddr);
> + if (ret)
> + goto fault;
fault is really the wrong name for the label because it's the general
return point of the function. 'out' or 'unlock' perhaps?
Thanks,
tglx