From: Linus Torvalds <torvalds@linux-foundation.org>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Richard Weinberger <richard@nod.at>,
Linux-Arch <linux-arch@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: VERIFY_READ/WRITE in uaccess.h?
Date: Mon, 11 May 2015 14:42:27 -0700 [thread overview]
Message-ID: <CA+55aFzF+Wo7EVSoJSaarbsQCNw5St4JH27t6vxNJivJnBQ0Sg@mail.gmail.com> (raw)
In-Reply-To: <55511989.2010407@zytor.com>
On Mon, May 11, 2015 at 2:05 PM, H. Peter Anvin <hpa@zytor.com> wrote:
> On 05/10/2015 02:44 AM, Richard Weinberger wrote:
>> Hi!
>>
>> While cleaning up UML's uaccess code I've noticed that not a single architecture
>> is using VERIFY_READ/WRITE in access_ok().
>> One exception is UML, it uses the access type in one check which is in vain anyways.
>> Also asm-generic/uaccess.h drops the type parameter silently.
>>
>> Why do we still carry it around?
>>
>> Is it because we want it for some future architecture which can benefit
>> from it or just because nobody cared enough to do a tree-wide cleanup?
>> I fear it is the latter... ;)
>>
>
> Or, perhaps, nobody noticed?
Not a future architecture. A historical one.
I think the only architecture that needed the VERIFY_READ/WRITE
distinction was the now-dropped i386, where it was used to decide if
we needed to do the manual COW because the 80386 couldn't do COW
correctly in kernel mode.
That one - for the same reasons - also checked the actual accesses,
not just that the range was in user mode. Exactly because it needed to
pre-COW the pages (even if that was then obviously racy in threaded
environments - in practice it worked, and we tried to support the
fundamentally broken i386 hardware protection model for a long time).
Linus
next prev parent reply other threads:[~2015-05-11 21:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-10 9:44 VERIFY_READ/WRITE in uaccess.h? Richard Weinberger
2015-05-11 21:05 ` H. Peter Anvin
2015-05-11 21:26 ` Richard Weinberger
2015-05-11 21:42 ` Linus Torvalds [this message]
2015-05-12 5:47 ` H. Peter Anvin
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=CA+55aFzF+Wo7EVSoJSaarbsQCNw5St4JH27t6vxNJivJnBQ0Sg@mail.gmail.com \
--to=torvalds@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=hpa@zytor.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=richard@nod.at \
/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;
as well as URLs for NNTP newsgroup(s).