linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] media: v4l2-subdev: Verify arguments of v4l2_subdev_call()
@ 2019-05-11  9:53 Janusz Krzysztofik
  2019-05-11  9:53 ` [PATCH v3 1/2] " Janusz Krzysztofik
  2019-05-11  9:53 ` [PATCH v3 2/2] media: v4l2-subdev: Verify pad config argument Janusz Krzysztofik
  0 siblings, 2 replies; 3+ messages in thread
From: Janusz Krzysztofik @ 2019-05-11  9:53 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Hans Verkuil, Sakari Ailus, linux-media, linux-kernel,
	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()
macro while calling subdevice operations, move those parameter checks
from subdev_do_ioctl() to v4l2_subdev_call().  Also, add a check for
a non-NULL pad config pointer if V4L2_SUBDEV_FORMAT_tRY is requested.

This way we can avoid taking care of those checks inside drivers.

Janusz Krzysztofik (2):
  media: v4l2-subdev: Verify arguments of v4l2_subdev_call()
  media: v4l2-subdev: Verify pad config argument

 drivers/media/v4l2-core/v4l2-subdev.c | 234 ++++++++++++++++----------
 include/media/v4l2-subdev.h           |   6 +
 2 files changed, 151 insertions(+), 89 deletions(-)

Changelog:
v2->v3:
- add patch 2/2 with pad config check,
- adjust continuation line alignments in patch 1/2 to match those 
  used in 2/2.

v1->v2:
- replace the horrible macro with a structure of wrapper functions;
  inspired by Hans' and Sakari's comments - thanks!

-- 
2.21.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-11  9:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-11  9:53 [PATCH v3 0/2] media: v4l2-subdev: Verify arguments of v4l2_subdev_call() Janusz Krzysztofik
2019-05-11  9:53 ` [PATCH v3 1/2] " Janusz Krzysztofik
2019-05-11  9:53 ` [PATCH v3 2/2] media: v4l2-subdev: Verify pad config argument Janusz Krzysztofik

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).