diff options
| author | Claudio Imbrenda <imbrenda@linux.ibm.com> | 2026-08-03 14:40:30 +0200 |
|---|---|---|
| committer | Claudio Imbrenda <imbrenda@linux.ibm.com> | 2026-08-03 16:51:33 +0200 |
| commit | b050f741fd0d636f2daab72b74aeccea97abdb5f (patch) | |
| tree | 8b598ce356abf0ce225dc489f53c6c71224eea76 | |
| parent | f8e370058e9e1396fea1a8d11906fa92ec9bad88 (diff) | |
| download | linux-b050f741fd0d636f2daab72b74aeccea97abdb5f.tar.gz linux-b050f741fd0d636f2daab72b74aeccea97abdb5f.zip | |
KVM: s390: Fix kvm_s390_vcpu_unsetup_cmma()
In some cases kvm_s390_vcpu_unsetup_cmma() can be called with a 0
cbrlo; in such cases, if running with V != R, free_page() will attempt
to free physical page 0.
Fix by freeing cbrlo only if it's non-zero.
Fixes: b31605c12f4e ("KVM: s390: make cmma usage conditionally")
Fixes: 29b40f105ec8 ("KVM: s390: protvirt: Add initial vm and cpu lifecycle handling")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260803124040.126471-4-imbrenda@linux.ibm.com>
| -rw-r--r-- | arch/s390/kvm/kvm-s390.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 1b3290a5ad1a..9be27db0a21e 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -3678,7 +3678,8 @@ static void kvm_s390_vcpu_crypto_setup(struct kvm_vcpu *vcpu) void kvm_s390_vcpu_unsetup_cmma(struct kvm_vcpu *vcpu) { - free_page((unsigned long)phys_to_virt(vcpu->arch.sie_block->cbrlo)); + if (vcpu->arch.sie_block->cbrlo) + free_page((unsigned long)phys_to_virt(vcpu->arch.sie_block->cbrlo)); vcpu->arch.sie_block->cbrlo = 0; } |
