Re: [PATCH v2 02/11] mm: Hardened usercopy
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: bsingharora@xxxxxxxxx, Kees Cook <keescook@xxxxxxxxxxxx>
- Subject: Re: [PATCH v2 02/11] mm: Hardened usercopy
- From: Rik van Riel <riel@xxxxxxxxxx>
- Date: Thu, 14 Jul 2016 21:04:18 -0400
- Cc: linux-kernel@xxxxxxxxxxxxxxx, Casey Schaufler <casey@xxxxxxxxxxxxxxxx>, PaX Team <pageexec@xxxxxxxxxxx>, Brad Spengler <spender@xxxxxxxxxxxxxx>, Russell King <linux@xxxxxxxxxxxxxxx>, Catalin Marinas <catalin.marinas@xxxxxxx>, Will Deacon <will.deacon@xxxxxxx>, Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx>, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Tony Luck <tony.luck@xxxxxxxxx>, Fenghua Yu <fenghua.yu@xxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, x86@xxxxxxxxxx, Christoph Lameter <cl@xxxxxxxxx>, Pekka Enberg <penberg@xxxxxxxxxx>, David Rientjes <rientjes@xxxxxxxxxx>, Joonsoo Kim <iamjoonsoo.kim@xxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Andy Lutomirski <luto@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxx>, Mathias Krause <minipli@xxxxxxxxxxxxxx>, Jan Kara <jack@xxxxxxx>, Vitaly Wool <vitalywool@xxxxxxxxx>, Andrea Arcangeli <aarcange@xxxxxxxxxx>, Dmitry Vyukov <dvyukov@xxxxxxxxxx>, Laura Abbott <labbott@xxxxxxxxxxxxxxxxx>, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx, kernel-hardening@xxxxxxxxxxxxxxxxxx
- In-reply-to: <20160714232019.GA28254@350D>
- List-id: <linux-ia64.vger.kernel.org>
- References: <1468446964-22213-1-git-send-email-keescook@chromium.org> <1468446964-22213-3-git-send-email-keescook@chromium.org> <20160714232019.GA28254@350D>
On Fri, 2016-07-15 at 09:20 +1000, Balbir Singh wrote:
> > ==
> > + ((unsigned long)end & (unsigned
> > long)PAGE_MASK)))
> > + return NULL;
> > +
> > + /* Allow if start and end are inside the same compound
> > page. */
> > + endpage = virt_to_head_page(end);
> > + if (likely(endpage == page))
> > + return NULL;
> > +
> > + /* Allow special areas, device memory, and sometimes
> > kernel data. */
> > + if (PageReserved(page) && PageReserved(endpage))
> > + return NULL;
>
> If we came here, it's likely that endpage > page, do we need to check
> that only the first and last pages are reserved? What about the ones
> in
> the middle?
I think this will be so rare, we can get away with just
checking the beginning and the end.
--
All Rights Reversed.
Attachment:
signature.asc
Description: This is a digitally signed message part
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]