]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86: don't allow Dom0 access to port CF9
authorJan Beulich <jbeulich@suse.com>
Thu, 2 Nov 2023 09:43:29 +0000 (10:43 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 2 Nov 2023 09:43:29 +0000 (10:43 +0100)
This allows to initiate machine reset, which we don't want to permit
Dom0 to invoke that way.

While there insert blank lines and convert the sibling PCI config space
port numbers to upper case, matching style earlier in the function.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/dom0_build.c

index 09fb8b063ae75d552216758d1c1b7d655bfb570d..5dc5872e3806e8ef35db88657544e386d071f21f 100644 (file)
@@ -491,8 +491,13 @@ int __init dom0_setup_permissions(struct domain *d)
     /* ACPI PM Timer. */
     if ( pmtmr_ioport )
         rc |= ioports_deny_access(d, pmtmr_ioport, pmtmr_ioport + 3);
-    /* PCI configuration space (NB. 0xcf8 has special treatment). */
-    rc |= ioports_deny_access(d, 0xcfc, 0xcff);
+
+    /* Reset control. */
+    rc |= ioports_deny_access(d, 0xCF9, 0xCF9);
+
+    /* PCI configuration space (NB. 0xCF8 has special treatment). */
+    rc |= ioports_deny_access(d, 0xCFC, 0xCFF);
+
 #ifdef CONFIG_HVM
     if ( is_hvm_domain(d) )
     {