linux/drivers/misc/genwqe
Ian Abbott eb6719481d misc: genwqe: check for error from get_user_pages_fast()
commit cf35d6e047 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: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
History 2015-01-05 13:48:39 +00:00
..
card_base.c GenWQE PCI support, health monitoring and recovery 2013-12-18 16:51:15 -08:00
card_base.h GenWQE: Fix multithreading problems 2014-04-16 12:12:39 -07:00
card_ddcb.c GenWQE: Ensure rc is not returning an uninitialized value 2014-04-16 12:12:39 -07:00
card_ddcb.h GenWQE Character device and DDCB queue 2013-12-18 16:51:15 -08:00
card_debugfs.c misc: genwqe: Fix format string mismatch in card_debugfs.c 2014-05-03 19:25:17 -04:00
card_dev.c GenWQE: Fix multithreading problems 2014-04-16 12:12:39 -07:00
card_sysfs.c GenWQE Sysfs interfaces 2013-12-18 16:51:15 -08:00
card_utils.c misc: genwqe: check for error from get_user_pages_fast() 2015-01-05 13:48:39 +00:00
genwqe_driver.h GenWQE: Increase driver version number 2014-04-16 12:12:39 -07:00
Kconfig GenWQE Enable driver 2013-12-18 16:51:15 -08:00
Makefile GenWQE Enable driver 2013-12-18 16:51:15 -08:00