Skip to contentSkip to conversation

docs: UEFI Secure Boot security policy

PATCH In review Andrew Cooper 8 participants 21 messages Jun 11, 2025 – Jun 20, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs: UEFI Secure Boot security policy

Written to be solution and deployment neutral in order to focus on the technology itself. This policy is intended to work as well for UKI as for the "classic server setup" approach.

---
CC: Anthony PERARD <[email protected]>
CC: Michal Orzel <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Julien Grall <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: [email protected]
CC: Juergen Gross <[email protected]>
CC: Marek Marczykowski-Górecki <[email protected]>
CC: Trammell Hudson <[email protected]>
CC: Ross Lagerwall <[email protected]>
CC: Frediano Ziglio <[email protected]>
CC: Gerald Elder-Vass <[email protected]>
CC: Kevin Lampis <[email protected]>

A rendered version is available at:
https://andrewcoop-xen.readthedocs.io/en/docs-secureboot/admin-guide/uefi-secure-boot.html

Obviously RFC at this point. It's worth saying that XenServer is intending to use Shim and get a signature from Microsoft, retaining all exiting features such as Livepatching and Kexec crash reporting.

This trails off into more TODOs towards the end. Individual tasks should expand on the start made and resulting conversation from this thread. As a reminder, the target audience for this doc is an administrator running a Xen deployment, but who is not necesserily a developer.

Several things are hard to express and want further discussion. Suggestions welcome:

1) Content of CONFIG_CMDLINE and the various CONFIG_*_DEFAULT options. Xen is not going to be issuing XSAs for "downstream chose an unsafe configuration, then signed and deployed the result", yet Xen probably should be on the hook for bad "default ..." settings in Kconfig.

2) Pre-boot DMA Protection. Microsoft consider this a platform feature requiring OEM enablement, and do not consider its absence to be a Secure Boot vulnerability. But, it is less clear what the policy ought to be for Xen booting on a capable system and failing to do a correct live-handover of the IOMMU across ExitBootServices().

3) The AMD microcode signature vulnerability. While it's not Xen's bug per say, it's clearly a Secure Boot bypass because we do offer microcode loading capabilties to userspace, and malicious userspace can load an unauthorised microcode which allows them to read/write physical memory and bypass further signature checks.

4) Userspace Hypercalls. To anyone who isn't already aware, /dev/xen/privcmd in the various Unicies is a giant priv-esc hole, as root userspace can e.g. issue direct memory hypercalls behind the back of an (intentionally) oblivious kernel, and cannot be handwaved away as "it's fine because it's root" under Secure Boot. It's not a Xen vuln (Xen *does* audit pointers in guest hypercalls), but it is a guest kernel vuln because of failing to correctly audit hypercall parameters. However, it does require substantial changes in Xen in order to allow guest kernels to do something half-way safe.

---
 docs/admin-guide/index.rst            |   1 +
 docs/admin-guide/uefi-secure-boot.rst | 134 ++++++++++++++++++++++++++
 2 files changed, 135 insertions(+)
 create mode 100644 docs/admin-guide/uefi-secure-boot.rst
docs/admin-guide/index.rst +1 -0
index 54e6f65de347..e7895ee95001 100644
@@ -5,4 +5,5 @@ Admin Guide
 
 .. toctree::
    introduction
+   uefi-secure-boot
    microcode-loading
docs/admin-guide/uefi-secure-boot.rst new file +134 -0

134 lines not on this page · raw message

Signature · 1 line
2.39.5
#1 lore raw
Quoted 207 lines · Andrew Cooper

Written to be solution and deployment neutral in order to focus on the technology itself. This policy is intended to work as well for UKI as for the "classic server setup" approach.

---
CC: Anthony PERARD <[email protected]>
CC: Michal Orzel <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Julien Grall <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: [email protected]
CC: Juergen Gross <[email protected]>
CC: Marek Marczykowski-Górecki <[email protected]>
CC: Trammell Hudson <[email protected]>
CC: Ross Lagerwall <[email protected]>
CC: Frediano Ziglio <[email protected]>
CC: Gerald Elder-Vass <[email protected]>
CC: Kevin Lampis <[email protected]>

A rendered version is available at:
https://andrewcoop-xen.readthedocs.io/en/docs-secureboot/admin-guide/uefi-secure-boot.html

Obviously RFC at this point. It's worth saying that XenServer is intending to use Shim and get a signature from Microsoft, retaining all exiting features such as Livepatching and Kexec crash reporting.

This trails off into more TODOs towards the end. Individual tasks should expand on the start made and resulting conversation from this thread. As a reminder, the target audience for this doc is an administrator running a Xen deployment, but who is not necesserily a developer.

Several things are hard to express and want further discussion. Suggestions welcome:

1) Content of CONFIG_CMDLINE and the various CONFIG_*_DEFAULT options. Xen is not going to be issuing XSAs for "downstream chose an unsafe configuration, then signed and deployed the result", yet Xen probably should be on the hook for bad "default ..." settings in Kconfig.

2) Pre-boot DMA Protection. Microsoft consider this a platform feature requiring OEM enablement, and do not consider its absence to be a Secure Boot vulnerability. But, it is less clear what the policy ought to be for Xen booting on a capable system and failing to do a correct live-handover of the IOMMU across ExitBootServices().

3) The AMD microcode signature vulnerability. While it's not Xen's bug per say, it's clearly a Secure Boot bypass because we do offer microcode loading capabilties to userspace, and malicious userspace can load an unauthorised microcode which allows them to read/write physical memory and bypass further signature checks.

4) Userspace Hypercalls. To anyone who isn't already aware, /dev/xen/privcmd in the various Unicies is a giant priv-esc hole, as root userspace can e.g. issue direct memory hypercalls behind the back of an (intentionally) oblivious kernel, and cannot be handwaved away as "it's fine because it's root" under Secure Boot. It's not a Xen vuln (Xen *does* audit pointers in guest hypercalls), but it is a guest kernel vuln because of failing to correctly audit hypercall parameters. However, it does require substantial changes in Xen in order to allow guest kernels to do something half-way safe.

---
 docs/admin-guide/index.rst            |   1 +
 docs/admin-guide/uefi-secure-boot.rst | 134 ++++++++++++++++++++++++++
 2 files changed, 135 insertions(+)
 create mode 100644 docs/admin-guide/uefi-secure-boot.rst
docs/admin-guide/index.rst +1 -0
index 54e6f65de347..e7895ee95001 100644
@@ -5,4 +5,5 @@ Admin Guide
 
 .. toctree::
    introduction
+   uefi-secure-boot
    microcode-loading
