[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4F516DBA.2030809@zytor.com>
Date: Fri, 02 Mar 2012 17:02:50 -0800
From: "H. Peter Anvin" <hpa@...or.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
CC: Andi Kleen <andi@...stfloor.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Al Viro <viro@...iv.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?)
On 03/02/2012 04:57 PM, Linus Torvalds wrote:
> On Fri, Mar 2, 2012 at 4:38 PM, H. Peter Anvin <hpa@...or.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists