From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>
Subject: [PATCH 00/14] Encode object type security status in code
Date: Wed, 9 Sep 2026 18:56:42 +0100 [thread overview]
Message-ID: <20260909175656.1572689-1-berrange@redhat.com> (raw)
Our docs/system/security.rst file loosely classifies code into that
applicable for 'virtualization' vs 'non-virtualization' use cases.
Only code relevant to the former group is eligible for security
bug handling. It is difficult for any contributors to know what
devices are in scope for 'virtualization' when reporting bugs,
and even maintainers can have a hard time agreeing.
It is well overdue to declare this information the code and present
it to end users at runtime. This series starts the effort by defining
the internal infrastructure, command line args and QMP extensions to
handle the security status recording and reporting.
A previous posting included classifications for many devices. That
is dropped this v3 series so we can focus on getting the core infra
included. Device classifications will follow afterwards in a separate
series.
The base concept is that the QOM TypeInfo struct gains a new field
"bool secure". This enables querying any ObjectClass to ask whether
or not it is declared secure.
By only using a single boolean flag, at runtime we are unable to
distinguish between "marked insecure" and "no decision, implicitly
insecure". As such, all our existing code is initially considered
insecure, once this series is applied. Code we want to provide a
security boundary for will explicitly opt-in with '.secure = true'.
Previously it was intended to add '.secure = false' to each file
too as it gets evaluated, however, this is now considered to be
overkill. It is easy enough to build a list of everything that
should be treated as secure by perusing "-device help" output.
Classification for non-user creatable types can be left to a 2nd
phase of work.
In terms of user interface, the "-compat" argument gains a new
parameter
* insecure-types=accept|reject|warn
The default 'accept' preserves historical behaviour of
anything being permissible. The other two options both
identify use of types that are not explicitly marked
as secure.
The code annotations are useful immediately, but the -compat
-compat switch is unusable unless a minimum viable set of
secure devices are defined in a follow series. Some conceptual
examples though...
Example: TCG is explicitly insecure, KVM is explicitly secure:
$ qemu-system-x86_64 -display none -compat insecure-types=reject -accel tcg
qemu-system-x86_64: -accel tcg: Type 'tcg-accel' does not provide a security boundary to protect against untrusted workloads
$ qemu-system-x86_64 -display none -compat insecure-types=reject -accel kvm
^C
Example: isapc machine type is explicitly insecure
$ qemu-system-x86_64 -display none -compat insecure-types=reject -machine isapc
qemu-system-x86_64: Type 'isapc-machine' does not provide a security boundary to protect against untrusted workloads
Example: checks also apply in HMP, ne2k_pci is insecure
$ ./build/qemu-system-x86_64 -display none -compat insecure-types=reject -monitor stdio -accel kvm
QEMU 10.1.50 monitor - type 'help' for more information
(qemu) device_add ne2k_pci
Error: Type 'ne2k_pci' does not provide a security boundary to protect against untrusted workloads
Example: checks also apply in QMP:
$ ./scripts/qmp/qmp-shell-wrap qemu-system-x86_64 -display none -compat insecure-types=reject -accel kvm
Welcome to the QMP low-level shell!
Connected
(QEMU) device_add driver=ne2k_oci
{"error": {"class": "GenericError", "desc": "Type 'ne2k_pci' does not provide a security boundary to protect against untrusted workloads"}}
(QEMU) device_add driver=virtio-net
{"return": {}}
This series is available at
https://gitlab.com/berrange/qemu/-/commits/docs-security-status
The WIP patches that add tagging of devices (which I will post separately
in future) are at
https://gitlab.com/berrange/qemu/-/commits/docs-security-devices
Changes in v3:
* Dropped all device classification, to be re-posted as
a separate series
* Reworded the docs based on previous feedback
* Improved commit messages
* Reformatted QAPI docs per feedback
* Split commit adding QMP device list filtering
into two
* Make CompatPolicy parameters 'const'
* Add helper APIs in QOM for querying security
status to reduce duplicate code pattern
* Fix placement of security check for accelerator
types
Changes in v2:
* Report security status in qom-list-types
* Allow qom-list-types to filter on secure types
* Remove 'bool insecure' on TypeInfo, assume that no specified
data is equivalent to '.secure = false'
* Annotate a massive number of object types
Daniel P. Berrangé (14):
qom: add tracking of security state of object types
qapi: add 'insecure-types' option for -compat argument
qom: add helper APIs for checking object security policy compliance
system: check security for accelerator types
system: report acclerator security status in help output
system: check security for machine types
system: report machine security status in help output
system: check security of device types
system: report device security status in help output
hw/core: report security status in query-machines
qom: refactor data passing for QOM list filtering
qom: report & filter on security status in qom-list-types
docs: expand security docs with info about security status
machine: add helpers for declaring secure/insecure machine types
docs/system/security.rst | 36 +++++++++++++++++++++++++++++++++
hw/arm/bananapi_m2u.c | 2 +-
hw/arm/cubieboard.c | 2 +-
hw/arm/imx8mm-evk.c | 2 +-
hw/arm/integratorcp.c | 2 +-
hw/arm/mcimx7d-sabre.c | 2 +-
hw/arm/orangepi.c | 2 +-
hw/core/machine-qmp-cmds.c | 1 +
hw/ppc/pegasos.c | 3 ++-
include/hw/core/boards.h | 25 ++++++++++++++++++-----
include/hw/i386/pc.h | 11 +++++++++-
include/qapi/compat-policy.h | 5 +++++
include/qom/object.h | 39 ++++++++++++++++++++++++++++++++++++
qapi/compat.json | 23 ++++++++++++++++++++-
qapi/machine.json | 8 +++++++-
qapi/qapi-util.c | 30 +++++++++++++++++++++++++++
qapi/qom.json | 13 ++++++++++--
qom/object.c | 22 ++++++++++++++++++++
qom/qom-qmp-cmds.c | 30 +++++++++++++++++++++------
system/qdev-monitor.c | 7 +++++++
system/vl.c | 30 ++++++++++++++++++++++-----
21 files changed, 267 insertions(+), 28 deletions(-)
--
2.55.0
next reply other threads:[~2026-09-09 17:57 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 17:56 Daniel P. Berrangé [this message]
2026-09-09 17:56 ` [PATCH 01/14] qom: add tracking of security state of object types Daniel P. Berrangé
2026-09-09 20:19 ` marcandre.lureau
2026-09-09 17:56 ` [PATCH 02/14] qapi: add 'insecure-types' option for -compat argument Daniel P. Berrangé
2026-09-09 20:19 ` marcandre.lureau
2026-09-09 17:56 ` [PATCH 03/14] qom: add helper APIs for checking object security policy compliance Daniel P. Berrangé
2026-09-09 20:19 ` marcandre.lureau
2026-09-09 17:56 ` [PATCH 04/14] system: check security for accelerator types Daniel P. Berrangé
2026-09-09 20:19 ` marcandre.lureau
2026-09-09 17:56 ` [PATCH 05/14] system: report acclerator security status in help output Daniel P. Berrangé
2026-09-09 20:19 ` marcandre.lureau
2026-09-09 17:56 ` [PATCH 06/14] system: check security for machine types Daniel P. Berrangé
2026-09-09 20:19 ` marcandre.lureau
2026-09-09 17:56 ` [PATCH 07/14] system: report machine security status in help output Daniel P. Berrangé
2026-09-09 20:19 ` marcandre.lureau
2026-09-09 17:56 ` [PATCH 08/14] system: check security of device types Daniel P. Berrangé
2026-09-09 20:19 ` marcandre.lureau
2026-09-09 17:56 ` [PATCH 09/14] system: report device security status in help output Daniel P. Berrangé
2026-09-09 20:19 ` marcandre.lureau
2026-09-09 17:56 ` [PATCH 10/14] hw/core: report security status in query-machines Daniel P. Berrangé
2026-09-09 20:19 ` marcandre.lureau
2026-09-09 17:56 ` [PATCH 11/14] qom: refactor data passing for QOM list filtering Daniel P. Berrangé
2026-09-09 20:19 ` marcandre.lureau
2026-09-09 17:56 ` [PATCH 12/14] qom: report & filter on security status in qom-list-types Daniel P. Berrangé
2026-09-09 20:19 ` marcandre.lureau
2026-09-09 17:56 ` [PATCH 13/14] docs: expand security docs with info about security status Daniel P. Berrangé
2026-09-09 20:19 ` marcandre.lureau
2026-09-09 17:56 ` [PATCH 14/14] machine: add helpers for declaring secure/insecure machine types Daniel P. Berrangé
2026-09-09 20:19 ` marcandre.lureau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260909175656.1572689-1-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=armbru@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@oss.qualcomm.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.