Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1728825 > unrolled thread

[PATCH 4.12 33/43] s390/mm: fix BUG_ON in crst_table_upgrade

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2017-09-08 15:30 +0200
Last post2017-09-08 15:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.12 33/43] s390/mm: fix BUG_ON in crst_table_upgrade Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-08 15:30 +0200

#1728825 — [PATCH 4.12 33/43] s390/mm: fix BUG_ON in crst_table_upgrade

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-09-08 15:30 +0200
Subject[PATCH 4.12 33/43] s390/mm: fix BUG_ON in crst_table_upgrade
Message-ID<unrw6-7zK-35@gated-at.bofh.it>
4.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Martin Schwidefsky <schwidefsky@de.ibm.com>

commit 8ab867cb0806a8e195de161fd8883a0578d1d050 upstream.

A 31-bit compat process can force a BUG_ON in crst_table_upgrade
with specific, invalid mmap calls, e.g.

   mmap((void*) 0x7fff8000, 0x10000, 3, 32, -1, 0)

The arch_get_unmapped_area[_topdown] functions miss an if condition
in the decision to do a page table upgrade.

[ms: Backport to 4.12, minor context change]

Fixes: 9b11c7912d00 ("s390/mm: simplify arch_get_unmapped_area[_topdown]")
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/s390/mm/mmap.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/arch/s390/mm/mmap.c
+++ b/arch/s390/mm/mmap.c
@@ -119,7 +119,8 @@ arch_get_unmapped_area(struct file *filp
 		return addr;
 
 check_asce_limit:
-	if (addr + len > current->mm->context.asce_limit) {
+	if (addr + len > current->mm->context.asce_limit &&
+	    addr + len <= TASK_SIZE) {
 		rc = crst_table_upgrade(mm);
 		if (rc)
 			return (unsigned long) rc;
@@ -183,7 +184,8 @@ arch_get_unmapped_area_topdown(struct fi
 	}
 
 check_asce_limit:
-	if (addr + len > current->mm->context.asce_limit) {
+	if (addr + len > current->mm->context.asce_limit &&
+	    addr + len <= TASK_SIZE) {
 		rc = crst_table_upgrade(mm);
 		if (rc)
 			return (unsigned long) rc;

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web