docs/admin-guide/uefi-secure-boot.rst new file +124 -0
new file mode 100644
index 000000000000..0e0f50143892
@@ -0,0 +1,134 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+UEFI Secure Boot
+================
+
+UEFI Secure Boot is a verification mechanism, intended to ensure that only
+code trusted by the platform can run.  This is to prevent malicious code from
+hijacking the system.  Secure Boot requires that all privileged code be
+signed, and that there is a trust relationship with the platform; i.e. code
+which is not signed by a key enrolled in platform must not run privileged.
+
+Within the Xen architecture, Xen, the :term:`control domain` and
+:term:`hardware domain` share responsibility for running and administering the
+platform.  This makes their kernels privileged as far as Secure Boot is
+concerned.
+
+When Secure Boot is active in the platform, privileged code is required to not
+run any untrusted code (i.e. not run any code for which there is not a good
+signature), and is required not to allow this restriction to be bypassed
+(e.g. by command line request).
+
+
+Support in Xen
+--------------
+
+There are multiple ways to achieve this security goal, with differing
+tradeoffs for the eventual system.
+
+On one end of the spectrum is the Unified Kernel Image.  e.g. Xen is bundled
+with the dom0 kernel and init-ramdisk, with an embedded command line, and with
+livepatching and kexec compiled out, and suitably signed.  The signature is
+checked by the bootloader and, as this covers all the privileged code, Xen
+doesn't need to perform further checks itself.
+
+On the other end of the spectrum is maintaining the features of existing
+deployments.  e.g. Xen needs signature checking capabilities for the dom0
+kernel, livepatches and kexec kernels, and needs to allow the use of safe
+command line options while disallowing unsafe ones.
+
+It is important to remember that Xen is one piece of the larger platform,
+where every piece depends on the correct functioning of all earlier pieces.  A
+product supporting Secure Boot requires a holistic approach involving all
+components in the system.  It is not sufficient to consider Xen in isolation.
+
+.. TODO: Move "In Progress" tasks here as they become ready
+
+Security Scope
+--------------
+
+Vulnerabilities impacting Secure Boot require a fixed component to be produced
+and distributed, the vulnerable component to be revoked, and the revocation
+distributed to platforms.
+
+The following principles and guidelines indicate where Secure Boot differs
+from more traditional security models, and the situations in which extra
+remediation may be necessary.
+
+Principles
+^^^^^^^^^^
+
+ * Privileged code shall include Xen and the kernel(s) of the control and
+   hardware domain (both, if they're split).  While there is a privilege split
+   here in Xen's regular security model, they are equal from Secure Boot's
+   point of view.
+
+ * Root or ADMIN in userspace is unprivileged from Secure Boot's point of
+   view, and must not be able to alter the enforcement policy or load unsigned
+   code even by e.g. editing a configuration file and rebooting.
+
+Within Scope
+^^^^^^^^^^^^
+
+The following types of issue require remediation and revocation of vulnerable
+binaries.
+
+ * Any failure to apply enforcements even against traditionally-privileged
+   userspace, including failure to authenticate new code to run and failure to
+   handle revocations properly.
+
+ * Any Out-of-Bounds write capable of altering the enforcement policy, or
+   capable of bypassing enforcement, e.g. by corrupting the running code.
+
+Out of Scope
+^^^^^^^^^^^^
+
+While typically a security issue in their own rights, these issues do not
+constitute a Secure Boot vulnerability, and do not require special
+remediation.
+
+ * Denial of Service vulnerabilities.
+
+ * Out-of-Bounds reads.
+
+The Xen Security Team will endeavour to produce XSAs for all violations of
+this security policy, including identifying them specifically as requiring
+further remediation by downstreams.
+
+
+In Progress
+-----------
+
+.. warning::
+
+   The following work is still in progress.  It is provisional, and not
+   security supported yet.
+
+
+Secure Boot Advanced Targeting
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+SBAT is a recovation scheme for Secure Boot enabled components, using a
+generation based scheme.  See `Shim SBAT.md
+<https://github.com/rhboot/shim/blob/main/SBAT.md>`_ for full details.
+
+Upstream Xen provides the infrastructure to embed SBAT metadata in
+``xen.efi``, but does not maintain a generation number itself.  Downstreams
+are expected to maintain their own generation numbers.
+
+
+Lockdown Mode
+^^^^^^^^^^^^^
+
+A mode which causes the enforcement of the properties necessary to conform to
+the Secure Boot specification.  Lockdown Mode is forced active when Secure

docs/admin-guide/uefi-secure-boot.rst line 134

Quoted 10 lines
docs/admin-guide/uefi-secure-boot.rst new file +10 -0
+Boot is active in the platform, but may be activated independently too for
+development purposes with the ``lockdown`` command line option.
+
+TODO
+^^^^
+
+ * Command Line
+ * Livepatching
+ * Kexec
+ * Userspace hypercalls

This is so much more reasonable than Linux's policy. I wonder how often Linux would need to revoke if it followed a policy like this.

Signature · 2 lines
Sincerely,
Demi Marie Obenour (she/her/hers)
#2 lore raw
In reply to Andrew Cooper
Quoted 33 lines · Andrew Cooper

Written to be solution and deployment neutral in order to focus on the technology itself. This policy is intended to work as well for UKI as for the "classic server setup" approach.

---
CC: Anthony PERARD <[email protected]>
CC: Michal Orzel <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Julien Grall <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: [email protected]
CC: Juergen Gross <[email protected]>
CC: Marek Marczykowski-Górecki <[email protected]>
CC: Trammell Hudson <[email protected]>
CC: Ross Lagerwall <[email protected]>
CC: Frediano Ziglio <[email protected]>
CC: Gerald Elder-Vass <[email protected]>
CC: Kevin Lampis <[email protected]>

A rendered version is available at:
https://andrewcoop-xen.readthedocs.io/en/docs-secureboot/admin-guide/uefi-secure-boot.html

Obviously RFC at this point. It's worth saying that XenServer is intending to use Shim and get a signature from Microsoft, retaining all exiting features such as Livepatching and Kexec crash reporting.

This trails off into more TODOs towards the end. Individual tasks should expand on the start made and resulting conversation from this thread. As a reminder, the target audience for this doc is an administrator running a Xen deployment, but who is not necesserily a developer.

Quoted 7 lines

Several things are hard to express and want further discussion. Suggestions welcome:

1) Content of CONFIG_CMDLINE and the various CONFIG_*_DEFAULT options. Xen is not going to be issuing XSAs for "downstream chose an unsafe configuration, then signed and deployed the result", yet Xen probably should be on the hook for bad "default ..." settings in Kconfig.

Should there be some guidelines what values are/aren't safe for UEFI SB? I don't think there can be a simple list, for example some things may depend on other settings and/or whether UKI is involved. But some comment about relation to UEFI SB (in Kconfig help?) would be useful. As for CONFIG_CMDLINE, IIUC the current implementation does cover it too (as in, lockdown mode will filter built-in cmdline too).

Quoted 5 lines

2) Pre-boot DMA Protection. Microsoft consider this a platform feature requiring OEM enablement, and do not consider its absence to be a Secure Boot vulnerability. But, it is less clear what the policy ought to be for Xen booting on a capable system and failing to do a correct live-handover of the IOMMU across ExitBootServices().

That's a very good question. Do you know if disabling pre-boot DMA protection is allowed if UEFI SB is enabled? If so, I'd assume it doesn't need to be covered.

Quoted 69 lines

3) The AMD microcode signature vulnerability. While it's not Xen's bug per say, it's clearly a Secure Boot bypass because we do offer microcode loading capabilties to userspace, and malicious userspace can load an unauthorised microcode which allows them to read/write physical memory and bypass further signature checks.

4) Userspace Hypercalls. To anyone who isn't already aware, /dev/xen/privcmd in the various Unicies is a giant priv-esc hole, as root userspace can e.g. issue direct memory hypercalls behind the back of an (intentionally) oblivious kernel, and cannot be handwaved away as "it's fine because it's root" under Secure Boot. It's not a Xen vuln (Xen *does* audit pointers in guest hypercalls), but it is a guest kernel vuln because of failing to correctly audit hypercall parameters. However, it does require substantial changes in Xen in order to allow guest kernels to do something half-way safe.

---
 docs/admin-guide/index.rst            |   1 +
 docs/admin-guide/uefi-secure-boot.rst | 134 ++++++++++++++++++++++++++
 2 files changed, 135 insertions(+)
 create mode 100644 docs/admin-guide/uefi-secure-boot.rst
docs/admin-guide/index.rst +1 -0
index 54e6f65de347..e7895ee95001 100644
@@ -5,4 +5,5 @@ Admin Guide
 
 .. toctree::
    introduction
+   uefi-secure-boot
    microcode-loading
docs/admin-guide/uefi-secure-boot.rst new file +33 -0
new file mode 100644
index 000000000000..0e0f50143892
@@ -0,0 +1,134 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+UEFI Secure Boot
+================
+
+UEFI Secure Boot is a verification mechanism, intended to ensure that only
+code trusted by the platform can run.  This is to prevent malicious code from
+hijacking the system.  Secure Boot requires that all privileged code be
+signed, and that there is a trust relationship with the platform; i.e. code
+which is not signed by a key enrolled in platform must not run privileged.
+
+Within the Xen architecture, Xen, the :term:`control domain` and
+:term:`hardware domain` share responsibility for running and administering the
+platform.  This makes their kernels privileged as far as Secure Boot is
+concerned.
+
+When Secure Boot is active in the platform, privileged code is required to not
+run any untrusted code (i.e. not run any code for which there is not a good
+signature), and is required not to allow this restriction to be bypassed
+(e.g. by command line request).
+
+
+Support in Xen
+--------------
+
+There are multiple ways to achieve this security goal, with differing
+tradeoffs for the eventual system.
+
+On one end of the spectrum is the Unified Kernel Image.  e.g. Xen is bundled
+with the dom0 kernel and init-ramdisk, with an embedded command line, and with
+livepatching and kexec compiled out, and suitably signed.  The signature is
+checked by the bootloader and, as this covers all the privileged code, Xen
+doesn't need to perform further checks itself.

docs/admin-guide/uefi-secure-boot.rst line 43

Quoted 10 lines
docs/admin-guide/uefi-secure-boot.rst new file +10 -0
+
+On the other end of the spectrum is maintaining the features of existing
+deployments.  e.g. Xen needs signature checking capabilities for the dom0
+kernel, livepatches and kexec kernels, and needs to allow the use of safe
+command line options while disallowing unsafe ones.
+
+It is important to remember that Xen is one piece of the larger platform,
+where every piece depends on the correct functioning of all earlier pieces.  A
+product supporting Secure Boot requires a holistic approach involving all
+components in the system.  It is not sufficient to consider Xen in isolation.

This paragraph is a bit vague. Maybe include (repeat) that it includes any privileged domain's kernel, but also bootloader(s)? Or simply remove it as it doesn't add much give the introduction section explaining this already.

Quoted 39 lines
docs/admin-guide/uefi-secure-boot.rst new file +39 -0
+
+.. TODO: Move "In Progress" tasks here as they become ready
+
+Security Scope
+--------------
+
+Vulnerabilities impacting Secure Boot require a fixed component to be produced
+and distributed, the vulnerable component to be revoked, and the revocation
+distributed to platforms.
+
+The following principles and guidelines indicate where Secure Boot differs
+from more traditional security models, and the situations in which extra
+remediation may be necessary.
+
+Principles
+^^^^^^^^^^
+
+ * Privileged code shall include Xen and the kernel(s) of the control and
+   hardware domain (both, if they're split).  While there is a privilege split
+   here in Xen's regular security model, they are equal from Secure Boot's
+   point of view.
+
+ * Root or ADMIN in userspace is unprivileged from Secure Boot's point of
+   view, and must not be able to alter the enforcement policy or load unsigned
+   code even by e.g. editing a configuration file and rebooting.
+
+Within Scope
+^^^^^^^^^^^^
+
+The following types of issue require remediation and revocation of vulnerable
+binaries.
+
+ * Any failure to apply enforcements even against traditionally-privileged
+   userspace, including failure to authenticate new code to run and failure to
+   handle revocations properly.
+
+ * Any Out-of-Bounds write capable of altering the enforcement policy, or
+   capable of bypassing enforcement, e.g. by corrupting the running code.
+

docs/admin-guide/uefi-secure-boot.rst line 92

Quoted 10 lines
docs/admin-guide/uefi-secure-boot.rst new file +10 -0
+Out of Scope
+^^^^^^^^^^^^
+
+While typically a security issue in their own rights, these issues do not
+constitute a Secure Boot vulnerability, and do not require special
+remediation.
+
+ * Denial of Service vulnerabilities.
+
+ * Out-of-Bounds reads.

Maybe more generic "Information disclosure" or "Information leak"?

Quoted 45 lines
docs/admin-guide/uefi-secure-boot.rst new file +42 -0
+
+The Xen Security Team will endeavour to produce XSAs for all violations of
+this security policy, including identifying them specifically as requiring
+further remediation by downstreams.
+
+
+In Progress
+-----------
+
+.. warning::
+
+   The following work is still in progress.  It is provisional, and not
+   security supported yet.
+
+
+Secure Boot Advanced Targeting
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+SBAT is a recovation scheme for Secure Boot enabled components, using a
+generation based scheme.  See `Shim SBAT.md
+<https://github.com/rhboot/shim/blob/main/SBAT.md>`_ for full details.
+
+Upstream Xen provides the infrastructure to embed SBAT metadata in
+``xen.efi``, but does not maintain a generation number itself.  Downstreams
+are expected to maintain their own generation numbers.
+
+
+Lockdown Mode
+^^^^^^^^^^^^^
+
+A mode which causes the enforcement of the properties necessary to conform to
+the Secure Boot specification.  Lockdown Mode is forced active when Secure
+Boot is active in the platform, but may be activated independently too for
+development purposes with the ``lockdown`` command line option.
+
+TODO
+^^^^
+
+ * Command Line
+ * Livepatching
+ * Kexec
+ * Userspace hypercalls
Signature · 1 line
2.39.5
Signature · 3 lines
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
#3 lore raw
Quoted 9 lines · Marek Marczykowski-Górecki
Quoted 7 lines · Andrew Cooper

Several things are hard to express and want further discussion. Suggestions welcome:

1) Content of CONFIG_CMDLINE and the various CONFIG_*_DEFAULT options. Xen is not going to be issuing XSAs for "downstream chose an unsafe configuration, then signed and deployed the result", yet Xen probably should be on the hook for bad "default ..." settings in Kconfig.

Quoted 6 lines

Should there be some guidelines what values are/aren't safe for UEFI SB? I don't think there can be a simple list, for example some things may depend on other settings and/or whether UKI is involved. But some comment about relation to UEFI SB (in Kconfig help?) would be useful. As for CONFIG_CMDLINE, IIUC the current implementation does cover it too (as in, lockdown mode will filter built-in cmdline too).

For command line options I think the doc ought to include some form of annotation, at least in one direction (permitted or not permitted).

For Kconfig it's less clear to me what an "insecure default" could be.

Jan

#4 lore raw
In reply to Andrew Cooper
Quoted 9 lines · Andrew Cooper

Obviously RFC at this point. It's worth saying that XenServer is intending to use Shim and get a signature from Microsoft, retaining all exiting features such as Livepatching and Kexec crash reporting.

This trails off into more TODOs towards the end. Individual tasks should expand on the start made and resulting conversation from this thread. As a reminder, the target audience for this doc is an administrator running a Xen deployment, but who is not necesserily a developer.

Quoted 7 lines

Several things are hard to express and want further discussion. Suggestions welcome:

1) Content of CONFIG_CMDLINE and the various CONFIG_*_DEFAULT options. Xen is not going to be issuing XSAs for "downstream chose an unsafe configuration, then signed and deployed the result", yet Xen probably should be on the hook for bad "default ..." settings in Kconfig.

Imo it simply needs stating largely like this. As indicated by Marek, some annotations are going to be needed to help people realize what is or is not safe to use. If we wrongly marked a command line option (or Kconfig setting, if applicable there) as safe to use, I think we'd be on the hook to issue an XSN or XSA.

Quoted 5 lines

2) Pre-boot DMA Protection. Microsoft consider this a platform feature requiring OEM enablement, and do not consider its absence to be a Secure Boot vulnerability. But, it is less clear what the policy ought to be for Xen booting on a capable system and failing to do a correct live-handover of the IOMMU across ExitBootServices().

Shouldn't this be another TODO item at the bottom? We don't support yet taking over when the IOMMUs are already enabled, do we?

Quoted 5 lines

3) The AMD microcode signature vulnerability. While it's not Xen's bug per say, it's clearly a Secure Boot bypass because we do offer microcode loading capabilties to userspace, and malicious userspace can load an unauthorised microcode which allows them to read/write physical memory and bypass further signature checks.

While in general I continue to think that people ought to be paying attention to advisories from HW vendors, we can certainly continue to issue at least XSNs in such events.

