Patch "s390/gmap: don't unconditionally call pte_unmap_unlock() in __gmap_zap()" has been added to the 4.14-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    s390/gmap: don't unconditionally call pte_unmap_unlock() in __gmap_zap()

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     s390-gmap-don-t-unconditionally-call-pte_unmap_unloc.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 51c999fc8473f3c7f89f49472926cd5915fe3a3d
Author: David Hildenbrand <david@xxxxxxxxxx>
Date:   Thu Sep 9 18:22:41 2021 +0200

    s390/gmap: don't unconditionally call pte_unmap_unlock() in __gmap_zap()
    
    [ 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@xxxxxxxxxx>
    Reviewed-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx>
    Acked-by: Heiko Carstens <hca@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20210909162248.14969-3-david@xxxxxxxxxx
    Signed-off-by: Christian Borntraeger <borntraeger@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c
index 55cf3ed1d1fae..979e2c53a513a 100644
--- a/arch/s390/mm/gmap.c
+++ b/arch/s390/mm/gmap.c
@@ -671,9 +671,10 @@ void __gmap_zap(struct gmap *gmap, unsigned long gaddr)
 
 		/* Get pointer to the page table entry */
 		ptep = get_locked_pte(gmap->mm, vmaddr, &ptl);
-		if (likely(ptep))
+		if (likely(ptep)) {
 			ptep_zap_unused(gmap->mm, vmaddr, ptep, 0);
-		pte_unmap_unlock(ptep, ptl);
+			pte_unmap_unlock(ptep, ptl);
+		}
 	}
 }
 EXPORT_SYMBOL_GPL(__gmap_zap);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux