]> git.baikalelectronics.ru Git - kernel.git/commit
tee: shm: Potential NULL dereference calling tee_shm_register()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 6 Jan 2018 09:22:30 +0000 (12:22 +0300)
committerJens Wiklander <jens.wiklander@linaro.org>
Tue, 9 Jan 2018 13:34:00 +0000 (14:34 +0100)
commitfb4352b26b0bb9e5c14c410354baca46ba953421
treeafb63b0da6212dacd08ab4ec7b81922a99b9295e
parent50008cdc95451f5938f2b261713ddf23808c7aa2
tee: shm: Potential NULL dereference calling tee_shm_register()

get_user_pages_fast() can return zero in certain error paths.  We should
handle that or else it means we accidentally return ERR_PTR(0) which is
NULL instead of an error pointer.  The callers are not expecting that
and will crash with a NULL dereference.

Fixes: cf1c5c9991e6 ("tee: add register user memory")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
drivers/tee/tee_shm.c