All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: Default to enabling STRICT_KERNEL_RWX
@ 2017-10-05  3:45 Kees Cook
  2017-10-05  7:49 ` Christophe LEROY
  0 siblings, 1 reply; 7+ messages in thread
From: Kees Cook @ 2017-10-05  3:45 UTC (permalink / raw)
  To: linux-kernel
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman, linuxppc-dev

When available, CONFIG_KERNEL_RWX should be default-enabled.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 arch/powerpc/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 809c468edab1..9a549bbfc278 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -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
-- 
2.7.4


-- 
Kees Cook
Pixel Security

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] powerpc: Default to enabling STRICT_KERNEL_RWX
  2017-10-05  3:45 [PATCH] powerpc: Default to enabling STRICT_KERNEL_RWX Kees Cook
@ 2017-10-05  7:49 ` Christophe LEROY
  2017-10-05 17:30     ` Kees Cook
  0 siblings, 1 reply; 7+ messages in thread
From: Christophe LEROY @ 2017-10-05  7:49 UTC (permalink / raw)
  To: Kees Cook, linux-kernel; +Cc: Paul Mackerras, linuxppc-dev



Le 05/10/2017 à 05:45, Kees Cook a écrit :
> 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

> 
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
>   arch/powerpc/Kconfig | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 809c468edab1..9a549bbfc278 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -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
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] powerpc: Default to enabling STRICT_KERNEL_RWX
  2017-10-05  7:49 ` Christophe LEROY
@ 2017-10-05 17:30     ` Kees Cook
  0 siblings, 0 replies; 7+ messages in thread
From: Kees Cook @ 2017-10-05 17:30 UTC (permalink / raw)
  To: Christophe LEROY; +Cc: LKML, Paul Mackerras, linuxppc-dev

On Thu, Oct 5, 2017 at 12:49 AM, Christophe LEROY
<christophe.leroy@c-s.fr> wrote:
>
>
> Le 05/10/2017 à 05:45, Kees Cook a écrit :
>>
>> 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

>
> Christophe
>
>
>>
>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> Cc: Paul Mackerras <paulus@samba.org>
>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>> Cc: linuxppc-dev@lists.ozlabs.org
>> Signed-off-by: Kees Cook <keescook@chromium.org>
>> ---
>>   arch/powerpc/Kconfig | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>> index 809c468edab1..9a549bbfc278 100644
>> --- a/arch/powerpc/Kconfig
>> +++ b/arch/powerpc/Kconfig
>> @@ -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
>>
>



-- 
Kees Cook
Pixel Security

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] powerpc: Default to enabling STRICT_KERNEL_RWX
@ 2017-10-05 17:30     ` Kees Cook
  0 siblings, 0 replies; 7+ messages in thread
From: Kees Cook @ 2017-10-05 17:30 UTC (permalink / raw)
  To: Christophe LEROY; +Cc: LKML, Paul Mackerras, linuxppc-dev

On Thu, Oct 5, 2017 at 12:49 AM, Christophe LEROY
<christophe.leroy@c-s.fr> wrote:
>
>
> Le 05/10/2017 =C3=A0 05:45, Kees Cook a =C3=A9crit :
>>
>> When available, CONFIG_KERNEL_RWX should be default-enabled.
>
>
> On PPC32, this option implies deactivating BATs and/or LTLB mapping of th=
e
> 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

>
> Christophe
>
>
>>
>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> Cc: Paul Mackerras <paulus@samba.org>
>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>> Cc: linuxppc-dev@lists.ozlabs.org
>> Signed-off-by: Kees Cook <keescook@chromium.org>
>> ---
>>   arch/powerpc/Kconfig | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>> index 809c468edab1..9a549bbfc278 100644
>> --- a/arch/powerpc/Kconfig
>> +++ b/arch/powerpc/Kconfig
>> @@ -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
>>
>



