The patch number 10920 was added via Hans Verkuil <[email protected]>
to http://linuxtv.org/hg/v4l-dvb master development tree.
Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel
If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List <[email protected]>
------
From: Hans Verkuil <[email protected]>
v4l2-ioctl: fix partial-copy code.
The code to optimize the usercopy only checked the ioctl NR field. However,
this code is also called for non-V4L2 ioctls (either private or ioctls from
linux/dvb/audio.h and linux/dvb/video.h for decoder drivers like ivtv).
If such an ioctl has the same NR as a V4L2 ioctl, then disaster strikes.
Modified the code to check on the full command ID.
Thanks to Martin Dauskardt for tracing the ivtv breakage to this particular
change.
Priority: normal
Signed-off-by: Hans Verkuil <[email protected]>
---
linux/drivers/media/video/v4l2-ioctl.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff -r 2090c454c1a9 -r 0388c2768c7f linux/drivers/media/video/v4l2-ioctl.c
--- a/linux/drivers/media/video/v4l2-ioctl.c Sat Mar 07 17:10:43 2009 +0100
+++ b/linux/drivers/media/video/v4l2-ioctl.c Sun Mar 08 14:35:23 2009 +0100
@@ -1810,11 +1810,12 @@ static unsigned long cmd_input_size(unsi
static unsigned long cmd_input_size(unsigned int cmd)
{
/* Size of structure up to and including 'field' */
-#define CMDINSIZE(cmd, type, field) case _IOC_NR(VIDIOC_##cmd): return \
- offsetof(struct v4l2_##type, field) + \
- sizeof(((struct v4l2_##type *)0)->field);
-
- switch (_IOC_NR(cmd)) {
+#define CMDINSIZE(cmd, type, field) \
+ case VIDIOC_##cmd: \
+ return offsetof(struct v4l2_##type, field) + \
+ sizeof(((struct v4l2_##type *)0)->field);
+
+ switch (cmd) {
CMDINSIZE(ENUM_FMT, fmtdesc, type);
CMDINSIZE(G_FMT, format, type);
CMDINSIZE(QUERYBUF, buffer, type);
---
Patch is available at:
http://linuxtv.org/hg/v4l-dvb/rev/0388c2768c7feab0dff9b40069e1d5dbe1d9bce4
_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits