From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752636AbdASWB2 (ORCPT ); Thu, 19 Jan 2017 17:01:28 -0500 Received: from mail-io0-f172.google.com ([209.85.223.172]:35615 "EHLO mail-io0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752207AbdASWBY (ORCPT ); Thu, 19 Jan 2017 17:01:24 -0500 MIME-Version: 1.0 In-Reply-To: <20170119105646.GA11176@leverpostej> References: <1484789346-21012-1-git-send-email-labbott@redhat.com> <1484789346-21012-2-git-send-email-labbott@redhat.com> <20170119105646.GA11176@leverpostej> From: Kees Cook Date: Thu, 19 Jan 2017 14:00:57 -0800 X-Google-Sender-Auth: V31GawHELKUvYbn3YvEOeQqiGHs Message-ID: Subject: Re: [PATCH 1/2] security: Change name of CONFIG_DEBUG_RODATA To: Mark Rutland , Michael Ellerman Cc: Laura Abbott , Jason Wessel , Jonathan Corbet , Russell King , Catalin Marinas , Will Deacon , "James E.J. Bottomley" , Helge Deller , Martin Schwidefsky , Heiko Carstens , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "x86@kernel.org" , Rob Herring , "Rafael J. Wysocki" , Len Brown , Pavel Machek , Jessica Yu , "linux-doc@vger.kernel.org" , LKML , "linux-arm-kernel@lists.infradead.org" , linux-parisc , "linux-s390@vger.kernel.org" , Linux PM list , "kernel-hardening@lists.openwall.com" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 19, 2017 at 2:56 AM, Mark Rutland wrote: > Hi Laura, > > On Wed, Jan 18, 2017 at 05:29:05PM -0800, Laura Abbott wrote: >> diff --git a/security/Kconfig b/security/Kconfig >> index 118f454..ad6ce82 100644 >> --- a/security/Kconfig >> +++ b/security/Kconfig >> @@ -158,6 +158,22 @@ config HARDENED_USERCOPY_PAGESPAN >> been removed. This config is intended to be used only while >> trying to find such users. >> >> +config ARCH_HAS_HARDENED_MAPPINGS >> + def_bool n >> + >> +config HARDENED_PAGE_MAPPINGS >> + bool "Mark kernel mappings with stricter permissions (RO/W^X)" >> + default y >> + depends on ARCH_HAS_HARDENED_MAPPINGS >> + help >> + If this is set, kernel text and rodata memory will be made read-only, >> + and non-text memory will be made non-executable. This provides >> + protection against certain security attacks (e.g. executing the heap >> + or modifying text). >> + >> + Unless your system has known restrictions or performance issues, it >> + is recommended to say Y here. > > It's somewhat unfortunate that this means the feature is no longer > mandatory on arm64 (and s390+x86). We have a boot-time switch to turn > the protections off, so I was hoping we could make this mandatory on all > architectures with support. Oh, I totally missed this. Yes, we need it to stay mandatory. It should be possible by just adding "select HARDENED_PAGE_MAPPINGS" to the arch Kconfig, yes? > It would be good to see if we could make this mandatory for arm and > parisc, or if it really needs to be optional for either of those. (Adding mpe to CC...) Michael, what's needed to get this working on powerpc too? -Kees -- Kees Cook Nexus Security