]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
drop some broken s390 patches from 4.9 and 4.14
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Nov 2021 17:53:11 +0000 (18:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Nov 2021 17:53:11 +0000 (18:53 +0100)
queue-4.14/s390-gmap-don-t-unconditionally-call-pte_unmap_unloc.patch
queue-4.14/s390-gmap-validate-vma-in-__gmap_zap.patch [deleted file]
queue-4.14/s390-mm-validate-vma-in-pgste-manipulation-functions.patch [deleted file]
queue-4.14/series
queue-4.9/s390-gmap-don-t-unconditionally-call-pte_unmap_unloc.patch
queue-4.9/s390-gmap-validate-vma-in-__gmap_zap.patch [deleted file]
queue-4.9/series

index 976f8453b15989aae6b527e33228273ec8d6bbb5..649bee2122ea0b852b602316efc5809987e34409 100644 (file)
@@ -23,15 +23,13 @@ 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>
 ---
- arch/s390/mm/gmap.c | 5 +++--
+ arch/s390/mm/gmap.c |    5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
 
-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)
+@@ -665,9 +665,10 @@ void __gmap_zap(struct gmap *gmap, unsig
+               vmaddr |= gaddr & ~PMD_MASK;
                /* Get pointer to the page table entry */
                ptep = get_locked_pte(gmap->mm, vmaddr, &ptl);
 -              if (likely(ptep))
@@ -43,6 +41,3 @@ index 55cf3ed1d1fae..979e2c53a513a 100644
        }
  }
  EXPORT_SYMBOL_GPL(__gmap_zap);
