lkml.org 
[lkml]   [2012]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 090/241] s390/gup: add missing TASK_SIZE check to get_user_pages_fast()
    Date
    3.5.7.2 -stable review patch.  If anyone has any objections, please let me know.

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

    From: Heiko Carstens <heiko.carstens@de.ibm.com>

    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: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
    ---
    arch/s390/mm/gup.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    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;

    /*
    --
    1.7.9.5


    \
     
     \ /
      Last update: 2012-12-13 15:21    [W:4.698 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site