diff options
author | Claudio Imbrenda <[email protected]> | 2023-07-05 13:19:37 +0200 |
---|---|---|
committer | Claudio Imbrenda <[email protected]> | 2023-07-18 11:21:51 +0200 |
commit | c2fceb59bbda16468bda82b002383bff59de89ab (patch) | |
tree | e32cb6b322c0fb704826a7f9e0b454c0c2aeecc7 | |
parent | 5ff92181577a89ed12ad4e0e5813751faf16a139 (diff) |
KVM: s390: pv: fix index value of replaced ASCE
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é <[email protected]>
Fixes: faa2f72cb356 ("KVM: s390: pv: leak the topmost page table when destroy fails")
Reviewed-by: Janosch Frank <[email protected]>
Signed-off-by: Claudio Imbrenda <[email protected]>
Message-ID: <[email protected]>
-rw-r--r-- | arch/s390/mm/gmap.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c index 989ebd0912b4..9c8af31be970 100644 --- a/arch/s390/mm/gmap.c +++ b/arch/s390/mm/gmap.c @@ -2853,6 +2853,7 @@ int s390_replace_asce(struct gmap *gmap) page = alloc_pages(GFP_KERNEL_ACCOUNT, CRST_ALLOC_ORDER); if (!page) return -ENOMEM; + page->index = 0; table = page_to_virt(page); memcpy(table, gmap->table, 1UL << (CRST_ALLOC_ORDER + PAGE_SHIFT)); |