Quoted 8 lines

4) Userspace Hypercalls. To anyone who isn't already aware, /dev/xen/privcmd in the various Unicies is a giant priv-esc hole, as root userspace can e.g. issue direct memory hypercalls behind the back of an (intentionally) oblivious kernel, and cannot be handwaved away as "it's fine because it's root" under Secure Boot. It's not a Xen vuln (Xen *does* audit pointers in guest hypercalls), but it is a guest kernel vuln because of failing to correctly audit hypercall parameters. However, it does require substantial changes in Xen in order to allow guest kernels to do something half-way safe.

I'm having trouble seeing what's "hard to express" here. Auditing needs to be added in kernels wanting to act as hwdom or ctldom. Flaws there would require advisories (and revocation) by respective parties; for Linux that would still be the Xen Security Team.

IOW imo this wording could just move down to the respective sub-item of the TODO section.

docs/admin-guide/uefi-secure-boot.rst line 64

Quoted 7 lines
docs/admin-guide/uefi-secure-boot.rst new file +7 -0
+Principles
+^^^^^^^^^^
+
+ * Privileged code shall include Xen and the kernel(s) of the control and
+   hardware domain (both, if they're split).  While there is a privilege split
+   here in Xen's regular security model, they are equal from Secure Boot's
+   point of view.

In this context, may I direct your attention to Jason's plans for Xenstore domain? It, in the SILO model, being permitted interaction with the other two special types might end up being a problem here.

See https://lists.xen.org/archives/html/xen-devel/2025-06/msg00703.html.

docs/admin-guide/uefi-secure-boot.rst line 105

Quoted 7 lines
docs/admin-guide/uefi-secure-boot.rst new file +7 -0
+In Progress
+-----------
+
+.. warning::
+
+   The following work is still in progress.  It is provisional, and not
+   security supported yet.

Isn't this an overstatement? None of the below had even parts thereof go in so far.

Quoted 17 lines
docs/admin-guide/uefi-secure-boot.rst new file +17 -0
+Secure Boot Advanced Targeting
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+SBAT is a recovation scheme for Secure Boot enabled components, using a
+generation based scheme.  See `Shim SBAT.md
+<https://github.com/rhboot/shim/blob/main/SBAT.md>`_ for full details.
+
+Upstream Xen provides the infrastructure to embed SBAT metadata in
+``xen.efi``, but does not maintain a generation number itself.  Downstreams
+are expected to maintain their own generation numbers.
+
+
+Lockdown Mode
+^^^^^^^^^^^^^
+
+A mode which causes the enforcement of the properties necessary to conform to
+the Secure Boot specification.  Lockdown Mode is forced active when Secure

docs/admin-guide/uefi-secure-boot.rst line 134

Quoted 10 lines
docs/admin-guide/uefi-secure-boot.rst new file +10 -0
+Boot is active in the platform, but may be activated independently too for
+development purposes with the ``lockdown`` command line option.
+
+TODO
+^^^^
+
+ * Command Line
+ * Livepatching
+ * Kexec
+ * Userspace hypercalls

What about Dom0 being able to access almost(?) all memory, including all MMIO? In this context, isn't iommu=dom0-strict a requirement for SB (while that's still not the default mode of operation for PV Dom0, despite me keeping to suggest that we ought to change that default)?

As a general remark (no good place to put it): In the eventual final patch I expect a reference to this new doc is going to be inserted in the respective section in SUPPORT.md.

Jan

#5 lore raw

Le 12/06/2025 à 12:08, Jan Beulich a écrit :

Quoted 14 lines · Andrew Cooper
Quoted 13 lines
docs/admin-guide/uefi-secure-boot.rst new file +13 -0
+
+Lockdown Mode
+^^^^^^^^^^^^^
+
+A mode which causes the enforcement of the properties necessary to conform to
+the Secure Boot specification.  Lockdown Mode is forced active when Secure
+Boot is active in the platform, but may be activated independently too for
+development purposes with the ``lockdown`` command line option.
+
+TODO
+^^^^
+
+ * Command Line
Quoted 9 lines
Quoted 3 lines

+ * Livepatching
+ * Kexec
+ * Userspace hypercalls

What about Dom0 being able to access almost(?) all memory, including all MMIO? In this context, isn't iommu=dom0-strict a requirement for SB (while that's still not the default mode of operation for PV Dom0, despite me keeping to suggest that we ought to change that default)?

Unless I missed something, the kernel is not a part of the TCB in this Secure Boot model. But at some point, we definitely want to reduce the TCB to just Xen, and put a more limited trust on the control domains.

Yet, the current plan of hardening the privcmd device is going to be very hard for sure.

dom0-iommu=strict is a good mitigations in case untrusted parties of the dom0 get direct access to a devices. However, as it is now, it implies a IOTLB flush for each grant mapping done, which severely impede PV performance (PV-IOMMU patches can help solving this performance problem though).

Teddy

Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

#6 lore raw
Quoted 30 lines · Teddy Astie
Quoted 14 lines · Jan Beulich
Quoted 13 lines · Andrew Cooper
docs/admin-guide/uefi-secure-boot.rst new file +13 -0
+
+Lockdown Mode
+^^^^^^^^^^^^^
+
+A mode which causes the enforcement of the properties necessary to conform to
+the Secure Boot specification.  Lockdown Mode is forced active when Secure
+Boot is active in the platform, but may be activated independently too for
+development purposes with the ``lockdown`` command line option.
+
+TODO
+^^^^
+
+ * Command Line
Quoted 9 lines
Quoted 3 lines

+ * Livepatching
+ * Kexec
+ * Userspace hypercalls

What about Dom0 being able to access almost(?) all memory, including all MMIO? In this context, isn't iommu=dom0-strict a requirement for SB (while that's still not the default mode of operation for PV Dom0, despite me keeping to suggest that we ought to change that default)?

Unless I missed something, the kernel is not a part of the TCB in this Secure Boot model. But at some point, we definitely want to reduce the TCB to just Xen, and put a more limited trust on the control domains.

Quoted 9 lines

Yet, the current plan of hardening the privcmd device is going to be very hard for sure.

dom0-iommu=strict is a good mitigations in case untrusted parties of the dom0 get direct access to a devices. However, as it is now, it implies a IOTLB flush for each grant mapping done, which severely impede PV performance (PV-IOMMU patches can help solving this performance problem though).

The dom0 kernel is part of the TCB since it controls the hardware (along with Xen). This is covered by the paragrah starting "Privileged code shall include Xen and the kernel(s) of the control and hardware domain...".

Dom0 being able to access all memory including MMIO is fine as long as it does not get exposed to userspace. In general, the existing Linux kernel lockdown mode would cover this by blocking /dev/mem, access to resources in sysfs, etc.

Ross

#7 lore raw
In reply to Jan Beulich
Quoted 9 lines · Jan Beulich
Quoted 5 lines · Andrew Cooper

2) Pre-boot DMA Protection. Microsoft consider this a platform feature requiring OEM enablement, and do not consider its absence to be a Secure Boot vulnerability. But, it is less clear what the policy ought to be for Xen booting on a capable system and failing to do a correct live-handover of the IOMMU across ExitBootServices().

Shouldn't this be another TODO item at the bottom? We don't support yet taking over when the IOMMUs are already enabled, do we?

Dasharo supports leaving the IOMMU enabled when transferring to the OS, and this message was sent from a Qubes OS box booted in this configuration.

Signature · 2 lines
Sincerely,
Demi Marie Obenour (she/her/hers)
#8 lore raw
Quoted 8 lines · Demi Marie Obenour
Quoted 7 lines · Jan Beulich
Quoted 5 lines · Andrew Cooper

2) Pre-boot DMA Protection. Microsoft consider this a platform feature requiring OEM enablement, and do not consider its absence to be a Secure Boot vulnerability. But, it is less clear what the policy ought to be for Xen booting on a capable system and failing to do a correct live-handover of the IOMMU across ExitBootServices().

