lkml.org 
[lkml]   [2022]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv4 17/30] x86/tdx: Add port I/O emulation
On 2/24/22 07:56, Kirill A. Shutemov wrote:
> @@ -347,6 +399,8 @@ static bool virt_exception_kernel(struct pt_regs *regs, struct ve_info *ve)
> return handle_cpuid(regs);
> case EXIT_REASON_EPT_VIOLATION:
> return handle_mmio(regs, ve);
> + case EXIT_REASON_IO_INSTRUCTION:
> + return handle_io(regs, ve->exit_qual);

Sorry to keep throwing random new things at this patch set. Thanks for
bearing with me.

Is there anything to keep these port I/O #VE's from occurring in
userspace? It's not how things are normally done, but is there
something fundamental to keep ioperm() and friends from working in TDX
guests?

As it stands with this set, userspace would probably
1. Succeed with the ioperm()
2. Do a port I/O instruction
3. Trigger a #VE
4. Get killed by the SIGSEGV that came from the #VE handler

That's not a horrible state of affairs. But, if this *can* happen, it
might be nice to just refuse the ioperm() in the first place.

\
 
 \ /
  Last update: 2022-02-25 05:00    [W:0.426 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site