|
Message-ID: <CAGXu5j+zxyPEfswD-03TDhuzxaG6itKsoc6-15rMuE+Sz3booA@mail.gmail.com> Date: Thu, 7 Jul 2016 13:41:30 -0400 From: Kees Cook <keescook@...omium.org> To: Rik van Riel <riel@...hat.com> Cc: LKML <linux-kernel@...r.kernel.org>, Casey Schaufler <casey@...aufler-ca.com>, PaX Team <pageexec@...email.hu>, Brad Spengler <spender@...ecurity.net>, Russell King <linux@...linux.org.uk>, Catalin Marinas <catalin.marinas@....com>, Will Deacon <will.deacon@....com>, Ard Biesheuvel <ard.biesheuvel@...aro.org>, Benjamin Herrenschmidt <benh@...nel.crashing.org>, Michael Ellerman <mpe@...erman.id.au>, Tony Luck <tony.luck@...el.com>, Fenghua Yu <fenghua.yu@...el.com>, "David S. Miller" <davem@...emloft.net>, "x86@...nel.org" <x86@...nel.org>, Christoph Lameter <cl@...ux.com>, Pekka Enberg <penberg@...nel.org>, David Rientjes <rientjes@...gle.com>, Joonsoo Kim <iamjoonsoo.kim@....com>, Andrew Morton <akpm@...ux-foundation.org>, Andy Lutomirski <luto@...nel.org>, Mathias Krause <minipli@...glemail.com>, Jan Kara <jack@...e.cz>, Vitaly Wool <vitalywool@...il.com>, Andrea Arcangeli <aarcange@...hat.com>, Dmitry Vyukov <dvyukov@...gle.com>, Laura Abbott <labbott@...oraproject.org>, "linux-arm-kernel@...ts.infradead.org" <linux-arm-kernel@...ts.infradead.org>, linux-ia64@...r.kernel.org, "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>, sparclinux <sparclinux@...r.kernel.org>, linux-arch <linux-arch@...r.kernel.org>, Linux-MM <linux-mm@...ck.org>, "kernel-hardening@...ts.openwall.com" <kernel-hardening@...ts.openwall.com> Subject: Re: [PATCH 1/9] mm: Hardened usercopy On Thu, Jul 7, 2016 at 12:35 PM, Rik van Riel <riel@...hat.com> wrote: > On Wed, 2016-07-06 at 15:25 -0700, Kees Cook wrote: >> >> + /* Allow kernel rodata region (if not marked as Reserved). >> */ >> + if (ptr >= (const void *)__start_rodata && >> + end <= (const void *)__end_rodata) >> + return NULL; >> > One comment here. > > __check_object_size gets "to_user" as an argument. > > It may make sense to pass that to check_heap_object, and > only allow copy_to_user from rodata, never copy_from_user, > since that section should be read only. Well, that's two votes for this extra check, but I'm still not sure since it may already be allowed by the Reserved check, but I can reorder things to _reject_ on rodata writes before the Reserved check, etc. I'll see what could work here... -Kees > >> +void __check_object_size(const void *ptr, unsigned long n, bool >> to_user) >> +{ >> > > -- > > All Rights Reversed. -- Kees Cook Chrome OS & Brillo Security
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.