Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1573405

Re: [PATCHv2 1/2] arch: Move CONFIG_DEBUG_RODATA and CONFIG_SET_MODULE_RONX to be common

From Kees Cook <keescook@chromium.org>
Newsgroups linux.kernel
Subject Re: [PATCHv2 1/2] arch: Move CONFIG_DEBUG_RODATA and CONFIG_SET_MODULE_RONX to be common
Date 2017-02-03 20:50 +0100
Message-ID <t6S1R-698-29@gated-at.bofh.it> (permalink)
References <t6Qjo-4OT-13@gated-at.bofh.it> <t6Qjo-4OT-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Feb 3, 2017 at 9:52 AM, Laura Abbott <labbott@redhat.com> wrote:
> There are multiple architectures that support CONFIG_DEBUG_RODATA and
> CONFIG_SET_MODULE_RONX. These options also now have the ability to be
> turned off at runtime. Move these to an architecture independent
> location and make these options def_bool y for almost all of those
> arches.
>
> Signed-off-by: Laura Abbott <labbott@redhat.com>
> ---
> v2: This patch is now doing just the refactor of the existing config options.
> ---
>  arch/Kconfig              | 28 ++++++++++++++++++++++++++++
>  arch/arm/Kconfig          |  3 +++
>  arch/arm/Kconfig.debug    | 11 -----------
>  arch/arm/mm/Kconfig       | 12 ------------
>  arch/arm64/Kconfig        |  5 ++---
>  arch/arm64/Kconfig.debug  | 11 -----------
>  arch/parisc/Kconfig       |  1 +
>  arch/parisc/Kconfig.debug | 11 -----------
>  arch/s390/Kconfig         |  5 ++---
>  arch/s390/Kconfig.debug   |  3 ---
>  arch/x86/Kconfig          |  5 ++---
>  arch/x86/Kconfig.debug    | 11 -----------
>  12 files changed, 38 insertions(+), 68 deletions(-)
>
> diff --git a/arch/Kconfig b/arch/Kconfig
> index 99839c2..22ee01e 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -781,4 +781,32 @@ config VMAP_STACK
>           the stack to map directly to the KASAN shadow map using a formula
>           that is incorrect if the stack is in vmalloc space.
>
> +config ARCH_NO_STRICT_RWX_DEFAULTS
> +       def_bool n
> +
> +config ARCH_HAS_STRICT_KERNEL_RWX
> +       def_bool n
> +
> +config DEBUG_RODATA
> +       def_bool y if !ARCH_NO_STRICT_RWX_DEFAULTS
> +       prompt "Make kernel text and rodata read-only" if ARCH_NO_STRICT_RWX_DEFAULTS

Ah! Yes, perfect. I totally forgot about using conditional "prompt" lines. Nice!

Acked-by: Kees Cook <keescook@chromium.org>

-Kees

-- 
Kees Cook
Pixel Security

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCHv2 1/2] arch: Move CONFIG_DEBUG_RODATA and CONFIG_SET_MODULE_RONX to be common Laura Abbott <labbott@redhat.com> - 2017-02-03 19:00 +0100
  Re: [PATCHv2 1/2] arch: Move CONFIG_DEBUG_RODATA and  CONFIG_SET_MODULE_RONX to be common Mark Rutland <mark.rutland@arm.com> - 2017-02-03 19:20 +0100
  Re: [PATCHv2 1/2] arch: Move CONFIG_DEBUG_RODATA and  CONFIG_SET_MODULE_RONX to be common Kees Cook <keescook@chromium.org> - 2017-02-03 20:50 +0100
    Re: [PATCHv2 1/2] arch: Move CONFIG_DEBUG_RODATA and  CONFIG_SET_MODULE_RONX to be common Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-02-03 21:40 +0100
      Re: [PATCHv2 1/2] arch: Move CONFIG_DEBUG_RODATA and  CONFIG_SET_MODULE_RONX to be common Kees Cook <keescook@chromium.org> - 2017-02-03 22:10 +0100
        Re: [PATCHv2 1/2] arch: Move CONFIG_DEBUG_RODATA and  CONFIG_SET_MODULE_RONX to be common Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-02-03 23:30 +0100
          Re: [PATCHv2 1/2] arch: Move CONFIG_DEBUG_RODATA and  CONFIG_SET_MODULE_RONX to be common Kees Cook <keescook@chromium.org> - 2017-02-04 00:10 +0100
        Re: [PATCHv2 1/2] arch: Move CONFIG_DEBUG_RODATA and  CONFIG_SET_MODULE_RONX to be common Laura Abbott <labbott@redhat.com> - 2017-02-06 19:50 +0100
          Re: [PATCHv2 1/2] arch: Move CONFIG_DEBUG_RODATA and  CONFIG_SET_MODULE_RONX to be common Pavel Machek <pavel@ucw.cz> - 2017-02-07 08:40 +0100

csiph-web