Quoted 5 lines
Quoted 2 lines

Shouldn't this be another TODO item at the bottom? We don't support yet taking over when the IOMMUs are already enabled, do we?

Dasharo supports leaving the IOMMU enabled when transferring to the OS, and this message was sent from a Qubes OS box booted in this configuration.

"Not explode" doesn't mean it "works" or is "supported". For example there is no guarantee that IOMMU don't get disabled in the process opening a window for an attack. (and I do know this issue is the case)

Signature · 3 lines
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
#9 lore raw
In reply to Andrew Cooper
Quoted 41 lines · Andrew Cooper

Written to be solution and deployment neutral in order to focus on the technology itself. This policy is intended to work as well for UKI as for the "classic server setup" approach.

---
CC: Anthony PERARD <[email protected]>
CC: Michal Orzel <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Julien Grall <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: [email protected]
CC: Juergen Gross <[email protected]>
CC: Marek Marczykowski-Górecki <[email protected]>
CC: Trammell Hudson <[email protected]>
CC: Ross Lagerwall <[email protected]>
CC: Frediano Ziglio <[email protected]>
CC: Gerald Elder-Vass <[email protected]>
CC: Kevin Lampis <[email protected]>

A rendered version is available at:
https://andrewcoop-xen.readthedocs.io/en/docs-secureboot/admin-guide/uefi-secure-boot.html

Obviously RFC at this point. It's worth saying that XenServer is intending to use Shim and get a signature from Microsoft, retaining all exiting features such as Livepatching and Kexec crash reporting.

This trails off into more TODOs towards the end. Individual tasks should expand on the start made and resulting conversation from this thread. As a reminder, the target audience for this doc is an administrator running a Xen deployment, but who is not necesserily a developer.

Several things are hard to express and want further discussion. Suggestions welcome:

1) Content of CONFIG_CMDLINE and the various CONFIG_*_DEFAULT options. Xen is not going to be issuing XSAs for "downstream chose an unsafe configuration, then signed and deployed the result", yet Xen probably should be on the hook for bad "default ..." settings in Kconfig.

Quoted 6 lines

2) Pre-boot DMA Protection. Microsoft consider this a platform feature requiring OEM enablement, and do not consider its absence to be a Secure Boot vulnerability. But, it is less clear what the policy ought to be for Xen booting on a capable system and failing to do a correct live-handover of the IOMMU across ExitBootServices().

As I understand it, hardware attacks currently don't count in the Secure Boot security model, and it would only depend on whether userspace code can use the vulnerability to run privileged code right?

Quoted 144 lines

3) The AMD microcode signature vulnerability. While it's not Xen's bug per say, it's clearly a Secure Boot bypass because we do offer microcode loading capabilties to userspace, and malicious userspace can load an unauthorised microcode which allows them to read/write physical memory and bypass further signature checks.

4) Userspace Hypercalls. To anyone who isn't already aware, /dev/xen/privcmd in the various Unicies is a giant priv-esc hole, as root userspace can e.g. issue direct memory hypercalls behind the back of an (intentionally) oblivious kernel, and cannot be handwaved away as "it's fine because it's root" under Secure Boot. It's not a Xen vuln (Xen *does* audit pointers in guest hypercalls), but it is a guest kernel vuln because of failing to correctly audit hypercall parameters. However, it does require substantial changes in Xen in order to allow guest kernels to do something half-way safe.

---
  docs/admin-guide/index.rst            |   1 +
  docs/admin-guide/uefi-secure-boot.rst | 134 ++++++++++++++++++++++++++
  2 files changed, 135 insertions(+)

create mode 100644 docs/admin-guide/uefi-secure-boot.rst

docs/admin-guide/index.rst +1 -0
index 54e6f65de347..e7895ee95001 100644
@@ -5,4 +5,5 @@ Admin Guide
 
  .. toctree::
     introduction
+   uefi-secure-boot
     microcode-loading
