]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
arch: consolidate CONFIG_STRICT_DEVM in lib/Kconfig.debug
authorDan Williams <dan.j.williams@intel.com>
Fri, 20 Nov 2015 02:19:29 +0000 (18:19 -0800)
committerDan Duval <dan.duval@oracle.com>
Wed, 7 Dec 2016 17:25:35 +0000 (12:25 -0500)
Orabug: 22913653

Let all the archs that implement devmem_is_allowed() opt-in to a common
definition of CONFIG_STRICT_DEVM in lib/Kconfig.debug.

Cc: Kees Cook <keescook@chromium.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "David S. Miller" <davem@davemloft.net>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
[heiko: drop 'default y' for s390]
Acked-by: Ingo Molnar <mingo@redhat.com>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
(cherry picked from commit 21266be9ed542f13436bd9c75316d43e1e84f6ae)

Conflicts:

arch/powerpc/Kconfig
arch/x86/Kconfig

16 files changed:
arch/arm/Kconfig
arch/arm/Kconfig.debug
arch/arm64/Kconfig
arch/arm64/Kconfig.debug
arch/frv/Kconfig
arch/m32r/Kconfig
arch/powerpc/Kconfig
arch/powerpc/Kconfig.debug
arch/s390/Kconfig
arch/s390/Kconfig.debug
arch/tile/Kconfig
arch/unicore32/Kconfig
arch/unicore32/Kconfig.debug
arch/x86/Kconfig
arch/x86/Kconfig.debug
lib/Kconfig.debug

index 19f4cc634b0e8ecd3469defaaedee1b1a5a19463..71628d944eb69f436bfc94dc4217ab8667172bf4 100644 (file)
@@ -2,6 +2,7 @@ config ARM
        bool
        default y
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
+       select ARCH_HAS_DEVMEM_IS_ALLOWED
        select ARCH_HAS_ELF_RANDOMIZE
        select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
        select ARCH_HAVE_CUSTOM_GPIO_H
index 0c12ffb155a23c604c9bbb9b849a913d359e34ae..f8e110a5900ad57e1ae25e7900cc81eb3181d749 100644 (file)
@@ -14,20 +14,6 @@ config ARM_PTDUMP
          kernel.
          If in doubt, say "N"
 
-config STRICT_DEVMEM
-       bool "Filter access to /dev/mem"
-       depends on MMU
-       ---help---
-         If this option is disabled, you allow userspace (root) access to all
-         of memory, including kernel and userspace memory. Accidental
-         access to this is obviously disastrous, but specific access can
-         be used by people debugging the kernel.
-
-         If this option is switched on, the /dev/mem file only allows
-         userspace access to memory mapped peripherals.
-
-          If in doubt, say Y.
-
 # RMK wants arm kernels compiled with frame pointers or stack unwinding.
 # If you know what you are doing and are willing to live without stack
 # traces, you can get a slightly smaller kernel by setting this option to
index 6f0a3b41b0090367d79c24ac7a93cb5dbf2ed269..9c963ac47265afda32d85ba7a3aaaedc340aa8c1 100644 (file)
@@ -2,6 +2,7 @@ config ARM64
        def_bool y
        select ACPI_GENERIC_GSI if ACPI
        select ACPI_REDUCED_HARDWARE_ONLY if ACPI
+       select ARCH_HAS_DEVMEM_IS_ALLOWED
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select ARCH_HAS_ELF_RANDOMIZE
        select ARCH_HAS_GCOV_PROFILE_ALL
index d6285ef9b5f976639630606b04d7244a05ac6130..f4ff69f3288bc207fa347f109b5a21788e19048f 100644 (file)
@@ -18,20 +18,6 @@ config ARM64_PTDUMP
          kernel.
          If in doubt, say "N"
 
-config STRICT_DEVMEM
-       bool "Filter access to /dev/mem"
-       depends on MMU
-       help
-         If this option is disabled, you allow userspace (root) access to all
-         of memory, including kernel and userspace memory. Accidental
-         access to this is obviously disastrous, but specific access can
-         be used by people debugging the kernel.
-
-         If this option is switched on, the /dev/mem file only allows
-         userspace access to memory mapped peripherals.
-
-         If in doubt, say Y.
-
 config PID_IN_CONTEXTIDR
        bool "Write the current PID to the CONTEXTIDR register"
        help
