All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark McClelland <mark@alpha.dyndns.org>
To: video4linux-list@redhat.com
Cc: Kernel List <linux-kernel@vger.kernel.org>, kraxel@bytesex.org
Subject: Re: [V4L] [PATCH/RFC] videodev.[ch] redesign
Date: Sat, 09 Feb 2002 19:58:44 -0800	[thread overview]
Message-ID: <3C65EFF4.2000906@alpha.dyndns.org> (raw)
In-Reply-To: <20020209194602.A23061@bytesex.org>

Gerd Knorr wrote:

>It also provides a ioctl wrapper function which handles copying the
>ioctl args from/to userspace, so we have this at one place can drop all
>the copy_from/to_user calls within the v4l device driver ioctl handlers.
>

Excellent work. I have no complaints, just a few questions:

1. Would it be better to memset the temp buffer in video_generic_ioctl() 
rather than in the driver? I've seen so many drivers forget to do this, 
and it's a potential (albeit very small) security hole.

2. In skeleton_open(), couldn't the device_data lookup code be replaced 
with:

    struct video_device *vdev = video_devdata(file);
    struct device_data *dev = vdev->priv;

3. In skeleton_initdev(), shouldn't...

    dev->vdev = skeleton_template;

...be...

    memcpy(&dev->vdev, &skeleton_template, sizeof(skeleton_template);

4. Is it safe to keep even 128 bytes on the stack in 
video_generic_ioctl()? Consider that devices might spend a relatively 
long time blocking on VIDIOCSYNC. With 32 devices in use at once, you'd 
be coming dangerously close to a stack overflow. IMHO it would be better 
to only allocate as much as MCAPTURE and SYNC need, and fall back on 
kmalloc for the less time-critical ones (if necessary).

Other than that, I extremely happy with what you've done!

-- 
Mark McClelland
mmcclell@bigfoot.com




  parent reply	other threads:[~2002-02-10  3:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-09 18:46 [PATCH/RFC] videodev.[ch] redesign Gerd Knorr
2002-02-09 20:53 ` Oliver Neukum
2002-02-09 20:53 ` Oliver Neukum
2002-02-09 20:44   ` Gerd Knorr
2002-02-10  0:32     ` Oliver Neukum
2002-02-10  8:34       ` Gerd Knorr
2002-02-10  2:03 ` [V4L] " Alan Cox
2002-02-10  8:59   ` Gerd Knorr
2002-02-11 21:10     ` [PATCH/RFC] videodev.[ch] redesign -- take #2 Gerd Knorr
2002-02-10  3:58 ` Mark McClelland [this message]
2002-02-10  9:11   ` [V4L] [PATCH/RFC] videodev.[ch] redesign Gerd Knorr
2002-02-10 12:54     ` Mark McClelland
2002-02-11  9:55       ` Gerd Knorr
2002-02-11 11:58         ` Mark McClelland

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=3C65EFF4.2000906@alpha.dyndns.org \
    --to=mark@alpha.dyndns.org \
    --cc=kraxel@bytesex.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=video4linux-list@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.