summaryrefslogtreecommitdiffstats
path: root/arch/arm64
diff options
context:
space:
mode:
authorGavin Shan <gshan@redhat.com>2022-10-31 01:36:15 +0100
committerMarc Zyngier <maz@kernel.org>2022-10-31 18:22:15 +0100
commit7a2726ec3290c52f52ce8d5f5af73ab8c7681bc1 (patch)
treed95b5cf059814da3a0b2126afb09760505c9ed13 /arch/arm64
parentKVM: arm64: Fix bad dereference on MTE-enabled systems (diff)
downloadlinux-7a2726ec3290c52f52ce8d5f5af73ab8c7681bc1.tar.xz
linux-7a2726ec3290c52f52ce8d5f5af73ab8c7681bc1.zip
KVM: Check KVM_CAP_DIRTY_LOG_{RING, RING_ACQ_REL} prior to enabling them
There are two capabilities related to ring-based dirty page tracking: KVM_CAP_DIRTY_LOG_RING and KVM_CAP_DIRTY_LOG_RING_ACQ_REL. Both are supported by x86. However, arm64 supports KVM_CAP_DIRTY_LOG_RING_ACQ_REL only when the feature is supported on arm64. The userspace doesn't have to enable the advertised capability, meaning KVM_CAP_DIRTY_LOG_RING can be enabled on arm64 by userspace and it's wrong. Fix it by double checking if the capability has been advertised prior to enabling it. It's rejected to enable the capability if it hasn't been advertised. Fixes: 17601bfed909 ("KVM: Add KVM_CAP_DIRTY_LOG_RING_ACQ_REL capability and config option") Reported-by: Sean Christopherson <seanjc@google.com> Suggested-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Gavin Shan <gshan@redhat.com> Reviewed-by: Oliver Upton <oliver.upton@linux.dev> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20221031003621.164306-4-gshan@redhat.com
Diffstat (limited to 'arch/arm64')
0 files changed, 0 insertions, 0 deletions