index 34aa19352dc1ab87cc2cf11f38e1161dc547a518..03bfd6bf03e7a28c5b31a1b6f51b47e5471596a9 100644 (file)
@@ -10,6 +10,7 @@ config FRV
        select HAVE_DEBUG_BUGVERBOSE
        select ARCH_HAVE_NMI_SAFE_CMPXCHG
        select GENERIC_CPU_DEVICES
+       select ARCH_HAS_DEVMEM_IS_ALLOWED
        select ARCH_WANT_IPC_PARSE_VERSION
        select OLD_SIGSUSPEND3
        select OLD_SIGACTION
index 9e44bbd8051ed1387a45eb4fca0b3f4aa49a3bf0..836ac5a963c83140d18dcd762459d19e1fd0c101 100644 (file)
@@ -13,6 +13,7 @@ config M32R
        select GENERIC_IRQ_PROBE
        select GENERIC_IRQ_SHOW
        select GENERIC_ATOMIC64
+       select ARCH_HAS_DEVMEM_IS_ALLOWED
        select ARCH_USES_GETTIMEOFFSET
        select MODULES_USE_ELF_RELA
        select HAVE_DEBUG_STACKOVERFLOW
index 190cc48abc0cc683b8d53e9f8460d67cbe93c671..09942b1ce1ed779eaca5059a509c126a49312129 100644 (file)
@@ -153,6 +153,11 @@ config PPC
        select NO_BOOTMEM
        select HAVE_GENERIC_RCU_GUP
        select HAVE_PERF_EVENTS_NMI if PPC64
+       select EDAC_SUPPORT
+       select EDAC_ATOMIC_SCRUB
+       select ARCH_HAS_DMA_SET_COHERENT_MASK
+       select ARCH_HAS_DEVMEM_IS_ALLOWED
+       select HAVE_ARCH_SECCOMP_FILTER
 
 config GENERIC_CSUM
        def_bool CPU_LITTLE_ENDIAN
index 0efa8f90a8f1055f040c9a62360c97d4aa4253e0..3232ec4de5ab357e9b1f94986c4344bca9bc27de 100644 (file)
@@ -327,18 +327,6 @@ config PPC_EARLY_DEBUG_CPM_ADDR
          platform probing is done, all platforms selected must
          share the same address.
 
-config STRICT_DEVMEM
-       def_bool y
-       prompt "Filter access to /dev/mem"
-       help
-         This option restricts access to /dev/mem.  If this option is
-         disabled, you allow userspace access to all memory, including
-         kernel and userspace memory. Accidental memory access is likely
-         to be disastrous.
-         Memory access is required for experts who want to debug the kernel.
-
-         If you are unsure, say Y.
-
 config FAIL_IOMMU
        bool "Fault-injection capability for IOMMU"
        depends on FAULT_INJECTION
index b06dc383926846c73e85a6c635ff0fac0a3ddcab..a1b251a330449912abe3f5dd584bb4e62711e491 100644 (file)
@@ -65,6 +65,7 @@ config S390
        def_bool y
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
+       select ARCH_HAS_DEVMEM_IS_ALLOWED
        select ARCH_HAS_ELF_RANDOMIZE
        select ARCH_HAS_GCOV_PROFILE_ALL
        select ARCH_HAS_SG_CHAIN
index c56878e1245fb4c4e75425f6e87ddd86457d5da1..26c5d5beb4bebd2e060654d2d9d6e480f7f5da34 100644 (file)
@@ -5,18 +5,6 @@ config TRACE_IRQFLAGS_SUPPORT
 
 source "lib/Kconfig.debug"
 
-config STRICT_DEVMEM
-       def_bool y
-       prompt "Filter access to /dev/mem"
-       ---help---
-         This option restricts access to /dev/mem.  If this option is
-         disabled, you allow userspace access to all memory, including
-         kernel and userspace memory. Accidental memory access is likely
-         to be disastrous.
-         Memory access is required for experts who want to debug the kernel.
-
-         If you are unsure, say Y.
-
 config S390_PTDUMP
        bool "Export kernel pagetable layout to userspace via debugfs"
        depends on DEBUG_KERNEL
index a07e31b50d3f783e92ee1ccfab11293308d40472..7b6e88c9601d1b52405f9cdc3fe3edc883eba7b0 100644 (file)
@@ -19,6 +19,7 @@ config TILE
        select VIRT_TO_BUS
        select SYS_HYPERVISOR
        select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
+       select ARCH_HAS_DEVMEM_IS_ALLOWED
        select ARCH_HAVE_NMI_SAFE_CMPXCHG
        select GENERIC_CLOCKEVENTS
        select MODULES_USE_ELF_RELA
