From: Janusz Krzysztofik <jmkrzyszt@gmail.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Janusz Krzysztofik <jmkrzyszt@gmail.com>
Subject: [PATCH v4 0/2] media: v4l2-subdev: Verify arguments of v4l2_subdev_call()
Date: Sat, 11 May 2019 12:10:29 +0200 [thread overview]
Message-ID: <20190511101031.4777-1-jmkrzyszt@gmail.com> (raw)
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:
v3->v4:
- fix 'struct' keyword missing from patch 2/2,
- fix checkpatch reported style issue in patch 2/2
Sorry for that.
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
next reply other threads:[~2019-05-11 10:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-11 10:10 Janusz Krzysztofik [this message]
2019-05-11 10:10 ` [PATCH v4 1/2] " Janusz Krzysztofik
2019-05-14 11:10 ` Sakari Ailus
2019-05-14 11:12 ` Sakari Ailus
2019-05-11 10:10 ` [PATCH v4 2/2] media: v4l2-subdev: Verify pad config argument Janusz Krzysztofik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190511101031.4777-1-jmkrzyszt@gmail.com \
--to=jmkrzyszt@gmail.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®