docs/admin-guide/uefi-secure-boot.rst new file +108 -0
new file mode 100644
index 000000000000..0e0f50143892
@@ -0,0 +1,134 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+UEFI Secure Boot
+================
+
+UEFI Secure Boot is a verification mechanism, intended to ensure that only
+code trusted by the platform can run.  This is to prevent malicious code from
+hijacking the system.  Secure Boot requires that all privileged code be
+signed, and that there is a trust relationship with the platform; i.e. code
+which is not signed by a key enrolled in platform must not run privileged.
+
+Within the Xen architecture, Xen, the :term:`control domain` and
+:term:`hardware domain` share responsibility for running and administering the
+platform.  This makes their kernels privileged as far as Secure Boot is
+concerned.
+
+When Secure Boot is active in the platform, privileged code is required to not
+run any untrusted code (i.e. not run any code for which there is not a good
+signature), and is required not to allow this restriction to be bypassed
+(e.g. by command line request).
+
+
+Support in Xen
+--------------
+
+There are multiple ways to achieve this security goal, with differing
+tradeoffs for the eventual system.
+
+On one end of the spectrum is the Unified Kernel Image.  e.g. Xen is bundled
+with the dom0 kernel and init-ramdisk, with an embedded command line, and with
+livepatching and kexec compiled out, and suitably signed.  The signature is
+checked by the bootloader and, as this covers all the privileged code, Xen
+doesn't need to perform further checks itself.
+
+On the other end of the spectrum is maintaining the features of existing
+deployments.  e.g. Xen needs signature checking capabilities for the dom0
+kernel, livepatches and kexec kernels, and needs to allow the use of safe
+command line options while disallowing unsafe ones.
+
+It is important to remember that Xen is one piece of the larger platform,
+where every piece depends on the correct functioning of all earlier pieces.  A
+product supporting Secure Boot requires a holistic approach involving all
+components in the system.  It is not sufficient to consider Xen in isolation.
+
+.. TODO: Move "In Progress" tasks here as they become ready
+
+Security Scope
+--------------
+
+Vulnerabilities impacting Secure Boot require a fixed component to be produced
+and distributed, the vulnerable component to be revoked, and the revocation
+distributed to platforms.
+
+The following principles and guidelines indicate where Secure Boot differs
+from more traditional security models, and the situations in which extra
+remediation may be necessary.
+
+Principles
+^^^^^^^^^^
+
+ * Privileged code shall include Xen and the kernel(s) of the control and
+   hardware domain (both, if they're split).  While there is a privilege split
+   here in Xen's regular security model, they are equal from Secure Boot's
+   point of view.
+
+ * Root or ADMIN in userspace is unprivileged from Secure Boot's point of
+   view, and must not be able to alter the enforcement policy or load unsigned
+   code even by e.g. editing a configuration file and rebooting.
+
+Within Scope
+^^^^^^^^^^^^
+
+The following types of issue require remediation and revocation of vulnerable
+binaries.
+
+ * Any failure to apply enforcements even against traditionally-privileged
+   userspace, including failure to authenticate new code to run and failure to
+   handle revocations properly.
+
+ * Any Out-of-Bounds write capable of altering the enforcement policy, or
+   capable of bypassing enforcement, e.g. by corrupting the running code.
+
+Out of Scope
+^^^^^^^^^^^^
+
+While typically a security issue in their own rights, these issues do not
+constitute a Secure Boot vulnerability, and do not require special
+remediation.
+
+ * Denial of Service vulnerabilities.
+
+ * Out-of-Bounds reads.
+
+The Xen Security Team will endeavour to produce XSAs for all violations of
+this security policy, including identifying them specifically as requiring
+further remediation by downstreams.
+
+
+In Progress
+-----------
+
+.. warning::
+
+   The following work is still in progress.  It is provisional, and not
+   security supported yet.
+
+
+Secure Boot Advanced Targeting

docs/admin-guide/uefi-secure-boot.rst line 118

Quoted 10 lines
docs/admin-guide/uefi-secure-boot.rst new file +10 -0
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+SBAT is a recovation scheme for Secure Boot enabled components, using a
+generation based scheme.  See `Shim SBAT.md
+<https://github.com/rhboot/shim/blob/main/SBAT.md>`_ for full details.
+
+Upstream Xen provides the infrastructure to embed SBAT metadata in
+``xen.efi``, but does not maintain a generation number itself.  Downstreams
+are expected to maintain their own generation numbers.
+

Why would Xen not maintain its own SBAT generation? An upstream SBAT incremented for every Secure Boot bypass XSA would make it far easier to block vulnerable variants and help downstreams coordinate fixes.

Quoted 6 lines
docs/admin-guide/uefi-secure-boot.rst new file +6 -0
+
+Lockdown Mode
+^^^^^^^^^^^^^
+
+A mode which causes the enforcement of the properties necessary to conform to
+the Secure Boot specification.  Lockdown Mode is forced active when Secure

docs/admin-guide/uefi-secure-boot.rst line 134

Quoted 10 lines
docs/admin-guide/uefi-secure-boot.rst new file +10 -0
+Boot is active in the platform, but may be activated independently too for
+development purposes with the ``lockdown`` command line option.
+
+TODO
+^^^^
+
+ * Command Line
+ * Livepatching
+ * Kexec
+ * Userspace hypercalls

IMO key management, signing and revocation should be another topic for a TODO element.

Best regards,

Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

#10 lore raw
Quoted 16 lines · Tu Dinh

docs/admin-guide/uefi-secure-boot.rst line 118

Quoted 11 lines · Andrew Cooper
docs/admin-guide/uefi-secure-boot.rst new file +11 -0
+Secure Boot Advanced Targeting
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+SBAT is a recovation scheme for Secure Boot enabled components, using a
+generation based scheme.  See `Shim SBAT.md
+<https://github.com/rhboot/shim/blob/main/SBAT.md>`_ for full details.
+
+Upstream Xen provides the infrastructure to embed SBAT metadata in
+``xen.efi``, but does not maintain a generation number itself.  Downstreams
+are expected to maintain their own generation numbers.
+

Why would Xen not maintain its own SBAT generation? An upstream SBAT incremented for every Secure Boot bypass XSA would make it far easier to block vulnerable variants and help downstreams coordinate fixes.

Quoting from the SBAT patch that was submitted a little while ago:

"The SBAT section provides a way for the binary to declare a generation
id for its upstream source and any vendor changes applied."

That is, the generation ID is per-vendor. Upstream incrementing whatever ID would be meaningless to downstreams then. Hence we can as well not do so in the first place.

Jan

#11 lore raw
Quoted 20 lines · Jan Beulich
Quoted 16 lines · Tu Dinh

docs/admin-guide/uefi-secure-boot.rst line 118

Quoted 11 lines · Andrew Cooper
docs/admin-guide/uefi-secure-boot.rst new file +11 -0
+Secure Boot Advanced Targeting
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+SBAT is a recovation scheme for Secure Boot enabled components, using a
+generation based scheme.  See `Shim SBAT.md
+<https://github.com/rhboot/shim/blob/main/SBAT.md>`_ for full details.
+
+Upstream Xen provides the infrastructure to embed SBAT metadata in
+``xen.efi``, but does not maintain a generation number itself.  Downstreams
+are expected to maintain their own generation numbers.
+

Why would Xen not maintain its own SBAT generation? An upstream SBAT incremented for every Secure Boot bypass XSA would make it far easier to block vulnerable variants and help downstreams coordinate fixes.

Quoting from the SBAT patch that was submitted a little while ago:

Quoted 8 lines

"The SBAT section provides a way for the binary to declare a generation
id for its upstream source and any vendor changes applied."

That is, the generation ID is per-vendor. Upstream incrementing whatever ID would be meaningless to downstreams then. Hence we can as well not do so in the first place.

Jan

Don't Shim, Grub and Linux all have their own upstream SBAT generation? The Shim SBAT documentation explicitly pointed this out:

Quoted 1 line

Each component is assigned a minimum global generation number.

Vendors signing component binary artifacts with a specific global generation number are required to include fixes for any public or pre-disclosed issue required for that generation. Additionally, in the event that a bypass only manifests in a specific product's component, vendors may ask for a product-specific generation number to be published for one of their product's components. This avoids triggering an industry wide re-publishing of otherwise safe components.

IOW Xen should have its own upstream generation ID for any vulnerability that leads to a Secure Boot bypass. Any vendor that patches such a vulnerability can simply increase the upstream generation ID it carries in its SBAT to that of the latest Xen. Then any inferior upstream generation can simply be revoked to cover all vendors at once.

Best regards,

Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

#12 lore raw
In reply to Andrew Cooper
Quoted 53 lines · Andrew Cooper

Written to be solution and deployment neutral in order to focus on the technology itself. This policy is intended to work as well for UKI as for the "classic server setup" approach.

---
CC: Anthony PERARD <[email protected]>
CC: Michal Orzel <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Julien Grall <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: [email protected]
CC: Juergen Gross <[email protected]>
CC: Marek Marczykowski-Górecki <[email protected]>
CC: Trammell Hudson <[email protected]>
CC: Ross Lagerwall <[email protected]>
CC: Frediano Ziglio <[email protected]>
CC: Gerald Elder-Vass <[email protected]>
CC: Kevin Lampis <[email protected]>

A rendered version is available at:
https://andrewcoop-xen.readthedocs.io/en/docs-secureboot/admin-guide/uefi-secure-boot.html

Obviously RFC at this point. It's worth saying that XenServer is intending to use Shim and get a signature from Microsoft, retaining all exiting features such as Livepatching and Kexec crash reporting.

This trails off into more TODOs towards the end. Individual tasks should expand on the start made and resulting conversation from this thread. As a reminder, the target audience for this doc is an administrator running a Xen deployment, but who is not necesserily a developer.

Several things are hard to express and want further discussion. Suggestions welcome:

1) Content of CONFIG_CMDLINE and the various CONFIG_*_DEFAULT options. Xen is not going to be issuing XSAs for "downstream chose an unsafe configuration, then signed and deployed the result", yet Xen probably should be on the hook for bad "default ..." settings in Kconfig.

2) Pre-boot DMA Protection. Microsoft consider this a platform feature requiring OEM enablement, and do not consider its absence to be a Secure Boot vulnerability. But, it is less clear what the policy ought to be for Xen booting on a capable system and failing to do a correct live-handover of the IOMMU across ExitBootServices().

3) The AMD microcode signature vulnerability. While it's not Xen's bug per say, it's clearly a Secure Boot bypass because we do offer microcode loading capabilties to userspace, and malicious userspace can load an unauthorised microcode which allows them to read/write physical memory and bypass further signature checks.

Quoted 8 lines

4) Userspace Hypercalls. To anyone who isn't already aware, /dev/xen/privcmd in the various Unicies is a giant priv-esc hole, as root userspace can e.g. issue direct memory hypercalls behind the back of an (intentionally) oblivious kernel, and cannot be handwaved away as "it's fine because it's root" under Secure Boot. It's not a Xen vuln (Xen *does* audit pointers in guest hypercalls), but it is a guest kernel vuln because of failing to correctly audit hypercall parameters. However, it does require substantial changes in Xen in order to allow guest kernels to do something half-way safe.

One small suggestion for improvement is that Secure Boot is not an x86-specific specification so we should keep the document arch-neutral.

Quoted 50 lines
---
 docs/admin-guide/index.rst            |   1 +
 docs/admin-guide/uefi-secure-boot.rst | 134 ++++++++++++++++++++++++++
 2 files changed, 135 insertions(+)
 create mode 100644 docs/admin-guide/uefi-secure-boot.rst
docs/admin-guide/index.rst +1 -0
index 54e6f65de347..e7895ee95001 100644
@@ -5,4 +5,5 @@ Admin Guide
 
 .. toctree::
    introduction
+   uefi-secure-boot
    microcode-loading
