Skip to content

RFC security: Introduce qemu_security_policy_taint() API

Philippe Mathieu-Daudé qemu-devel xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest10 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10sysemu: Introduce qemu_security_policy_taint() APIinclude/qemu-common.h qapi/run-state.json qemu-options.hx +1 more+119 -02 replies
2/10accel: Use qemu_security_policy_taint(), mark KVM and Xen as safeaccel/kvm/kvm-all.c accel/xen/xen-all.c include/qemu/accel.h +1 more+10 -03 replies
3/10block: Use qemu_security_policy_taint() APIblock.c include/block/block_int.h+11 -14 replies
4/10block/vvfat: Mark the driver as unsafeblock/vvfat.c+6 -00 replies
5/10block/null: Mark 'read-zeroes=off' option as unsafeblock/null.c+8 -00 replies
6/10qdev: Use qemu_security_policy_taint() APIhw/core/qdev.c include/hw/qdev-core.h+17 -01 reply
7/10hw/display: Mark ATI and Artist devices as unsafehw/display/artist.c hw/display/ati.c+2 -00 replies
8/10hw/misc: Mark testdev devices as unsafehw/hyperv/hyperv_testdev.c hw/misc/pc-testdev.c hw/misc/pci-testdev.c+3 -00 replies
9/10hw/net: Mark Tulip device as unsafehw/net/tulip.c+1 -00 replies
10/10hw/sd: Mark sdhci-pci device as unsafehw/sd/sdhci-pci.c+1 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 00/10] security: Introduce qemu_security_policy_taint() API

Hi,

This series is experimental! The goal is to better limit the boundary of what code is considerated security critical, and what is less critical (but still important!).

This approach was quickly discussed few months ago with Markus then Daniel. Instead of classifying the code on a file path basis (see [1]), we insert (runtime) hints into the code (which survive code movement). Offending unsafe code can taint the global security policy. By default this policy is 'none': the current behavior. It can be changed on the command line to 'warn' to display warnings, and to 'strict' to prohibit QEMU running with a tainted policy.

As examples I started implementing unsafe code taint from 3 different pieces of code:
- accelerators (KVM and Xen in allow-list)
- block drivers (vvfat and parcial null-co in deny-list)
- qdev (hobbyist devices regularly hit by fuzzer)

I don't want the security researchers to not fuzz QEMU unsafe areas, but I'd like to make it clearer what the community priority is (currently 47 opened issues on [3]).

Regards,

Phil.

[1] https://lore.kernel.org/qemu-devel/[email protected]/
[2] https://www.qemu.org/contribute/security-process/
[3] https://gitlab.com/qemu-project/qemu/-/issues?label_name[]=Fuzzer

Philippe Mathieu-Daudé (10):
sysemu: Introduce qemu_security_policy_taint() API
accel: Use qemu_security_policy_taint(), mark KVM and Xen as safe
block: Use qemu_security_policy_taint() API block/vvfat: Mark the driver as unsafe
block/null: Mark 'read-zeroes=off' option as unsafe
qdev: Use qemu_security_policy_taint() API
hw/display: Mark ATI and Artist devices as unsafe hw/misc: Mark testdev devices as unsafe
hw/net: Mark Tulip device as unsafe
hw/sd: Mark sdhci-pci device as unsafe

 qapi/run-state.json        | 16 +++++++++
 include/block/block_int.h  |  6 +++-
 include/hw/qdev-core.h     |  6 ++++
 include/qemu-common.h      | 19 +++++++++++
 include/qemu/accel.h       |  5 +++
 accel/kvm/kvm-all.c        |  1 +
 accel/xen/xen-all.c        |  1 +
 block.c                    |  6 ++++
 block/null.c               |  8 +++++
 block/vvfat.c              |  6 ++++
 hw/core/qdev.c             | 11 ++++++
 hw/display/artist.c        |  1 +
 hw/display/ati.c           |  1 +
 hw/hyperv/hyperv_testdev.c |  1 +
 hw/misc/pc-testdev.c       |  1 +
 hw/misc/pci-testdev.c      |  1 +
 hw/net/tulip.c             |  1 +
 hw/sd/sdhci-pci.c          |  1 +
 softmmu/vl.c               | 70 ++++++++++++++++++++++++++++++++++++++
 qemu-options.hx            | 17 +++++++++
 20 files changed, 178 insertions(+), 1 deletion(-)
Signature · 1 line
2.31.1