Skip to contentSkip to conversation

Patch "KVM: s390: prevent buffer overrun on memory hotplug during migration" has been added to the 4.14-stable tree

PATCH [email protected] 1 participant 1 message Jan 7, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

KVM: s390: prevent buffer overrun on memory hotplug during migration

to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
kvm-s390-prevent-buffer-overrun-on-memory-hotplug-during-migration.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From c2cf265d860882b51a200e4a7553c17827f2b730 Mon Sep 17 00:00:00 2001

From: Christian Borntraeger <[email protected]>
Date: Thu, 21 Dec 2017 09:18:22 +0100
Subject: KVM: s390: prevent buffer overrun on memory hotplug during migration

From: Christian Borntraeger <[email protected]>

commit c2cf265d860882b51a200e4a7553c17827f2b730 upstream.

We must not go beyond the pre-allocated buffer. This can happen when a new memory slot is added during migration.

Fixes 190df4a212a7 (KVM: s390: CMMA tracking, ESSA emulation, migration mode)
---
 arch/s390/kvm/priv.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/kvm/priv.c +1 -1
@@ -1009,7 +1009,7 @@ static inline int do_essa(struct kvm_vcp
 		cbrlo[entries] = gfn << PAGE_SHIFT;
 	}
 
-	if (orc) {
+	if (orc && gfn < ms->bitmap_size) {
 		/* increment only if we are really flipping the bit to 1 */
 		if (!test_and_set_bit(gfn, ms->pgste_bitmap))
 			atomic64_inc(&ms->dirty_pages);

Patches currently in stable-queue which might be from [email protected] are

queue-4.14/kvm-s390-prevent-buffer-overrun-on-memory-hotplug-during-migration.patch queue-4.14/kvm-s390-fix-cmma-migration-for-multiple-memory-slots.patch