linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] videodev2: Mark all user pointers as such
@ 2018-04-12 12:58 Sakari Ailus
  0 siblings, 0 replies; only message in thread
From: Sakari Ailus @ 2018-04-12 12:58 UTC (permalink / raw)
  To: linux-media; +Cc: mchehab, hverkuil

A number of uAPI structs have pointers but some lack the __user modifier. 
Add this to the pointers that do not have it.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
Hi Mauro,

I wonder if this would fix some smatch errors or would allow also cleaning
up the casts in the compat code. Either way, this would still be the correct
thing todo.

 include/uapi/linux/videodev2.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 9c65d890a5f2d..a2252d0d7051d 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -930,7 +930,7 @@ struct v4l2_buffer {
 	union {
 		__u32           offset;
 		unsigned long   userptr;
-		struct v4l2_plane *planes;
+		struct v4l2_plane __user *planes;
 		__s32		fd;
 	} m;
 	__u32			length;
@@ -1014,7 +1014,7 @@ struct v4l2_framebuffer {
 	__u32			flags;
 /* FIXME: in theory we should pass something like PCI device + memory
  * region + offset instead of some physical address */
-	void                    *base;
+	void __user		*base;
 	struct {
 		__u32		width;
 		__u32		height;
@@ -1602,7 +1602,7 @@ struct v4l2_ext_controls {
 	__u32 error_idx;
 	__s32 request_fd;
 	__u32 reserved[1];
-	struct v4l2_ext_control *controls;
+	struct v4l2_ext_control __user *controls;
 };
 
 #define V4L2_CTRL_ID_MASK	  (0x0fffffff)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-04-12 12:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-12 12:58 [PATCH 1/1] videodev2: Mark all user pointers as such Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).