Commit 1f0331be authored by Claudio Imbrenda's avatar Claudio Imbrenda Committed by sanglipeng
Browse files

KVM: s390: pv: fix index value of replaced ASCE

stable inclusion
from stable-v5.10.190
commit 8e635da0e0d3cb45e32fa79b36218fb98281bc10
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I928UI

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8e635da0e0d3cb45e32fa79b36218fb98281bc10



--------------------------------

[ Upstream commit c2fceb59 ]

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: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
Fixes: faa2f72c ("KVM: s390: pv: leak the topmost page table when destroy fails")
Reviewed-by: default avatarJanosch Frank <frankja@linux.ibm.com>
Signed-off-by: default avatarClaudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20230705111937.33472-3-imbrenda@linux.ibm.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent df46ea01
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment