From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Ellerman Subject: Re: [PATCH 1/9] mm: Hardened usercopy Date: Fri, 08 Jul 2016 15:34:19 +1000 Message-ID: <48360.8328424909$1467956081@news.gmane.org> References: <1467843928-29351-1-git-send-email-keescook@chromium.org> <1467843928-29351-2-git-send-email-keescook@chromium.org> <3418914.byvl8Wuxlf@wuerfel> Reply-To: kernel-hardening@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Post: List-Help: List-Unsubscribe: List-Subscribe: In-Reply-To: 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.inf radead.org" , Laura Abbott , Tony List-Id: linux-mm.kvack.org 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