Skip to content

Commit 12405b0

Browse files
committed
KVM: arm64: Prevent NV feature flag on systems w/o nested virt
It would appear that userspace can select the NV feature flag regardless of whether the system actually supports the feature. Obviously a nested guest isn't getting far in this situation; let's reject the flag instead. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent baa28a5 commit 12405b0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/arm64/kvm/arm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,6 +1208,9 @@ static unsigned long system_supported_vcpu_features(void)
12081208
clear_bit(KVM_ARM_VCPU_PTRAUTH_GENERIC, &features);
12091209
}
12101210

1211+
if (!cpus_have_final_cap(ARM64_HAS_NESTED_VIRT))
1212+
clear_bit(KVM_ARM_VCPU_HAS_EL2, &features);
1213+
12111214
return features;
12121215
}
12131216

0 commit comments

Comments
 (0)