From: "H. Peter Anvin" <hpa@zytor.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andi Kleen <andi@firstfloor.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: Word-at-a-time dcache name accesses (was Re: .. anybody know of any filesystems that depend on the exact VFS 'namehash' implementation?)
Date: Fri, 02 Mar 2012 17:02:50 -0800 [thread overview]
Message-ID: <4F516DBA.2030809@zytor.com> (raw)
In-Reply-To: <CA+55aFzoOOCOU-N6Zaq8Dd+U0no0a9U5ndU-LA_TrctM5tPP2Q@mail.gmail.com>
On 03/02/2012 04:57 PM, Linus Torvalds wrote:
> On Fri, Mar 2, 2012 at 4:38 PM, H. Peter Anvin <hpa@zytor.com> wrote:
>>
>> My biggest concern is what happens when this happens to be at the end of
>> mapped kernel memory and we overrun the page?
>
> Yes. It's very unlikely, and it never happens with the dentry data
> itself (the name is always aligned for those).
>
> But it *can* happen if:
>
> - the page contains the filename we copied from user space
>
> - the page is the last page mapped
>
> - the filename is PATH_MAX in size (or very close)
>
> - the last component is sufficiently unaligned
>
> but I was thinking we'd just make sure not to free the last page, and
> just solve it that way.
>
> I was playing around with other ideas (take the page fault and fix it
> up), but those are all really complicated when the notion of "don't
> use the last page" is so much simpler.
>
Note that does mean we need a guard page after each and every
discontiguous RAM range, not just the last one. Raising that issue
since we have had serious bugs in that area in the past.
-hpa
next prev parent reply other threads:[~2012-03-03 1:03 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-02 23:46 Word-at-a-time dcache name accesses (was Re: .. anybody know of any filesystems that depend on the exact VFS 'namehash' implementation?) Linus Torvalds
2012-03-03 0:02 ` Ted Ts'o
2012-03-03 0:17 ` david
2012-03-03 0:24 ` Linus Torvalds
2012-03-04 22:19 ` Matthew Wilcox
2012-03-04 23:27 ` Linus Torvalds
2012-03-03 0:17 ` Linus Torvalds
2012-03-03 0:38 ` H. Peter Anvin
2012-03-03 0:57 ` Linus Torvalds
2012-03-03 1:02 ` H. Peter Anvin [this message]
2012-03-03 1:11 ` Linus Torvalds
2012-03-03 1:17 ` H. Peter Anvin
2012-03-03 16:12 ` Word-at-a-time dcache name accesses Andi Kleen
2012-03-03 18:47 ` H. Peter Anvin
2012-03-03 20:10 ` Word-at-a-time dcache name accesses (was Re: .. anybody know of any filesystems that depend on the exact VFS 'namehash' implementation?) Linus Torvalds
2012-03-04 2:27 ` Word-at-a-time dcache name accesses (was Re: .. anybody know ofany " Tetsuo Handa
2012-03-04 4:31 ` Andi Kleen
2012-03-05 3:58 ` Word-at-a-time dcache name accesses (was Re: .. anybody know of any " Jason Garrett-Glaser
2012-03-05 5:38 ` Linus Torvalds
2012-03-27 4:42 ` Brian Gerst
2012-03-27 5:02 ` Dave Jones
2012-03-27 5:31 ` Brian Gerst
2012-03-28 0:39 ` Linus Torvalds
2012-03-28 0:50 ` Linus Torvalds
2012-03-28 0:56 ` Brian Gerst
[not found] ` <CACvQF53YasSCUit2KoWDimgObknCz++aU90MesSfvAZTeUFQHw@mail.gmail.com>
2013-04-04 16:50 ` Lai Jiangshan
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=4F516DBA.2030809@zytor.com \
--to=hpa@zytor.com \
--cc=andi@firstfloor.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.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;
as well as URLs for NNTP newsgroup(s).