]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
s390/gmap: don't unconditionally call pte_unmap_unlock() in __gmap_zap()
authorDavid Hildenbrand <david@redhat.com>
Thu, 9 Sep 2021 16:22:41 +0000 (18:22 +0200)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:48:25 +0000 (09:48 +0100)
commitb04d281059f239cd7a38863b8b846c98a74fde82
tree4804c383c86c04cf29aa16484a59ad7b50c06ac5
parente05296f2075c75359284ec8b66aa7ffc4b3f0f2d
s390/gmap: don't unconditionally call pte_unmap_unlock() in __gmap_zap()

BugLink: https://bugs.launchpad.net/bugs/1951822
[ Upstream commit b159f94c86b43cf7e73e654bc527255b1f4eafc4 ]

... otherwise we will try unlocking a spinlock that was never locked via a
garbage pointer.

At the time we reach this code path, we usually successfully looked up
a PGSTE already; however, evil user space could have manipulated the VMA
layout in the meantime and triggered removal of the page table.

Fixes: 1e133ab296f3 ("s390/mm: split arch/s390/mm/pgtable.c")
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Link: https://lore.kernel.org/r/20210909162248.14969-3-david@redhat.com
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
arch/s390/mm/gmap.c