--=20
Kees Cook
Pixel Security

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] powerpc: Default to enabling STRICT_KERNEL_RWX
  2017-10-05 17:30     ` Kees Cook
  (?)
@ 2017-10-05 18:57     ` christophe leroy
  2017-10-05 18:58         ` Kees Cook
  -1 siblings, 1 reply; 7+ messages in thread
From: christophe leroy @ 2017-10-05 18:57 UTC (permalink / raw)
  To: Kees Cook; +Cc: LKML, Paul Mackerras, linuxppc-dev



Le 05/10/2017 à 19:30, Kees Cook a écrit :
> On Thu, Oct 5, 2017 at 12:49 AM, Christophe LEROY
> <christophe.leroy@c-s.fr> wrote:
>>
>>
>> Le 05/10/2017 à 05:45, Kees Cook a écrit :
>>>
>>> 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

You mean

select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if PPC64

Don't you ?

Christophe

> 
> -Kees
> 
>>
>> Christophe
>>
>>
>>>
>>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>>> Cc: Paul Mackerras <paulus@samba.org>
>>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>>> Cc: linuxppc-dev@lists.ozlabs.org
>>> Signed-off-by: Kees Cook <keescook@chromium.org>
>>> ---
>>>    arch/powerpc/Kconfig | 1 +
>>>    1 file changed, 1 insertion(+)
>>>
>>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>>> index 809c468edab1..9a549bbfc278 100644
>>> --- a/arch/powerpc/Kconfig
>>> +++ b/arch/powerpc/Kconfig
>>> @@ -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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] powerpc: Default to enabling STRICT_KERNEL_RWX
  2017-10-05 18:57     ` christophe leroy
@ 2017-10-05 18:58         ` Kees Cook
  0 siblings, 0 replies; 7+ messages in thread
From: Kees Cook @ 2017-10-05 18:58 UTC (permalink / raw)
  To: christophe leroy; +Cc: LKML, Paul Mackerras, linuxppc-dev

On Thu, Oct 5, 2017 at 11:57 AM, christophe leroy
<christophe.leroy@c-s.fr> wrote:
>
>
> Le 05/10/2017 à 19:30, Kees Cook a écrit :
>>
>> On Thu, Oct 5, 2017 at 12:49 AM, Christophe LEROY
>> <christophe.leroy@c-s.fr> wrote:
>>>
>>>
>>>
>>> Le 05/10/2017 à 05:45, Kees Cook a écrit :
>>>>
>>>>
>>>> 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
>
>
> You mean
>
> select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if PPC64
>
> Don't you ?

Oops, yes! :)

-Kees

-- 
Kees Cook
Pixel Security

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] powerpc: Default to enabling STRICT_KERNEL_RWX
@ 2017-10-05 18:58         ` Kees Cook
  0 siblings, 0 replies; 7+ messages in thread
From: Kees Cook @ 2017-10-05 18:58 UTC (permalink / raw)
  To: christophe leroy; +Cc: LKML, Paul Mackerras, linuxppc-dev

On Thu, Oct 5, 2017 at 11:57 AM, christophe leroy
<christophe.leroy@c-s.fr> wrote:
>
>
> Le 05/10/2017 =C3=A0 19:30, Kees Cook a =C3=A9crit :
>>
>> On Thu, Oct 5, 2017 at 12:49 AM, Christophe LEROY
>> <christophe.leroy@c-s.fr> wrote:
>>>
>>>
>>>
>>> Le 05/10/2017 =C3=A0 05:45, Kees Cook a =C3=A9crit :
>>>>
>>>>
>>>> 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.
>>>
>>> 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 ?

Oops, yes! :)

-Kees

--=20
Kees Cook
Pixel Security

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-10-05 18:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-05  3:45 [PATCH] powerpc: Default to enabling STRICT_KERNEL_RWX Kees Cook
2017-10-05  7:49 ` Christophe LEROY
2017-10-05 17:30   ` Kees Cook
2017-10-05 17:30     ` Kees Cook
2017-10-05 18:57     ` christophe leroy
2017-10-05 18:58       ` Kees Cook
2017-10-05 18:58         ` Kees Cook

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.