From: Jens Axboe <axboe@suse.de>
To: viro@parcelfarce.linux.theplanet.co.uk
Cc: Paul Mackerras <paulus@samba.org>, Jesper Juhl <juhl-lkml@dif.dk>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] remember to check return value from __copy_to_user() in cdrom_read_cdda_old()
Date: Tue, 7 Sep 2004 13:42:31 +0200 [thread overview]
Message-ID: <20040907114231.GS6323@suse.de> (raw)
In-Reply-To: <20040907104514.GT23987@parcelfarce.linux.theplanet.co.uk>
On Tue, Sep 07 2004, viro@parcelfarce.linux.theplanet.co.uk wrote:
> On Tue, Sep 07, 2004 at 12:30:31PM +0200, Jens Axboe wrote:
> > it boils down to access_ok() not being sufficient on its own, and in
> > which case yes we should just use copy_to_user() and kill the check
> > completely as per the patch sent out.
>
> access_ok() is just "we can trust MMU to do the right thing when dealing
> with access to process address space at that address". On platforms with
> secondary address spaces (e.g. sparc) it's always true. On something like
> i386 we *could* use segments for the same purposes. In fact, we used to
> do just that - access to userland memory went with %fs as segment (thus
> the names like extinct memcpy_fromfs() and surviving set_fs()). However,
> it's cheaper to do that check explicitly instead of relying on MMU. And
> that's what access_ok() does.
Alright, I'm wondering how the misconception of what access_ok() really
guarantees snuck into cdrom.c. At least the patch takes care of it.
--
Jens Axboe
next prev parent reply other threads:[~2004-09-07 11:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-06 21:46 [PATCH] remember to check return value from __copy_to_user() in cdrom_read_cdda_old() Jesper Juhl
2004-09-07 8:02 ` Jens Axboe
2004-09-07 9:32 ` Paul Mackerras
2004-09-07 9:34 ` Jens Axboe
2004-09-07 9:59 ` Andrew Morton
2004-09-07 10:09 ` Jens Axboe
2004-09-07 10:12 ` Andrew Morton
2004-09-07 10:15 ` Jens Axboe
2004-09-07 10:23 ` viro
2004-09-07 10:30 ` Jens Axboe
2004-09-07 10:45 ` viro
2004-09-07 11:42 ` Jens Axboe [this message]
2004-09-07 9:58 ` Jens Axboe
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=20040907114231.GS6323@suse.de \
--to=axboe@suse.de \
--cc=juhl-lkml@dif.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.org \
--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