Skip to contentSkip to conversation

powerpc: Default to enabling STRICT_KERNEL_RWX

PATCH Superseded Kees Cook 2 participants 5 messages Oct 5, 2017 PowerPC

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 powerpc: Default to enabling STRICT_KERNEL_RWX

When available, CONFIG_KERNEL_RWX should be default-enabled.

Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Michael Ellerman <[email protected]>
---
 arch/powerpc/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/Kconfig +1 -0
index 809c468edab1..9a549bbfc278 100644
@@ -178,6 +178,7 @@ config PPC
 	select HAVE_ARCH_TRACEHOOK
 	select ARCH_HAS_STRICT_KERNEL_RWX	if ((PPC_BOOK3S_64 || PPC32) && !RELOCATABLE && !HIBERNATION)
 	select ARCH_OPTIONAL_KERNEL_RWX		if ARCH_HAS_STRICT_KERNEL_RWX
+	select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
 	select HAVE_CBPF_JIT			if !PPC64
 	select HAVE_CONTEXT_TRACKING		if PPC64
 	select HAVE_DEBUG_KMEMLEAK
Signature · 6 lines
2.7.4


-- 
Kees Cook
Pixel Security
#1 lore raw

Le 05/10/2017 à 05:45, Kees Cook a écrit :

Quoted 1 line

When available, CONFIG_KERNEL_RWX should be default-enabled.

On PPC32, this option implies deactivating BATs and/or LTLB mapping of the linear kernel address space, hence a significant performance degradation.

So at least on PPC32, it should remain unselected by default.

Christophe

Quoted 23 lines
Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Michael Ellerman <[email protected]>
---
  arch/powerpc/Kconfig | 1 +
  1 file changed, 1 insertion(+)
arch/powerpc/Kconfig +1 -0
index 809c468edab1..9a549bbfc278 100644
@@ -178,6 +178,7 @@ config PPC
  	select HAVE_ARCH_TRACEHOOK
  	select ARCH_HAS_STRICT_KERNEL_RWX	if ((PPC_BOOK3S_64 || PPC32) && !RELOCATABLE && !HIBERNATION)
  	select ARCH_OPTIONAL_KERNEL_RWX		if ARCH_HAS_STRICT_KERNEL_RWX
+	select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
  	select HAVE_CBPF_JIT			if !PPC64
  	select HAVE_CONTEXT_TRACKING		if PPC64
  	select HAVE_DEBUG_KMEMLEAK
author
#2 lore raw
Quoted 11 lines · Christophe LEROY
Quoted 2 lines · Kees Cook

When available, CONFIG_KERNEL_RWX should be default-enabled.

On PPC32, this option implies deactivating BATs and/or LTLB mapping of the linear kernel address space, hence a significant performance degradation.

So at least on PPC32, it should remain unselected by default.

Alright, sounds fine to me. Would this be okay?

+ select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if !PPC64

-Kees

Quoted 30 lines

Christophe

Quoted 25 lines
Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Michael Ellerman <[email protected]>
---
  arch/powerpc/Kconfig | 1 +
  1 file changed, 1 insertion(+)
arch/powerpc/Kconfig +0 -0
index 809c468edab1..9a549bbfc278 100644
@@ -178,6 +178,7 @@ config PPC
        select HAVE_ARCH_TRACEHOOK
        select ARCH_HAS_STRICT_KERNEL_RWX       if ((PPC_BOOK3S_64 ||
 PPC32) && !RELOCATABLE && !HIBERNATION)
        select ARCH_OPTIONAL_KERNEL_RWX         if

ARCH_HAS_STRICT_KERNEL_RWX
+ select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
select HAVE_CBPF_JIT if !PPC64
select HAVE_CONTEXT_TRACKING if PPC64
select HAVE_DEBUG_KMEMLEAK

Signature · 2 lines
Kees Cook
Pixel Security
#3 lore raw

Le 05/10/2017 à 19:30, Kees Cook a écrit :

Quoted 9 lines
Quoted 7 lines · Christophe LEROY
Quoted 2 lines · Kees Cook

When available, CONFIG_KERNEL_RWX should be default-enabled.

Quoted 8 lines
Quoted 4 lines

On PPC32, this option implies deactivating BATs and/or LTLB mapping of the linear kernel address space, hence a significant performance degradation.

So at least on PPC32, it should remain unselected by default.

Alright, sounds fine to me. Would this be okay?

+ select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if !PPC64

You mean

select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if PPC64

Don't you ?

Christophe

Quoted 36 lines

-Kees

Quoted 30 lines

Christophe

Quoted 25 lines
Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Michael Ellerman <[email protected]>
---
   arch/powerpc/Kconfig | 1 +
   1 file changed, 1 insertion(+)
arch/powerpc/Kconfig +0 -0
index 809c468edab1..9a549bbfc278 100644
@@ -178,6 +178,7 @@ config PPC
         select HAVE_ARCH_TRACEHOOK
         select ARCH_HAS_STRICT_KERNEL_RWX       if ((PPC_BOOK3S_64 ||
 PPC32) && !RELOCATABLE && !HIBERNATION)
         select ARCH_OPTIONAL_KERNEL_RWX         if

ARCH_HAS_STRICT_KERNEL_RWX
+ select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
select HAVE_CBPF_JIT if !PPC64
select HAVE_CONTEXT_TRACKING if PPC64
select HAVE_DEBUG_KMEMLEAK

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

author
#4 lore raw
Quoted 19 lines · christophe leroy

Le 05/10/2017 =C3=A0 19:30, Kees Cook a =C3=A9crit :

Quoted 16 lines
Quoted 13 lines · Christophe LEROY

Le 05/10/2017 =C3=A0 05:45, Kees Cook a =C3=A9crit :

Quoted 3 lines

When available, CONFIG_KERNEL_RWX should be default-enabled.

On PPC32, this option implies deactivating BATs and/or LTLB mapping of the
linear kernel address space, hence a significant performance degradatio=

n.

Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

So at least on PPC32, it should remain unselected by default.

Alright, sounds fine to me. Would this be okay?

Quoted 8 lines
Quoted 1 line

+ select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if !PPC64

You mean

select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if PPC64

Don't you ?

Oops, yes! :)

-Kees

--=20
Kees Cook
Pixel Security