docs/admin-guide/uefi-secure-boot.rst new file +28 -0
new file mode 100644
index 000000000000..0e0f50143892
@@ -0,0 +1,134 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+UEFI Secure Boot
+================
+
+UEFI Secure Boot is a verification mechanism, intended to ensure that only
+code trusted by the platform can run.  This is to prevent malicious code from
+hijacking the system.  Secure Boot requires that all privileged code be
+signed, and that there is a trust relationship with the platform; i.e. code
+which is not signed by a key enrolled in platform must not run privileged.
+
+Within the Xen architecture, Xen, the :term:`control domain` and
+:term:`hardware domain` share responsibility for running and administering the
+platform.  This makes their kernels privileged as far as Secure Boot is
+concerned.
+
+When Secure Boot is active in the platform, privileged code is required to not
+run any untrusted code (i.e. not run any code for which there is not a good
+signature), and is required not to allow this restriction to be bypassed
+(e.g. by command line request).
+
+
+Support in Xen
+--------------
+
+There are multiple ways to achieve this security goal, with differing
+tradeoffs for the eventual system.
+

docs/admin-guide/uefi-secure-boot.rst line 38

Quoted 10 lines
docs/admin-guide/uefi-secure-boot.rst new file +10 -0
+On one end of the spectrum is the Unified Kernel Image.  e.g. Xen is bundled
+with the dom0 kernel and init-ramdisk, with an embedded command line, and with
+livepatching and kexec compiled out, and suitably signed.  The signature is
+checked by the bootloader and, as this covers all the privileged code, Xen
+doesn't need to perform further checks itself.
+
+On the other end of the spectrum is maintaining the features of existing
+deployments.  e.g. Xen needs signature checking capabilities for the dom0
+kernel, livepatches and kexec kernels, and needs to allow the use of safe
+command line options while disallowing unsafe ones.

I just wanted to mention that there is one more option which I used in the past: the firmware/bootloader loads Xen, the Dom0 kernel, and other binaries, check their signatures, then boot Xen.

This is similar to the "Unified Kernel Image" approach in the sense that Xen doesn't need to do any signature checking for the dom0 kernel, but it doesn't require all the binaries to be glued together.

Assuming that the firmware/bootloader is capable of loading multiple binaries and checking the signature of multiple binaries before booting the next element, it works fine.