@@ -111,9 +112,6 @@ config ARCH_DISCONTIGMEM_DEFAULT
 config TRACE_IRQFLAGS_SUPPORT
        def_bool y
 
-config STRICT_DEVMEM
-       def_bool y
-
 # SMP is required for Tilera Linux.
 config SMP
        def_bool y
index 928237a7b9cada873486bcb0e9d0ff909e19d153..4d607a07ec8d003293700594c55a90a40ee4d713 100644 (file)
@@ -1,5 +1,6 @@
 config UNICORE32
        def_bool y
+       select ARCH_HAS_DEVMEM_IS_ALLOWED
        select ARCH_MIGHT_HAVE_PC_PARPORT
        select ARCH_MIGHT_HAVE_PC_SERIO
        select HAVE_MEMBLOCK
index 1a36262398435ff9f9f224cab74da1a3d2bb0233..f075bbe1d46f4ec1084f40ddd68396c39515e5ff 100644 (file)
@@ -2,20 +2,6 @@ menu "Kernel hacking"
 
 source "lib/Kconfig.debug"
 
-config STRICT_DEVMEM
-       bool "Filter access to /dev/mem"
-       depends on MMU
-       ---help---
-         If this option is disabled, you allow userspace (root) access to all
-         of memory, including kernel and userspace memory. Accidental
-         access to this is obviously disastrous, but specific access can
-         be used by people debugging the kernel.
-
-         If this option is switched on, the /dev/mem file only allows
-         userspace access to memory mapped peripherals.
-
-          If in doubt, say Y.
-
 config EARLY_PRINTK
        def_bool DEBUG_OCD
        help
index c01f1d1377c19275a1cff90e89e1078ac8054e1b..98a21e4cf50d17bf1eabef0597315f7319550255 100644 (file)
@@ -25,6 +25,8 @@ config X86
        select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
        select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI
        select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
+       select ARCH_HAS_DEVMEM_IS_ALLOWED
+       select ARCH_HAS_ELF_RANDOMIZE
        select ARCH_HAS_FAST_MULTIPLIER
        select ARCH_HAS_GCOV_PROFILE_ALL
        select ARCH_HAS_PMEM_API                if X86_64
index 72484a645f056d1d7a8aa4182b07fc908c3b4162..7ba902d7013abc51331d3128e2a85ebc7ee09940 100644 (file)
@@ -5,23 +5,6 @@ config TRACE_IRQFLAGS_SUPPORT
 
 source "lib/Kconfig.debug"
 
-config STRICT_DEVMEM
-       bool "Filter access to /dev/mem"
-       ---help---
-         If this option is disabled, you allow userspace (root) access to all
-         of memory, including kernel and userspace memory. Accidental
-         access to this is obviously disastrous, but specific access can
-         be used by people debugging the kernel. Note that with PAT support
-         enabled, even in this case there are restrictions on /dev/mem
-         use due to the cache aliasing requirements.
-
-         If this option is switched on, the /dev/mem file only allows
-         userspace access to PCI space and the BIOS code and data regions.
-         This is sufficient for dosemu and X and all common users of
-         /dev/mem.
-
-         If in doubt, say Y.
-
 config X86_VERBOSE_BOOTUP
        bool "Enable verbose x86 bootup info messages"
        default y
index ba2b0c87e65b196c7c1f016798e0b59ea8dba97c..af7bec643ae41bda50b7f84773abada21e5b8ea2 100644 (file)
@@ -1777,3 +1777,25 @@ source "samples/Kconfig"
 
 source "lib/Kconfig.kgdb"
 
+config ARCH_HAS_DEVMEM_IS_ALLOWED
+       bool
+
+config STRICT_DEVMEM
+       bool "Filter access to /dev/mem"
+       depends on MMU
+       depends on ARCH_HAS_DEVMEM_IS_ALLOWED
+       default y if TILE || PPC
+       ---help---
+         If this option is disabled, you allow userspace (root) access to all
+         of memory, including kernel and userspace memory. Accidental
+         access to this is obviously disastrous, but specific access can
+         be used by people debugging the kernel. Note that with PAT support
+         enabled, even in this case there are restrictions on /dev/mem
+         use due to the cache aliasing requirements.
+
+         If this option is switched on, the /dev/mem file only allows
+         userspace access to PCI space and the BIOS code and data regions.
+         This is sufficient for dosemu and X and all common users of
+         /dev/mem.
+
+         If in doubt, say Y.