|
Date: Thu, 7 Jul 2016 13:19:26 -0400 From: Kees Cook <keescook@...omium.org> To: Mark Rutland <mark.rutland@....com> Cc: LKML <linux-kernel@...r.kernel.org>, Jan Kara <jack@...e.cz>, "kernel-hardening@...ts.openwall.com" <kernel-hardening@...ts.openwall.com>, Catalin Marinas <catalin.marinas@....com>, Will Deacon <will.deacon@....com>, Linux-MM <linux-mm@...ck.org>, sparclinux <sparclinux@...r.kernel.org>, linux-ia64@...r.kernel.org, Christoph Lameter <cl@...ux.com>, Andrea Arcangeli <aarcange@...hat.com>, linux-arch <linux-arch@...r.kernel.org>, Michael Ellerman <mpe@...erman.id.au>, "x86@...nel.org" <x86@...nel.org>, Russell King <linux@...linux.org.uk>, "linux-arm-kernel@...ts.infradead.org" <linux-arm-kernel@...ts.infradead.org>, Benjamin Herrenschmidt <benh@...nel.crashing.org>, PaX Team <pageexec@...email.hu>, Borislav Petkov <bp@...e.de>, Mathias Krause <minipli@...glemail.com>, Fenghua Yu <fenghua.yu@...el.com>, Rik van Riel <riel@...hat.com>, Vitaly Wool <vitalywool@...il.com>, David Rientjes <rientjes@...gle.com>, Tony Luck <tony.luck@...el.com>, Andy Lutomirski <luto@...nel.org>, Joonsoo Kim <iamjoonsoo.kim@....com>, Dmitry Vyukov <dvyukov@...gle.com>, Laura Abbott <labbott@...oraproject.org>, Brad Spengler <spender@...ecurity.net>, Ard Biesheuvel <ard.biesheuvel@...aro.org>, Pekka Enberg <penberg@...nel.org>, Casey Schaufler <casey@...aufler-ca.com>, Andrew Morton <akpm@...ux-foundation.org>, "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>, "David S. Miller" <davem@...emloft.net> Subject: Re: [PATCH 4/9] arm64/uaccess: Enable hardened usercopy On Thu, Jul 7, 2016 at 6:07 AM, Mark Rutland <mark.rutland@....com> wrote: > Hi, > > On Wed, Jul 06, 2016 at 03:25:23PM -0700, Kees Cook wrote: >> Enables CONFIG_HARDENED_USERCOPY checks on arm64. As done by KASAN in -next, >> renames the low-level functions to __arch_copy_*_user() so a static inline >> can do additional work before the copy. > > The checks themselves look fine, but as with the KASAN checks, it seems > a shame that this logic is duplicated per arch, integrated in subtly > different ways. > > Can we not __arch prefix all the arch uaccess helpers, and place > kasan_check_*() and check_object_size() calls in generic wrappers? > > If we're going to update all the arch uaccess helpers anyway, doing that > would make it easier to fix things up, or to add new checks in future. Yeah, I totally agree, and my work on the next step of this hardening will require something like this to separate the "check" logic from the "copy" logic, as I want to introduce a set of constant-sized copy_*_user helpers. Though currently x86 poses a weird problem in this regard (they have separate code paths for copy_* and __copy*, but I think it's actually a harmless(?) mistake. For now, I'd like to leave this as-is, and then do the copy_* cleanup, then do step 2 (slab whitelisting). -Kees -- 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.