Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

s390/mm: Fix phys_to_folio() usage in do_secure_storage_access()

In case of a Secure-Storage-Access exception the effective aka virtual
address which caused the exception is contained within the TEID.

do_secure_storage_access() incorrectly uses phys_to_folio() instead of
virt_to_folio() to translate the virtual address to the corresponding
folio.

Fix this by using virt_to_folio() instead of phys_to_folio().

Fixes: 084ea4d611a3 ("s390/mm: add (non)secure page access exceptions handlers")
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>

authored by

Heiko Carstens and committed by
Alexander Gordeev
b95e0e79 8587af9c

+1 -1
+1 -1
arch/s390/mm/fault.c
··· 438 438 panic("Unexpected PGM 0x3d with TEID bit 61=0"); 439 439 } 440 440 if (is_kernel_fault(regs)) { 441 - folio = phys_to_folio(addr); 441 + folio = virt_to_folio((void *)addr); 442 442 if (unlikely(!folio_try_get(folio))) 443 443 return; 444 444 rc = uv_convert_from_secure(folio_to_phys(folio));