• Ian Abbott's avatar
    misc: genwqe: check for error from get_user_pages_fast() · 7de4a0e7
    Ian Abbott authored
    commit cf35d6e0 upstream.
    
    `genwqe_user_vmap()` calls `get_user_pages_fast()` and if the return
    value is less than the number of pages requested, it frees the pages and
    returns an error (`-EFAULT`).  However, it fails to consider a negative
    error return value from `get_user_pages_fast()`.  In that case, the test
    `if (rc < m->nr_pages)` will be false (due to promotion of `rc` to a
    large `unsigned int`) and the code will continue on to call
    `genwqe_map_pages()` with an invalid list of page pointers.  Fix it by
    bailing out if `get_user_pages_fast()` returns a negative error value.
    Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    7de4a0e7
card_utils.c 24.3 KB