--- 
-2.33.0
-
diff --git a/queue-4.14/s390-gmap-validate-vma-in-__gmap_zap.patch b/queue-4.14/s390-gmap-validate-vma-in-__gmap_zap.patch
deleted file mode 100644 (file)
index 7d09718..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-From d20014a393c9a02727204b3789ee45ef732a72c7 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 9 Sep 2021 18:22:40 +0200
-Subject: s390/gmap: validate VMA in __gmap_zap()
-
-From: David Hildenbrand <david@redhat.com>
-
-[ Upstream commit 2d8fb8f3914b40e3cc12f8cbb74daefd5245349d ]
-
-We should not walk/touch page tables outside of VMA boundaries when
-holding only the mmap sem in read mode. Evil user space can modify the
-VMA layout just before this function runs and e.g., trigger races with
-page table removal code since commit dd2283f2605e ("mm: mmap: zap pages
-with read mmap_sem in munmap"). The pure prescence in our guest_to_host
-radix tree does not imply that there is a VMA.
-
-Further, we should not allocate page tables (via get_locked_pte()) outside
-of VMA boundaries: if evil user space decides to map hugetlbfs to these
-ranges, bad things will happen because we suddenly have PTE or PMD page
-tables where we shouldn't have them.
-
-Similarly, we have to check if we suddenly find a hugetlbfs VMA, before
-calling get_locked_pte().
-
-Note that gmap_discard() is different:
-zap_page_range()->unmap_single_vma() makes sure to stay within VMA
-boundaries.
-
-Fixes: b31288fa83b2 ("s390/kvm: support collaborative memory management")
-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-2-david@redhat.com
-Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- arch/s390/mm/gmap.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c
-index a29d2e88b00ef..55cf3ed1d1fae 100644
---- a/arch/s390/mm/gmap.c
-+++ b/arch/s390/mm/gmap.c
-@@ -654,6 +654,7 @@ EXPORT_SYMBOL_GPL(gmap_fault);
-  */
- void __gmap_zap(struct gmap *gmap, unsigned long gaddr)
- {
-+      struct vm_area_struct *vma;
-       unsigned long vmaddr;
-       spinlock_t *ptl;
-       pte_t *ptep;
-@@ -663,6 +664,11 @@ void __gmap_zap(struct gmap *gmap, unsigned long gaddr)
-                                                  gaddr >> PMD_SHIFT);
-       if (vmaddr) {
-               vmaddr |= gaddr & ~PMD_MASK;
-+
-+              vma = vma_lookup(gmap->mm, vmaddr);
-+              if (!vma || is_vm_hugetlb_page(vma))
-+                      return;
-+
-               /* Get pointer to the page table entry */
-               ptep = get_locked_pte(gmap->mm, vmaddr, &ptl);
-               if (likely(ptep))
--- 
-2.33.0
-
diff --git a/queue-4.14/s390-mm-validate-vma-in-pgste-manipulation-functions.patch b/queue-4.14/s390-mm-validate-vma-in-pgste-manipulation-functions.patch
deleted file mode 100644 (file)
index ab14a8b..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-From b9eaebec12377e206c0c9ed092464987a81c2dfd Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 9 Sep 2021 18:22:42 +0200
-Subject: s390/mm: validate VMA in PGSTE manipulation functions
-
-From: David Hildenbrand <david@redhat.com>
-
-[ Upstream commit fe3d10024073f06f04c74b9674bd71ccc1d787cf ]
-
-We should not walk/touch page tables outside of VMA boundaries when
-holding only the mmap sem in read mode. Evil user space can modify the
-VMA layout just before this function runs and e.g., trigger races with
-page table removal code since commit dd2283f2605e ("mm: mmap: zap pages
-with read mmap_sem in munmap"). gfn_to_hva() will only translate using
-KVM memory regions, but won't validate the VMA.
-
-Further, we should not allocate page tables outside of VMA boundaries: if
-evil user space decides to map hugetlbfs to these ranges, bad things will
-happen because we suddenly have PTE or PMD page tables where we
-shouldn't have them.
-
-Similarly, we have to check if we suddenly find a hugetlbfs VMA, before
-calling get_locked_pte().
-
-Fixes: 2d42f9477320 ("s390/kvm: Add PGSTE manipulation functions")
-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-4-david@redhat.com
-Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- arch/s390/mm/pgtable.c | 13 +++++++++++++
- 1 file changed, 13 insertions(+)
-
-diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
-index ae677f814bc07..a2182d5a1a105 100644
---- a/arch/s390/mm/pgtable.c
-+++ b/arch/s390/mm/pgtable.c
-@@ -896,6 +896,7 @@ EXPORT_SYMBOL(get_guest_storage_key);
- int pgste_perform_essa(struct mm_struct *mm, unsigned long hva, int orc,
-                       unsigned long *oldpte, unsigned long *oldpgste)
- {
-+      struct vm_area_struct *vma;
-       unsigned long pgstev;
-       spinlock_t *ptl;
-       pgste_t pgste;
-@@ -905,6 +906,10 @@ int pgste_perform_essa(struct mm_struct *mm, unsigned long hva, int orc,
-       WARN_ON_ONCE(orc > ESSA_MAX);
-       if (unlikely(orc > ESSA_MAX))
-               return -EINVAL;
-+
-+      vma = vma_lookup(mm, hva);
-+      if (!vma || is_vm_hugetlb_page(vma))
-+              return -EFAULT;
-       ptep = get_locked_pte(mm, hva, &ptl);
-       if (unlikely(!ptep))
-               return -EFAULT;
-@@ -997,10 +1002,14 @@ EXPORT_SYMBOL(pgste_perform_essa);
- int set_pgste_bits(struct mm_struct *mm, unsigned long hva,
-                       unsigned long bits, unsigned long value)
- {
-+      struct vm_area_struct *vma;
-       spinlock_t *ptl;
-       pgste_t new;
-       pte_t *ptep;
-+      vma = vma_lookup(mm, hva);
-+      if (!vma || is_vm_hugetlb_page(vma))
-+              return -EFAULT;
-       ptep = get_locked_pte(mm, hva, &ptl);
-       if (unlikely(!ptep))
-               return -EFAULT;
-@@ -1025,9 +1034,13 @@ EXPORT_SYMBOL(set_pgste_bits);
-  */
- int get_pgste(struct mm_struct *mm, unsigned long hva, unsigned long *pgstep)
- {
-+      struct vm_area_struct *vma;
-       spinlock_t *ptl;
-       pte_t *ptep;
-+      vma = vma_lookup(mm, hva);
-+      if (!vma || is_vm_hugetlb_page(vma))
-+              return -EFAULT;
-       ptep = get_locked_pte(mm, hva, &ptl);
-       if (unlikely(!ptep))
-               return -EFAULT;
--- 
-2.33.0
-
index 8fb77300cbb87b2b8e1946c29285a417a4b6975b..80f51242bef25e6d930b55bba735d28f9383478f 100644 (file)
@@ -127,9 +127,7 @@ mwifiex-send-delba-requests-according-to-spec.patch
 phy-micrel-ksz8041nl-do-not-use-power-down-mode.patch
 pm-hibernate-fix-sparse-warnings.patch
 smackfs-use-netlbl_cfg_cipsov4_del-for-deleting-cips.patch
-s390-gmap-validate-vma-in-__gmap_zap.patch
 s390-gmap-don-t-unconditionally-call-pte_unmap_unloc.patch
-s390-mm-validate-vma-in-pgste-manipulation-functions.patch
 irq-mips-avoid-nested-irq_enter.patch
 samples-kretprobes-fix-return-value-if-register_kret.patch
 libertas_tf-fix-possible-memory-leak-in-probe-and-di.patch
index 87a6de06fc6e4f99305bfd1f0268ecaf4b1ba017..2116bd7c15ccb8a5fd67145e6ed35b831dbe642a 100644 (file)
@@ -23,15 +23,13 @@ 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>
 ---
- arch/s390/mm/gmap.c | 5 +++--
+ arch/s390/mm/gmap.c |    5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
 
-diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c
-index a8498870bcf49..ffc1372e4c56d 100644
 --- a/arch/s390/mm/gmap.c
 +++ b/arch/s390/mm/gmap.c
-@@ -668,9 +668,10 @@ void __gmap_zap(struct gmap *gmap, unsigned long gaddr)
+@@ -662,9 +662,10 @@ void __gmap_zap(struct gmap *gmap, unsig
+               vmaddr |= gaddr & ~PMD_MASK;
                /* Get pointer to the page table entry */
                ptep = get_locked_pte(gmap->mm, vmaddr, &ptl);
 -              if (likely(ptep))
@@ -43,6 +41,3 @@ index a8498870bcf49..ffc1372e4c56d 100644
        }
  }
  EXPORT_SYMBOL_GPL(__gmap_zap);
--- 
-2.33.0
-
diff --git a/queue-4.9/s390-gmap-validate-vma-in-__gmap_zap.patch b/queue-4.9/s390-gmap-validate-vma-in-__gmap_zap.patch
deleted file mode 100644 (file)
index 88b0be9..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-From 35177947f8b30a9282dc9149cb936de4c6dd487e Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 9 Sep 2021 18:22:40 +0200
-Subject: s390/gmap: validate VMA in __gmap_zap()
-
-From: David Hildenbrand <david@redhat.com>
-
-[ Upstream commit 2d8fb8f3914b40e3cc12f8cbb74daefd5245349d ]
-
-We should not walk/touch page tables outside of VMA boundaries when
-holding only the mmap sem in read mode. Evil user space can modify the
-VMA layout just before this function runs and e.g., trigger races with
-page table removal code since commit dd2283f2605e ("mm: mmap: zap pages
-with read mmap_sem in munmap"). The pure prescence in our guest_to_host
-radix tree does not imply that there is a VMA.
-
-Further, we should not allocate page tables (via get_locked_pte()) outside
-of VMA boundaries: if evil user space decides to map hugetlbfs to these
-ranges, bad things will happen because we suddenly have PTE or PMD page
-tables where we shouldn't have them.
-
-Similarly, we have to check if we suddenly find a hugetlbfs VMA, before
-calling get_locked_pte().
-
-Note that gmap_discard() is different:
-zap_page_range()->unmap_single_vma() makes sure to stay within VMA
-boundaries.
-
-Fixes: b31288fa83b2 ("s390/kvm: support collaborative memory management")
-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-2-david@redhat.com
-Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- arch/s390/mm/gmap.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c
-index 0195c3983f540..a8498870bcf49 100644
---- a/arch/s390/mm/gmap.c
-+++ b/arch/s390/mm/gmap.c
-@@ -651,6 +651,7 @@ EXPORT_SYMBOL_GPL(gmap_fault);
-  */
- void __gmap_zap(struct gmap *gmap, unsigned long gaddr)
- {
-+      struct vm_area_struct *vma;
-       unsigned long vmaddr;
-       spinlock_t *ptl;
-       pte_t *ptep;
-@@ -660,6 +661,11 @@ void __gmap_zap(struct gmap *gmap, unsigned long gaddr)
-                                                  gaddr >> PMD_SHIFT);
-       if (vmaddr) {
-               vmaddr |= gaddr & ~PMD_MASK;
-+
-+              vma = vma_lookup(gmap->mm, vmaddr);
-+              if (!vma || is_vm_hugetlb_page(vma))
-+                      return;
-+
-               /* Get pointer to the page table entry */
-               ptep = get_locked_pte(gmap->mm, vmaddr, &ptl);
-               if (likely(ptep))
--- 
-2.33.0
-
index bd9c6b60b467dbd124d865067f07a9eed2605c52..8f8daa283e01cc56ef79c59a83a16449bbd210e2 100644 (file)
@@ -106,7 +106,6 @@ platform-x86-thinkpad_acpi-fix-bitwise-vs.-logical-w.patch
 mwifiex-send-delba-requests-according-to-spec.patch
 phy-micrel-ksz8041nl-do-not-use-power-down-mode.patch
 smackfs-use-netlbl_cfg_cipsov4_del-for-deleting-cips.patch
-s390-gmap-validate-vma-in-__gmap_zap.patch
 s390-gmap-don-t-unconditionally-call-pte_unmap_unloc.patch
 irq-mips-avoid-nested-irq_enter.patch
 samples-kretprobes-fix-return-value-if-register_kret.patch