[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2] x86/pv: Inject #UD for missing SYSCALL callbacks
On 09/10/2020 13:40, Manuel Bouyer wrote: > On Fri, Oct 09, 2020 at 12:53:01PM +0100, Andrew Cooper wrote: >> Despite appearing to be a deliberate design choice of early PV64, the >> resulting behaviour for unregistered SYSCALL callbacks creates an untenable >> testability problem for Xen. Furthermore, the behaviour is undocumented, >> bizarre, and inconsistent with related behaviour in Xen, and very liable >> introduce a security vulnerability into a PV guest if the author hasn't >> studied Xen's assembly code in detail. >> >> There are two different bugs here. >> >> 1) The current logic confuses the registered entrypoints, and may deliver a >> SYSCALL from 32bit userspace to the 64bit entry, when only a 64bit >> entrypoint is registered. >> >> This has been the case ever since 2007 (c/s cd75d47348b) but up until >> 2018 (c/s dba899de14) the wrong selectors would be handed to the guest for >> a 32bit SYSCALL entry, making it appear as if it a 64bit entry all along. >> >> Xen would malfunction under these circumstances, if it were a PV guest. >> Linux would as well, but PVOps has always registered both entrypoints and >> discarded the Xen-provided selectors. NetBSD really does malfunction as a >> consequence (benignly now, but a VM DoS before the 2018 Xen selector fix). > What do you mean with «malfunction» ? A 64bits guest can run 32bit code > just fine, this is part of our daily regression tests. Right, but your 32bit code never executes the SYSCALL instruction, because it is hardwired as -ENOSYS on native, and doesn't work on Intel hardware at all. Under Xen, this enters the regular syscall path (buggy but benign), and before the selector fix two years ago, would (AFAICT) eventually try to HYPERCALL_iret with the bogus selectors, and hit the failsafe callback, which is a straight panic(). ~Andrew
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |