mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luca Risolia <luca.risolia@studio.unibo.it>
To: linux-usb-devel@lists.sourceforge.net,
	viro@parcelfarce.linux.theplanet.co.uk, greg@kroah.com
Cc: rtjohnso@eecs.berkeley.edu, linux-kernel@vger.kernel.org
Subject: [linux-usb-devel] Re: Finding user/kernel pointer bugs [no html]
Date: Fri, 11 Jun 2004 06:31:07 +0200	[thread overview]
Message-ID: <20040611063107.0c62e2f8.luca.risolia@studio.unibo.it> (raw)
In-Reply-To: <E1BYXuJ-0006vd-RU@sc8-sf-list1.sourceforge.net>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>                    unsigned int cmd, void* arg)
>  {
>  	struct w9968cf_device* cam;
> +	void __user *user_arg = (void __user *)arg;

The right place to apply this patch is in video_usercopy().

When video_usercopy() is used in the ioctl() method, there is no need
to dereference the arg pointer in ioctl() itself, since one of the purposes
of video_usercopy() is to do this work for us.

Please have a look at definition of the function in videodev.c.

int
video_usercopy(struct inode *inode, struct file *file,
               unsigned int cmd, unsigned long arg,
               int (*func)(struct inode *inode, struct file *file,
                           unsigned int cmd, unsigned void *arg))

What you have patched in your patch is the function pointed
by "func" above, which should already receive the __user pointer to arg.

Luca
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFAyTWLmdpdKvzmNaQRAhDuAJ0e8okB48LQUaHnxZsSS0ZFTmuxRQCgnYqZ
WECeSegLUG5WDyUArFcByKU=
=u+vB
-----END PGP SIGNATURE-----

       reply	other threads:[~2004-06-11  4:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1BYXuJ-0006vd-RU@sc8-sf-list1.sourceforge.net>
2004-06-11  4:31 ` Luca Risolia [this message]
2004-06-11  4:52   ` viro
2004-06-11 16:17   ` Greg KH
2004-06-11 16:46     ` Luca Risolia

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=20040611063107.0c62e2f8.luca.risolia@studio.unibo.it \
    --to=luca.risolia@studio.unibo.it \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=rtjohnso@eecs.berkeley.edu \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /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®