]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: s390: pv: fix index value of replaced ASCE
authorClaudio Imbrenda <imbrenda@linux.ibm.com>
Wed, 5 Jul 2023 11:19:37 +0000 (13:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Aug 2023 08:22:26 +0000 (10:22 +0200)
commit49a2686adddebe1ae76b4d368383208656ef6606
tree952ded7bdf0202c0d8f3ff1b4caa6656b229254a
parentfee1e6a735573f44fe014d9ad43c6a34a613e73f
KVM: s390: pv: fix index value of replaced ASCE

[ Upstream commit c2fceb59bbda16468bda82b002383bff59de89ab ]

The index field of the struct page corresponding to a guest ASCE should
be 0. When replacing the ASCE in s390_replace_asce(), the index of the
new ASCE should also be set to 0.

Having the wrong index might lead to the wrong addresses being passed
around when notifying pte invalidations, and eventually to validity
intercepts (VM crash) if the prefix gets unmapped and the notifier gets
called with the wrong address.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Fixes: faa2f72cb356 ("KVM: s390: pv: leak the topmost page table when destroy fails")
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20230705111937.33472-3-imbrenda@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/s390/mm/gmap.c