[lkml]   [2008]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH] splice: fix user pointer access in get_iovec_page_array()
    From: Bastian Blank <>

    The commit 8811930dc74a503415b35c4a79d14fb0b408a361 ("splice: missing user
    pointer access verification") added access_ok() to copy_from_user_mmap_sem()
    which only ensures we can copy the struct iovecs from userspace to the kernel
    but we also must check whether we can access the actual memory region pointed
    to by the struct iovec to close the local root exploit.

    Cc: <>
    Cc: Jens Axboe <>
    Cc: Andrew Morton <>
    Signed-off-by: Pekka Enberg <>
    Bastian, can I have your Signed-off-by for this, please? Oliver, Niki, can
    you please confirm this closes the hole?

    fs/splice.c | 3 +++
    1 file changed, 3 insertions(+)

    Index: linux-2.6/fs/splice.c
    --- linux-2.6.orig/fs/splice.c
    +++ linux-2.6/fs/splice.c
    @@ -1237,6 +1237,9 @@ static int get_iovec_page_array(const st
    if (unlikely(!base))

    + if (unlikely(!access_ok(VERIFY_READ, base, len)))
    + break;
    * Get this base offset and number of pages, then map
    * in the user pages.

     \ /
      Last update: 2008-02-10 15:51    [W:0.039 / U:15.464 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site