summaryrefslogtreecommitdiffstats
path: root/fs/libfs.c
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2014-11-06 16:23:39 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-07 10:26:46 -0800
commitcf35d6e0475982667b0d2d318fb27be4b8849827 (patch)
tree45f0b776d4f9497e793cbfa1f0afe59e85606004 /fs/libfs.c
parent965ab29ba09d75056a6c9b0f707cd1c2cc91188f (diff)
downloadlinux-cf35d6e0475982667b0d2d318fb27be4b8849827.tar.gz
linux-cf35d6e0475982667b0d2d318fb27be4b8849827.tar.bz2
linux-cf35d6e0475982667b0d2d318fb27be4b8849827.zip
misc: genwqe: check for error from get_user_pages_fast()
`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: Ian Abbott <abbotti@mev.co.uk> Cc: <stable@vger.kernel.org> # 3.14.x # 3.15.x # 3.16.x # 3.17.x Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/libfs.c')
0 files changed, 0 insertions, 0 deletions