From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Add to_user_ptr()
Date: Mon, 25 Feb 2013 12:58:01 +0200 [thread overview]
Message-ID: <20130225105801.GQ4469@intel.com> (raw)
In-Reply-To: <m2zjyww1c5.fsf@firstfloor.org>
On Fri, Feb 22, 2013 at 12:16:58PM -0800, Andi Kleen wrote:
> ville.syrjala@linux.intel.com writes:
>
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > to_user_ptr() simply casts a pointer passed as u64 from user space
> > to void __user * correctly. Using this lets us get rid of all the
> > tiresome casts.
>
> The whole point of __user is to track it elsewhere to avoid mistakes,
> which may result in security bugs.
>
> A __user cast usually means your tracking is not complete, it's
> supposed to be ugly so that you fix the tracking. Prettying
> it defeats that point.
>
> How about just changing the original field to a pointer and add
> the __user there?
That would introduce 32bit vs. 64bit issues. We pass all user space
pointer as __u64 precisely to avoid such issues.
--
Ville Syrjälä
Intel OTC
prev parent reply other threads:[~2013-02-25 10:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-22 14:12 [PATCH] drm/i915: Add to_user_ptr() ville.syrjala
2013-02-22 14:29 ` Chris Wilson
2013-03-03 18:50 ` Daniel Vetter
[not found] ` <m2zjyww1c5.fsf@firstfloor.org>
2013-02-25 10:58 ` Ville Syrjälä [this message]
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=20130225105801.GQ4469@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=andi@firstfloor.org \
--cc=intel-gfx@lists.freedesktop.org \
/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