Kernel KVM virtualization development
 help / color / mirror / Atom feed
* [PATCH 0/1] kvm: reject unknown flags in device and dirty-log ioctls
@ 2026-07-01 19:49 Iván Ezequiel Rodriguez
  2026-07-01 19:49 ` [PATCH 1/1] " Iván Ezequiel Rodriguez
  0 siblings, 1 reply; 3+ messages in thread
From: Iván Ezequiel Rodriguez @ 2026-07-01 19:49 UTC (permalink / raw)
  To: pbonzini, seanjc; +Cc: kvm, linux-kselftest, Iván Ezequiel Rodriguez

Three generic KVM paths silently ignored flag bits that uapi or
Documentation/virt/kvm/api.rst treat as reserved or zero-only:

- KVM_CREATE_DEVICE (only KVM_CREATE_DEVICE_TEST is defined)
- KVM_{SET,GET,HAS}_DEVICE_ATTR (kvm_device_attr.flags)
- KVM_ENABLE_CAP for KVM_CAP_DIRTY_LOG_RING{,_ACQ_REL} (cap->flags)

Reject with -EINVAL, matching dma-heap and other strict KVM ioctls.
Adds ioctl_flag_validation_test to tools/testing/selftests/kvm.

Tested: ioctl_flag_validation_test fails on the host kernel without
this patch (KVM_CREATE_DEVICE accepts flags=0x2); requires reloading
the patched kvm module to pass.

Iván Ezequiel Rodriguez (1):
  kvm: reject unknown flags in device and dirty-log ioctls

 tools/testing/selftests/kvm/Makefile.kvm           |   1 +
 .../selftests/kvm/ioctl_flag_validation_test.c     | 104 +++++++++++++++++++++
 virt/kvm/kvm_main.c                                |   9 ++
 3 files changed, 114 insertions(+)

-- 
2.43.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-01 20:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01 19:49 [PATCH 0/1] kvm: reject unknown flags in device and dirty-log ioctls Iván Ezequiel Rodriguez
2026-07-01 19:49 ` [PATCH 1/1] " Iván Ezequiel Rodriguez
2026-07-01 20:09   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox