Skip to contentSkip to conversation

tee: fix compiler warning in tee_shm_register()

PATCH In review Jens Wiklander 2 participants 3 messages Aug 22, 2022 – Aug 25, 2022 TEE

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tee: fix compiler warning in tee_shm_register()

Include <linux/uaccess.h> to avoid the warning:
drivers/tee/tee_shm.c: In function 'tee_shm_register':

Quoted 1 line
Quoted 1 line

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()")
---
 drivers/tee/tee_shm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/tee/tee_shm.c +1 -0
index 1175f3a46859..27295bda3e0b 100644
@@ -9,6 +9,7 @@
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/tee_drv.h>
+#include <linux/uaccess.h>
 #include <linux/uio.h>
 #include "tee_private.h"
 
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Jens Wiklander

Include <linux/uaccess.h> to avoid the warning:
drivers/tee/tee_shm.c: In function 'tee_shm_register':

Quoted 1 line
Quoted 1 line

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))
         |              ^~~~~~~~~
Quoted 9 lines

cc1: some warnings being treated as errors

Fixes 573ae4f13f63 ("tee: add overflow check in register_shm_helper()")
---
 drivers/tee/tee_shm.c | 1 +
 1 file changed, 1 insertion(+)

-Sumit

Quoted 15 lines
drivers/tee/tee_shm.c +1 -1
index 1175f3a46859..27295bda3e0b 100644
@@ -9,6 +9,7 @@
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/tee_drv.h>
+#include <linux/uaccess.h>
 #include <linux/uio.h>
 #include "tee_private.h"
 
--

2.31.1

#2 lore raw
Quoted 18 lines · Sumit Garg
Quoted 6 lines · Jens Wiklander

Include <linux/uaccess.h> to avoid the warning:
drivers/tee/tee_shm.c: In function 'tee_shm_register':

Quoted 1 line
Quoted 1 line

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))
         |              ^~~~~~~~~
Quoted 9 lines

cc1: some warnings being treated as errors

Fixes 573ae4f13f63 ("tee: add overflow check in register_shm_helper()")
---
 drivers/tee/tee_shm.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 1 line

Thanks, I'm picking this up now.

Cheers,
Jens

Quoted 18 lines

-Sumit

Quoted 15 lines
drivers/tee/tee_shm.c +1 -1
index 1175f3a46859..27295bda3e0b 100644
@@ -9,6 +9,7 @@
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/tee_drv.h>
+#include <linux/uaccess.h>
 #include <linux/uio.h>
 #include "tee_private.h"
 
--

2.31.1