public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Hancock <hancockr@shaw.ca>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Rodolfo Giometti <giometti@enneenne.com>,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] LinuxPPS (with new syscalls API)
Date: Tue, 26 Jun 2007 17:33:28 -0600	[thread overview]
Message-ID: <4681A248.6070109@shaw.ca> (raw)
In-Reply-To: <fa.RLNIoDXtVxFnlYMPJh2Q2+yDDOk@ifi.uio.no>

David Woodhouse wrote:
> On Tue, 2007-06-26 at 19:06 +0200, Rodolfo Giometti wrote:
>> On Tue, Jun 26, 2007 at 11:57:07AM +0100, David Woodhouse wrote:
>>> Your syscalls blindly dereference userspace pointers instead of using
>>> copy_{to,from} user.
>> I use access_ok() to test userspace addresses. It should be ok,
>> shouldn't it?
> 
> No; it's racy. You must use copy_from_user() and copy_to_user().

Not only is it racy, but it doesn't even do all of the checks that 
copy_to/from_user does. access_ok only validates that the region given 
is potentially valid, not that it actually is. Using access_ok only 
allows you to use __copy_to/from_user instead, which skips the same 
checks that access_ok does - not worth it unless you do repeated copies 
to/from the same region of memory.

-- 
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/


       reply	other threads:[~2007-06-26 23:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fa.KzVWiacZsGdGiMxLldFOOPOdIEw@ifi.uio.no>
     [not found] ` <fa.TdDfr0FpGG8OjqtqWj6RNRusuU0@ifi.uio.no>
     [not found]   ` <fa.qT2j8q7/hQ2xVpeJCg7VGv+FvpI@ifi.uio.no>
     [not found]     ` <fa.RLNIoDXtVxFnlYMPJh2Q2+yDDOk@ifi.uio.no>
2007-06-26 23:33       ` Robert Hancock [this message]
2007-06-26 10:06 [PATCH] LinuxPPS (with new syscalls API) Rodolfo Giometti
2007-06-26 10:57 ` David Woodhouse
2007-06-26 17:06   ` Rodolfo Giometti
2007-06-26 17:38     ` David Woodhouse
2007-06-26 18:13       ` Rodolfo Giometti
2007-06-26 18:20         ` David Woodhouse
2007-06-27 10:14       ` Rodolfo Giometti
2007-06-27 10:18         ` David Woodhouse
2007-06-27 12:58           ` Rodolfo Giometti
2007-06-27 16:11             ` David Woodhouse
2007-06-27 17:45               ` Rodolfo Giometti
2007-06-27 17:49                 ` David Woodhouse
2007-06-27 22:46                   ` Rodolfo Giometti
2007-06-28  8:08                     ` David Woodhouse
2007-06-28  8:15                       ` Rodolfo Giometti
2007-06-28  8:31                         ` David Woodhouse
2007-06-28  8:40                           ` Rodolfo Giometti
2007-06-28 11:44                             ` David Woodhouse
2007-06-28 14:15                               ` Rodolfo Giometti

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=4681A248.6070109@shaw.ca \
    --to=hancockr@shaw.ca \
    --cc=akpm@linux-foundation.org \
    --cc=dwmw2@infradead.org \
    --cc=giometti@enneenne.com \
    --cc=linux-kernel@vger.kernel.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