[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFzeKcV5hROLJE31dNi3SEs+s6o0LL=96Kh8QGHPx=aZnA@mail.gmail.com>
Date: Sat, 8 Sep 2012 12:57:30 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Suresh Siddha <suresh.b.siddha@...el.com>
Cc: Sasha Levin <levinsasha928@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>, dwmw2@...radead.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
linux-mtd@...ts.infradead.org, linux-mm <linux-mm@...ck.org>,
Dave Jones <davej@...hat.com>
Subject: Re: mtd: kernel BUG at arch/x86/mm/pat.c:279!
On Fri, Sep 7, 2012 at 4:54 PM, Suresh Siddha <suresh.b.siddha@...el.com> wrote:
>
> Essentially the user is trying to mmap at a very large offset (from the
> oops it appears "vma->vm_pgoff << PAGE_SHIFT + start" ends up to
> "0xfffffffffffff000").
Ok, Sasha confirmed that.
> So it appears that the condition "(vma->vm_end - vma->vm_start + off) >
> len" might be false because of the wraparound? and doesn't return
> -EINVAL.
Ack.
Anyway, that means that the BUG_ON() is likely bogus, but so is the
whole calling convention.
The 4kB range starting at 0xfffffffffffff000 sounds like a *valid*
range, but that requires that we fix the calling convention to not
have that "end" (exclusive) thing. It should either be "end"
(inclusive), or just "len".
So it should either be start=0xfffffffffffff000 end=0xffffffffffffffff
or it should be start=0xfffffffffffff000 len=0x1000.
Or we need to say that we must never accept things at the end of the
64-bit range.
Whatever. Something like this (TOTALLY UNTESTED) attached patch should
get the mtdchar overflows to go away, but it does *not* fix the fact
that the MTRR start/end model is broken. It really is technically
valid to have a resource_size_t range of 0xfffffffffffff000+0x1000,
and right now it causes a BUG_ON() in pat.c.
Suresh?
Linus
Download attachment "patch.diff" of type "application/octet-stream" (2201 bytes)
Powered by blists - more mailing lists