
From: Jens Wiklander <jens.wiklander@linaro.org> mainline inclusion from mainline-v6.0-rc5 commit eccd7439709810127563e7e3e49b8b44c7b2791d category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/ICG798 CVE: CVE-2022-50080 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i... -------------------------------- Include <linux/uaccess.h> to avoid the warning: drivers/tee/tee_shm.c: In function 'tee_shm_register':
drivers/tee/tee_shm.c:242:14: error: implicit declaration of function 'access_ok' [-Werror=implicit-function-declaration] 242 | if (!access_ok((void __user *)addr, length)) | ^~~~~~~~~ cc1: some warnings being treated as errors
Fixes: 573ae4f13f63 ("tee: add overflow check in register_shm_helper()") Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Conflicts: drivers/tee/tee_shm.c [adjust context] Signed-off-by: Yuntao Liu <liuyuntao12@huawei.com> --- drivers/tee/tee_shm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tee/tee_shm.c b/drivers/tee/tee_shm.c index c591e7ba4435..e4c150346a42 100644 --- a/drivers/tee/tee_shm.c +++ b/drivers/tee/tee_shm.c @@ -18,6 +18,7 @@ #include <linux/sched.h> #include <linux/slab.h> #include <linux/tee_drv.h> +#include <linux/uaccess.h> #include "tee_private.h" static void tee_shm_release(struct tee_device *teedev, struct tee_shm *shm) -- 2.34.1