From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ozlabs.org (ozlabs.org [103.22.144.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3rm38C46LnzDr5j for ; Fri, 8 Jul 2016 15:34:19 +1000 (AEST) From: Michael Ellerman To: Kees Cook , Arnd Bergmann Cc: Jan Kara , "kernel-hardening\@lists.openwall.com" , Catalin Marinas , Will Deacon , Linux-MM , sparclinux , linux-ia64@vger.kernel.org, Christoph Lameter , Andrea Arcangeli , "x86\@kernel.org" , Russell King , Dmitry Vyukov , David Rientjes , PaX Team , Mathias Krause , linux-arch , Rik van Riel , Brad Spengler , Andy Lutomirski , Andrew Morton , "linux-arm-kernel\@lists.infradead.org" , Laura Abbott , Tony Luck , Ard Biesheuvel , LKML , Fenghua Yu , Pekka Enberg , Casey Schaufler , Joonsoo Kim , "linuxppc-dev\@lists.ozlabs.org" , "David S. Miller" Subject: Re: [PATCH 1/9] mm: Hardened usercopy In-Reply-To: References: <1467843928-29351-1-git-send-email-keescook@chromium.org> <1467843928-29351-2-git-send-email-keescook@chromium.org> <3418914.byvl8Wuxlf@wuerfel> Date: Fri, 08 Jul 2016 15:34:19 +1000 Message-ID: <8760sgofqc.fsf@@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Kees Cook writes: > On Thu, Jul 7, 2016 at 4:01 AM, Arnd Bergmann wrote: >> On Wednesday, July 6, 2016 3:25:20 PM CEST 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; >> >> Should we explicitly forbid writing to rodata, or is it enough to >> rely on page protection here? > > Hm, interesting. That's a very small check to add. My knee-jerk is to > just leave it up to page protection. I'm on the fence. :) There are platforms that don't have page protection, so it would be nice if they could at least opt-in to checking for it here. cheers From mboxrd@z Thu Jan 1 00:00:00 1970 Reply-To: kernel-hardening@lists.openwall.com From: Michael Ellerman In-Reply-To: References: <1467843928-29351-1-git-send-email-keescook@chromium.org> <1467843928-29351-2-git-send-email-keescook@chromium.org> <3418914.byvl8Wuxlf@wuerfel> Date: Fri, 08 Jul 2016 15:34:19 +1000 Message-ID: <8760sgofqc.fsf@@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Subject: [kernel-hardening] Re: [PATCH 1/9] mm: Hardened usercopy To: Kees Cook , Arnd Bergmann Cc: Jan Kara , "kernel-hardening@lists.openwall.com" , Catalin Marinas , Will Deacon , Linux-MM , sparclinux , linux-ia64@vger.kernel.org, Christoph Lameter , Andrea Arcangeli , "x86@kernel.org" , Russell King , Dmitry Vyukov , David Rientjes , PaX Team , Mathias Krause , linux-arch , Rik van Riel , Brad Spengler , Andy Lutomirski , Andrew Morton , "linux-arm-kernel@lists.infradead.org" , Laura Abbott , Tony Luck , Ard Biesheuvel , LKML nel.org, Fenghua Yu , Pekka Enberg , Casey Schaufler , Joonsoo Kim , "linuxppc-dev@lists.ozlabs.org" , "David S. Miller" List-ID: Kees Cook writes: > On Thu, Jul 7, 2016 at 4:01 AM, Arnd Bergmann wrote: >> On Wednesday, July 6, 2016 3:25:20 PM CEST 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; >> >> Should we explicitly forbid writing to rodata, or is it enough to >> rely on page protection here? > > Hm, interesting. That's a very small check to add. My knee-jerk is to > just leave it up to page protection. I'm on the fence. :) There are platforms that don't have page protection, so it would be nice if they could at least opt-in to checking for it here. cheers