Skip to contentSkip to conversation

Kconfig: Make STRICT_DEVMEM default-y on x86 and arm64

PATCH Applied Kees Cook 5 participants 6 messages Dec 1, 2017 – Dec 19, 2017 Library code

lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 Kconfig: Make STRICT_DEVMEM default-y on x86 and arm64

Distros have been shipping with CONFIG_STRICT_DEVMEM=y for years now. It is probably time to flip this default for x86 and arm64.

---
 lib/Kconfig.debug | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig.debug +1 -1
index 947d3e2ed5c2..39b123d04a36 100644
@@ -1985,7 +1985,7 @@ config STRICT_DEVMEM
 	bool "Filter access to /dev/mem"
 	depends on MMU && DEVMEM
 	depends on ARCH_HAS_DEVMEM_IS_ALLOWED
-	default y if TILE || PPC
+	default y if TILE || PPC || X86 || ARM64
 	---help---
 	  If this option is disabled, you allow userspace (root) access to all
 	  of memory, including kernel and userspace memory. Accidental
Signature · 6 lines
2.7.4


-- 
Kees Cook
Pixel Security
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Kees Cook

Distros have been shipping with CONFIG_STRICT_DEVMEM=y for years now. It is probably time to flip this default for x86 and arm64.

With my Fedora hat on,

Quoted 19 lines
---
  lib/Kconfig.debug | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig.debug +1 -1
index 947d3e2ed5c2..39b123d04a36 100644
@@ -1985,7 +1985,7 @@ config STRICT_DEVMEM
  	bool "Filter access to /dev/mem"
  	depends on MMU && DEVMEM
  	depends on ARCH_HAS_DEVMEM_IS_ALLOWED
-	default y if TILE || PPC
+	default y if TILE || PPC || X86 || ARM64
  	---help---
  	  If this option is disabled, you allow userspace (root) access to all
  	  of memory, including kernel and userspace memory. Accidental
#2 lore raw
In reply to Kees Cook
Quoted 2 lines · Kees Cook

Distros have been shipping with CONFIG_STRICT_DEVMEM=y for years now. It is probably time to flip this default for x86 and arm64.

Should we be defaulting IO_STRICT_DEVMEM on as well?

Will

Quoted 25 lines
---
 lib/Kconfig.debug | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig.debug +1 -1
index 947d3e2ed5c2..39b123d04a36 100644
@@ -1985,7 +1985,7 @@ config STRICT_DEVMEM
 	bool "Filter access to /dev/mem"
 	depends on MMU && DEVMEM
 	depends on ARCH_HAS_DEVMEM_IS_ALLOWED
-	default y if TILE || PPC
+	default y if TILE || PPC || X86 || ARM64
 	---help---
 	  If this option is disabled, you allow userspace (root) access to all
 	  of memory, including kernel and userspace memory. Accidental
Signature · 6 lines
2.7.4


-- 
Kees Cook
Pixel Security
author
#3 lore raw
Quoted 5 lines · Will Deacon
Quoted 2 lines · Kees Cook

Distros have been shipping with CONFIG_STRICT_DEVMEM=y for years now. It is probably time to flip this default for x86 and arm64.

Should we be defaulting IO_STRICT_DEVMEM on as well?

I'd love to see that, but I haven't seen a long history on this setting yet. It may be that arm64 can do it, since it doesn't have the x86 hardware legacy stuff ... If you're willing to give it a shot, I'm all for it. :)

-Kees

Quoted 28 lines

Will

Quoted 25 lines
---
 lib/Kconfig.debug | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig.debug +1 -2
index 947d3e2ed5c2..39b123d04a36 100644
@@ -1985,7 +1985,7 @@ config STRICT_DEVMEM
      bool "Filter access to /dev/mem"
      depends on MMU && DEVMEM
      depends on ARCH_HAS_DEVMEM_IS_ALLOWED
-     default y if TILE || PPC
+     default y if TILE || PPC || X86 || ARM64
      ---help---
        If this option is disabled, you allow userspace (root) access to all
        of memory, including kernel and userspace memory. Accidental
--

2.7.4

--
Kees Cook
Pixel Security

Signature · 2 lines
Kees Cook
Pixel Security
#4 lore raw
In reply to Kees Cook
Kconfig: Make STRICT_DEVMEM default-y on x86 and arm64
Commit-ID:  0f7cda2b824bb2afe0d75716a8664117fa03f5e0
Gitweb:     https://git.kernel.org/tip/0f7cda2b824bb2afe0d75716a8664117fa03f5e0
Author:     Kees Cook <[email protected]>
AuthorDate: Fri, 1 Dec 2017 12:10:00 -0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 11 Dec 2017 18:41:26 +0100

Kconfig: Make STRICT_DEVMEM default-y on x86 and arm64

Distros have been shipping with CONFIG_STRICT_DEVMEM=y for years now. It is probably time to flip this default for x86 and arm64.

---
 lib/Kconfig.debug | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig.debug +1 -1
index 947d3e2..39b123d 100644
@@ -1985,7 +1985,7 @@ config STRICT_DEVMEM
 	bool "Filter access to /dev/mem"
 	depends on MMU && DEVMEM
 	depends on ARCH_HAS_DEVMEM_IS_ALLOWED
-	default y if TILE || PPC
+	default y if TILE || PPC || X86 || ARM64
 	---help---
 	  If this option is disabled, you allow userspace (root) access to all
 	  of memory, including kernel and userspace memory. Accidental
Acked-by on v1 1/1
#5 lore raw
In reply to Kees Cook
Quoted 4 lines · Kees Cook

Distros have been shipping with CONFIG_STRICT_DEVMEM=y for years now. It is probably time to flip this default for x86 and arm64.

Quoted 24 lines
---
 lib/Kconfig.debug | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig.debug +1 -2
index 947d3e2ed5c2..39b123d04a36 100644
@@ -1985,7 +1985,7 @@ config STRICT_DEVMEM
        bool "Filter access to /dev/mem"
        depends on MMU && DEVMEM
        depends on ARCH_HAS_DEVMEM_IS_ALLOWED
-       default y if TILE || PPC
+       default y if TILE || PPC || X86 || ARM64
        ---help---
          If this option is disabled, you allow userspace (root) access to all
          of memory, including kernel and userspace memory. Accidental
--

2.7.4

--
Kees Cook
Pixel Security