aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2012-10-22 15:49:02 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-26 11:34:34 -0800
commit55d60ef31a8c7172ca8ad2dc275cbd0b9eda7b97 (patch)
tree87981b1d997b3e1fbb922ba0da04cb2c46769a25 /arch/s390
parentf174b32dc1a6912576d75d77afd00096f44878d4 (diff)
downloadkernel_samsung_smdk4412-55d60ef31a8c7172ca8ad2dc275cbd0b9eda7b97.zip
kernel_samsung_smdk4412-55d60ef31a8c7172ca8ad2dc275cbd0b9eda7b97.tar.gz
kernel_samsung_smdk4412-55d60ef31a8c7172ca8ad2dc275cbd0b9eda7b97.tar.bz2
s390/gup: add missing TASK_SIZE check to get_user_pages_fast()
commit d55c4c613fc4d4ad2ba0fc6fa2b57176d420f7e4 upstream. When walking page tables we need to make sure that everything is within bounds of the ASCE limit of the task's address space. Otherwise we might calculate e.g. a pud pointer which is not within a pud and dereference it. So check against TASK_SIZE (which is the ASCE limit) before walking page tables. Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/mm/gup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/mm/gup.c b/arch/s390/mm/gup.c
index 65cb06e..4ccf9f5 100644
--- a/arch/s390/mm/gup.c
+++ b/arch/s390/mm/gup.c
@@ -183,7 +183,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
addr = start;
len = (unsigned long) nr_pages << PAGE_SHIFT;
end = start + len;
- if (end < start)
+ if ((end < start) || (end > TASK_SIZE))
goto slow_irqon;
/*