Quoted 98 lines
docs/admin-guide/uefi-secure-boot.rst new file +95 -0
+It is important to remember that Xen is one piece of the larger platform,
+where every piece depends on the correct functioning of all earlier pieces.  A
+product supporting Secure Boot requires a holistic approach involving all
+components in the system.  It is not sufficient to consider Xen in isolation.
+
+.. TODO: Move "In Progress" tasks here as they become ready
+
+Security Scope
+--------------
+
+Vulnerabilities impacting Secure Boot require a fixed component to be produced
+and distributed, the vulnerable component to be revoked, and the revocation
+distributed to platforms.
+
+The following principles and guidelines indicate where Secure Boot differs
+from more traditional security models, and the situations in which extra
+remediation may be necessary.
+
+Principles
+^^^^^^^^^^
+
+ * Privileged code shall include Xen and the kernel(s) of the control and
+   hardware domain (both, if they're split).  While there is a privilege split
+   here in Xen's regular security model, they are equal from Secure Boot's
+   point of view.
+
+ * Root or ADMIN in userspace is unprivileged from Secure Boot's point of
+   view, and must not be able to alter the enforcement policy or load unsigned
+   code even by e.g. editing a configuration file and rebooting.
+
+Within Scope
+^^^^^^^^^^^^
+
+The following types of issue require remediation and revocation of vulnerable
+binaries.
+
+ * Any failure to apply enforcements even against traditionally-privileged
+   userspace, including failure to authenticate new code to run and failure to
+   handle revocations properly.
+
+ * Any Out-of-Bounds write capable of altering the enforcement policy, or
+   capable of bypassing enforcement, e.g. by corrupting the running code.
+
+Out of Scope
+^^^^^^^^^^^^
+
+While typically a security issue in their own rights, these issues do not
+constitute a Secure Boot vulnerability, and do not require special
+remediation.
+
+ * Denial of Service vulnerabilities.
+
+ * Out-of-Bounds reads.
+
+The Xen Security Team will endeavour to produce XSAs for all violations of
+this security policy, including identifying them specifically as requiring
+further remediation by downstreams.
+
+
+In Progress
+-----------
+
+.. warning::
+
+   The following work is still in progress.  It is provisional, and not
+   security supported yet.
+
+
+Secure Boot Advanced Targeting
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+SBAT is a recovation scheme for Secure Boot enabled components, using a
+generation based scheme.  See `Shim SBAT.md
+<https://github.com/rhboot/shim/blob/main/SBAT.md>`_ for full details.
+
+Upstream Xen provides the infrastructure to embed SBAT metadata in
+``xen.efi``, but does not maintain a generation number itself.  Downstreams
+are expected to maintain their own generation numbers.
+
+
+Lockdown Mode
+^^^^^^^^^^^^^
+
+A mode which causes the enforcement of the properties necessary to conform to
+the Secure Boot specification.  Lockdown Mode is forced active when Secure
+Boot is active in the platform, but may be activated independently too for
+development purposes with the ``lockdown`` command line option.
+
+TODO
+^^^^
+
+ * Command Line
+ * Livepatching
+ * Kexec
+ * Userspace hypercalls
Signature · 1 line
2.39.5
#13 lore raw
Quoted 22 lines · Stefano Stabellini
Quoted 6 lines · Andrew Cooper
docs/admin-guide/uefi-secure-boot.rst new file +6 -0
+Support in Xen
+--------------
+
+There are multiple ways to achieve this security goal, with differing
+tradeoffs for the eventual system.
+

docs/admin-guide/uefi-secure-boot.rst line 38

Quoted 10 lines
docs/admin-guide/uefi-secure-boot.rst new file +10 -0
+On one end of the spectrum is the Unified Kernel Image.  e.g. Xen is bundled
+with the dom0 kernel and init-ramdisk, with an embedded command line, and with
+livepatching and kexec compiled out, and suitably signed.  The signature is
+checked by the bootloader and, as this covers all the privileged code, Xen
+doesn't need to perform further checks itself.
+
+On the other end of the spectrum is maintaining the features of existing
+deployments.  e.g. Xen needs signature checking capabilities for the dom0
+kernel, livepatches and kexec kernels, and needs to allow the use of safe
+command line options while disallowing unsafe ones.

I just wanted to mention that there is one more option which I used in the past: the firmware/bootloader loads Xen, the Dom0 kernel, and other binaries, check their signatures, then boot Xen.

Quoted 7 lines

This is similar to the "Unified Kernel Image" approach in the sense that Xen doesn't need to do any signature checking for the dom0 kernel, but it doesn't require all the binaries to be glued together.

Assuming that the firmware/bootloader is capable of loading multiple binaries and checking the signature of multiple binaries before booting the next element, it works fine.

How would an initrd, a ucode blob, or an XSM policy blob be signed?

Jan

#14 lore raw
Quoted 27 lines · Jan Beulich
Quoted 26 lines · Stefano Stabellini
Quoted 6 lines · Andrew Cooper
docs/admin-guide/uefi-secure-boot.rst new file +6 -0
+Support in Xen
+--------------
+
+There are multiple ways to achieve this security goal, with differing
+tradeoffs for the eventual system.
+

docs/admin-guide/uefi-secure-boot.rst line 38

Quoted 10 lines
docs/admin-guide/uefi-secure-boot.rst new file +10 -0
+On one end of the spectrum is the Unified Kernel Image.  e.g. Xen is bundled
+with the dom0 kernel and init-ramdisk, with an embedded command line, and with
+livepatching and kexec compiled out, and suitably signed.  The signature is
+checked by the bootloader and, as this covers all the privileged code, Xen
+doesn't need to perform further checks itself.
+
+On the other end of the spectrum is maintaining the features of existing
+deployments.  e.g. Xen needs signature checking capabilities for the dom0
+kernel, livepatches and kexec kernels, and needs to allow the use of safe
+command line options while disallowing unsafe ones.

I just wanted to mention that there is one more option which I used in the past: the firmware/bootloader loads Xen, the Dom0 kernel, and other binaries, check their signatures, then boot Xen.

This is similar to the "Unified Kernel Image" approach in the sense that Xen doesn't need to do any signature checking for the dom0 kernel, but it doesn't require all the binaries to be glued together.

Quoted 5 lines
Quoted 3 lines

Assuming that the firmware/bootloader is capable of loading multiple binaries and checking the signature of multiple binaries before booting the next element, it works fine.

How would an initrd, a ucode blob, or an XSM policy blob be signed?

At least grub supports gpg detached signatures, and can be configured to require them.

Signature · 3 lines
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
#15 lore raw
Quoted 28 lines · Marek Marczykowski-Górecki
Quoted 27 lines · Jan Beulich
Quoted 26 lines · Stefano Stabellini
Quoted 6 lines · Andrew Cooper
docs/admin-guide/uefi-secure-boot.rst new file +6 -0
+Support in Xen
+--------------
+
+There are multiple ways to achieve this security goal, with differing
+tradeoffs for the eventual system.
+

docs/admin-guide/uefi-secure-boot.rst line 38

Quoted 10 lines
docs/admin-guide/uefi-secure-boot.rst new file +10 -0
+On one end of the spectrum is the Unified Kernel Image.  e.g. Xen is bundled
+with the dom0 kernel and init-ramdisk, with an embedded command line, and with
+livepatching and kexec compiled out, and suitably signed.  The signature is
+checked by the bootloader and, as this covers all the privileged code, Xen
+doesn't need to perform further checks itself.
+
+On the other end of the spectrum is maintaining the features of existing
+deployments.  e.g. Xen needs signature checking capabilities for the dom0
+kernel, livepatches and kexec kernels, and needs to allow the use of safe
+command line options while disallowing unsafe ones.

I just wanted to mention that there is one more option which I used in the past: the firmware/bootloader loads Xen, the Dom0 kernel, and other binaries, check their signatures, then boot Xen.

This is similar to the "Unified Kernel Image" approach in the sense that Xen doesn't need to do any signature checking for the dom0 kernel, but it doesn't require all the binaries to be glued together.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Assuming that the firmware/bootloader is capable of loading multiple binaries and checking the signature of multiple binaries before booting the next element, it works fine.

How would an initrd, a ucode blob, or an XSM policy blob be signed?

At least grub supports gpg detached signatures, and can be configured to require them.

That's right. U-boot supports something similar as well.

#16 lore raw
In reply to Andrew Cooper

On Thu, Jun 12, 2025 at 12:58 AM Andrew Cooper
<[email protected]> wrote:
...

Quoted 23 lines
docs/admin-guide/uefi-secure-boot.rst new file +23 -0
+In Progress
+-----------
+
+.. warning::
+
+   The following work is still in progress.  It is provisional, and not
+   security supported yet.
+
+
+Secure Boot Advanced Targeting
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+SBAT is a recovation scheme for Secure Boot enabled components, using a
+generation based scheme.  See `Shim SBAT.md
+<https://github.com/rhboot/shim/blob/main/SBAT.md>`_ for full details.
+
+Upstream Xen provides the infrastructure to embed SBAT metadata in
+``xen.efi``, but does not maintain a generation number itself.  Downstreams
+are expected to maintain their own generation numbers.
+
+
+Lockdown Mode
+^^^^^^^^^^^^^

docs/admin-guide/uefi-secure-boot.rst line 131

Quoted 10 lines
docs/admin-guide/uefi-secure-boot.rst new file +10 -0
+
+A mode which causes the enforcement of the properties necessary to conform to
+the Secure Boot specification.  Lockdown Mode is forced active when Secure
+Boot is active in the platform, but may be activated independently too for
+development purposes with the ``lockdown`` command line option.
+
+TODO
+^^^^
+
+ * Command Line

These two are also in progress since they have had patch series posted:

Quoted 2 lines

+ * Livepatching
+ * Kexec

I think a section on PCI passthrough is also warranted. i.e. preventing misuse of a device to exploit Secure Boot.

Ross

#17 lore raw
Quoted 2 lines · Ross Lagerwall

I think a section on PCI passthrough is also warranted. i.e. preventing misuse of a device to exploit Secure Boot.

While I agree it makes sense, I wonder if it's in scope for UEFI Secure Boot as defined by Microsoft? It may have implication for example on PCI passthrough to a PV domains.

Signature · 3 lines
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
#18 lore raw
Quoted 7 lines · Marek Marczykowski-Górecki
Quoted 2 lines · Ross Lagerwall

I think a section on PCI passthrough is also warranted. i.e. preventing misuse of a device to exploit Secure Boot.

While I agree it makes sense, I wonder if it's in scope for UEFI Secure Boot as defined by Microsoft? It may have implication for example on PCI passthrough to a PV domains.

If we bring DomUs into the discussion, then I think we need to make a distinction between predefined DomUs, which could have signatures verified by Secure Boot (such as Dom0 and hyperlaunch/dom0less guests), and other dynamically created DomUs which could be fetched from the network and potentially started without signature verification or prior knowledge.

#19 lore raw
Quoted 9 lines · Stefano Stabellini
Quoted 7 lines · Marek Marczykowski-Górecki
Quoted 2 lines · Ross Lagerwall

I think a section on PCI passthrough is also warranted. i.e. preventing misuse of a device to exploit Secure Boot.

While I agree it makes sense, I wonder if it's in scope for UEFI Secure Boot as defined by Microsoft? It may have implication for example on PCI passthrough to a PV domains.

Quoted 6 lines

If we bring DomUs into the discussion, then I think we need to make a distinction between predefined DomUs, which could have signatures verified by Secure Boot (such as Dom0 and hyperlaunch/dom0less guests), and other dynamically created DomUs which could be fetched from the network and potentially started without signature verification or prior knowledge.

I think it's mostly not about what's running inside domU, but what such domU has access to. The obvious part is enforcing IOMMU configuration so that domU cannot use a PCI device as a proxy to modify hypervisor (or dom0) code. But there may be more subtleties like access to specific devices (HECI? SPI?).
Anyway, lets figure out first _if_ we need to do something about this topic, and only then worry how.

Signature · 3 lines
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
#20 lore raw
Quoted 18 lines · Marek Marczykowski-Górecki
Quoted 9 lines · Stefano Stabellini
Quoted 7 lines · Marek Marczykowski-Górecki
Quoted 2 lines · Ross Lagerwall

I think a section on PCI passthrough is also warranted. i.e. preventing misuse of a device to exploit Secure Boot.

While I agree it makes sense, I wonder if it's in scope for UEFI Secure Boot as defined by Microsoft? It may have implication for example on PCI passthrough to a PV domains.

Quoted 6 lines

If we bring DomUs into the discussion, then I think we need to make a distinction between predefined DomUs, which could have signatures verified by Secure Boot (such as Dom0 and hyperlaunch/dom0less guests), and other dynamically created DomUs which could be fetched from the network and potentially started without signature verification or prior knowledge.

Quoted 8 lines

I think it's mostly not about what's running inside domU, but what such domU has access to. The obvious part is enforcing IOMMU configuration so that domU cannot use a PCI device as a proxy to modify hypervisor (or dom0) code. But there may be more subtleties like access to specific devices (HECI? SPI?).
Anyway, lets figure out first _if_ we need to do something about this topic, and only then worry how.

As far as I know, Microsoft haven't specified requirements to this level of detail. However, if userspace can break the Secure Boot principles laid out above using a (spec compliant) PCI device to write memory, then I don't see why it would be any different to a Secure Boot compromise using the CPU to write memory. Linux prevents direct access to PCI devices when lockdown mode is enabled, presumably to prevent these kinds of attacks.

Ross