Re: [PATCH v6 1/3] media: v4l2-subdev: Verify arguments in v4l2_subdev_call()

2019-05-17 Thread Janusz Krzysztofik
On Friday, May 17, 2019 5:58:40 PM CEST Sakari Ailus wrote: > Hi Janusz, > > On Wed, May 15, 2019 at 10:56:36PM +0200, Janusz Krzysztofik wrote: > > Hi Sakari, > > > > On Wednesday, May 15, 2019 9:16:02 AM CEST Sakari Ailus wrote: > > > Hi Janusz, > > > > > > On Wed, May 15, 2019 at 12:48:21AM +

Re: [PATCH v6 1/3] media: v4l2-subdev: Verify arguments in v4l2_subdev_call()

2019-05-17 Thread Sakari Ailus
Hi Janusz, On Wed, May 15, 2019 at 10:56:36PM +0200, Janusz Krzysztofik wrote: > Hi Sakari, > > On Wednesday, May 15, 2019 9:16:02 AM CEST Sakari Ailus wrote: > > Hi Janusz, > > > > On Wed, May 15, 2019 at 12:48:21AM +0200, Janusz Krzysztofik wrote: > > > -static int check_crop(struct v4l2_subde

Re: [PATCH v6 1/3] media: v4l2-subdev: Verify arguments in v4l2_subdev_call()

2019-05-15 Thread Janusz Krzysztofik
Hi Sakari, On Wednesday, May 15, 2019 9:16:02 AM CEST Sakari Ailus wrote: > Hi Janusz, > > On Wed, May 15, 2019 at 12:48:21AM +0200, Janusz Krzysztofik wrote: > > -static int check_crop(struct v4l2_subdev *sd, struct v4l2_subdev_crop *crop) > > +static inline int check_pad(struct v4l2_subdev *sd

Re: [PATCH v6 1/3] media: v4l2-subdev: Verify arguments in v4l2_subdev_call()

2019-05-15 Thread Sakari Ailus
Hi Janusz, On Wed, May 15, 2019 at 12:48:21AM +0200, Janusz Krzysztofik wrote: > -static int check_crop(struct v4l2_subdev *sd, struct v4l2_subdev_crop *crop) > +static inline int check_pad(struct v4l2_subdev *sd, __u32 pad) > { > - if (crop->which != V4L2_SUBDEV_FORMAT_TRY && > - cro

[PATCH v6 1/3] media: v4l2-subdev: Verify arguments in v4l2_subdev_call()

2019-05-14 Thread Janusz Krzysztofik
Correctness of format type (try or active) and pad number parameters passed to subdevice operation callbacks is now verified only for IOCTL calls. However, those callbacks are also used by drivers, e.g., V4L2 host interfaces. Since both subdev_do_ioctl() and drivers are using v4l2_subdev_call() m