Skip to contentSkip to conversation

KVM: s390: Fix for 6.9

GIT PULL Christian Borntraeger 2 participants 3 messages May 7, 2024

Subsystems (3)
lore
Share & tools
lore

Christian Borntraeger

author maintainer
#0 lore raw

Paolo,

one fix for s390.

The following changes since commit 16c20208b9c2fff73015ad4e609072feafbf81ad:

Merge tag 'kvmarm-fixes-6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD (2024-04-30 13:50:55 -0400)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git tags/kvm-s390-master-6.9-1

for you to fetch changes up to 175f2f5bcdfce9e728f1ff956a50f28824d28791:

KVM: s390: Check kvm pointer when testing KVM_CAP_S390_HPAGE_1M (2024-05-02 09:41:38 +0200)

----------------------------------------------------------------
KVM: s390: Fix for 6.9

Fix wild read on capability check.

----------------------------------------------------------------
Jean-Philippe Brucker (1):
KVM: s390: Check kvm pointer when testing KVM_CAP_S390_HPAGE_1M

 arch/s390/kvm/kvm-s390.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
author maintainer
#1 lore raw

[GIT PULL 1/1] KVM: s390: Check kvm pointer when testing KVM_CAP_S390_HPAGE_1M

From: Jean-Philippe Brucker <[email protected]>

KVM allows issuing the KVM_CHECK_EXTENSION ioctl either on the /dev/kvm fd or the VM fd. In the first case, kvm_vm_ioctl_check_extension() is called with kvm==NULL. Ensure we don't dereference the pointer in that case.

Fixes 40ebdb8e59df ("KVM: s390: Make huge pages unavailable in ucontrol VMs")

Message-ID: <[email protected]>

---
 arch/s390/kvm/kvm-s390.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/kvm/kvm-s390.c +1 -1
index 5147b943a864..7721eb522f43 100644
@@ -587,7 +587,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 		break;
 	case KVM_CAP_S390_HPAGE_1M:
 		r = 0;
-		if (hpage && !kvm_is_ucontrol(kvm))
+		if (hpage && !(kvm && kvm_is_ucontrol(kvm)))
 			r = 1;
 		break;
 	case KVM_CAP_S390_MEM_OP:
Signature · 1 line
2.44.0
maintainer
#2 lore raw
In reply to Christian Borntraeger
Quoted 4 lines · Christian Borntraeger

Paolo,

one fix for s390.

Pulled, thanks.

Paolo

Quoted 24 lines

The following changes since commit 16c20208b9c2fff73015ad4e609072feafbf81ad:

Merge tag 'kvmarm-fixes-6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD (2024-04-30 13:50:55 -0400)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git tags/kvm-s390-master-6.9-1

for you to fetch changes up to 175f2f5bcdfce9e728f1ff956a50f28824d28791:

KVM: s390: Check kvm pointer when testing KVM_CAP_S390_HPAGE_1M (2024-05-02 09:41:38 +0200)

----------------------------------------------------------------
KVM: s390: Fix for 6.9

Fix wild read on capability check.

----------------------------------------------------------------
Jean-Philippe Brucker (1):
KVM: s390: Check kvm pointer when testing KVM_CAP_S390_HPAGE_1M

 arch/s390/kvm/kvm-s390.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)