* [kernel-hardening] [PATCH] s390: disable postinit-readonly for now
@ 2016-03-10 17:31 Kees Cook
2016-03-12 11:15 ` [kernel-hardening] " Heiko Carstens
2016-03-16 19:47 ` Christian Borntraeger
0 siblings, 2 replies; 5+ messages in thread
From: Kees Cook @ 2016-03-10 17:31 UTC (permalink / raw
To: Heiko Carstens
Cc: Martin Schwidefsky, Christian Borntraeger, linux-kernel,
linux-s390, kernel-hardening
This is a temporary fix to let lkdtm run again on s390, though it'll
still fail the ro_after_init tests. Until rodata and ro_after_init
sections can be split on s390, disable special handling of ro_after_init.
Signed-off-by: Kees Cook <keescook@chromium.org>
---
for -next ...
---
arch/s390/include/asm/cache.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/s390/include/asm/cache.h b/arch/s390/include/asm/cache.h
index 4d7ccac5fd1d..22da3b34c655 100644
--- a/arch/s390/include/asm/cache.h
+++ b/arch/s390/include/asm/cache.h
@@ -15,4 +15,7 @@
#define __read_mostly __attribute__((__section__(".data..read_mostly")))
+/* Read-only memory is marked before mark_rodata_ro() is called. */
+#define __ro_after_init __read_mostly
+
#endif
--
2.6.3
--
Kees Cook
Chrome OS & Brillo Security
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [kernel-hardening] Re: [PATCH] s390: disable postinit-readonly for now
2016-03-10 17:31 [kernel-hardening] [PATCH] s390: disable postinit-readonly for now Kees Cook
@ 2016-03-12 11:15 ` Heiko Carstens
2016-03-16 19:47 ` Christian Borntraeger
1 sibling, 0 replies; 5+ messages in thread
From: Heiko Carstens @ 2016-03-12 11:15 UTC (permalink / raw
To: Kees Cook
Cc: Martin Schwidefsky, Christian Borntraeger, linux-kernel,
linux-s390, kernel-hardening
On Thu, Mar 10, 2016 at 09:31:44AM -0800, Kees Cook wrote:
> This is a temporary fix to let lkdtm run again on s390, though it'll
> still fail the ro_after_init tests. Until rodata and ro_after_init
> sections can be split on s390, disable special handling of ro_after_init.
>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> for -next ...
> ---
> arch/s390/include/asm/cache.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/s390/include/asm/cache.h b/arch/s390/include/asm/cache.h
> index 4d7ccac5fd1d..22da3b34c655 100644
> --- a/arch/s390/include/asm/cache.h
> +++ b/arch/s390/include/asm/cache.h
> @@ -15,4 +15,7 @@
>
> #define __read_mostly __attribute__((__section__(".data..read_mostly")))
>
> +/* Read-only memory is marked before mark_rodata_ro() is called. */
> +#define __ro_after_init __read_mostly
> +
> #endif
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [kernel-hardening] Re: [PATCH] s390: disable postinit-readonly for now
2016-03-10 17:31 [kernel-hardening] [PATCH] s390: disable postinit-readonly for now Kees Cook
2016-03-12 11:15 ` [kernel-hardening] " Heiko Carstens
@ 2016-03-16 19:47 ` Christian Borntraeger
2016-03-17 8:49 ` Heiko Carstens
1 sibling, 1 reply; 5+ messages in thread
From: Christian Borntraeger @ 2016-03-16 19:47 UTC (permalink / raw
To: Kees Cook, Heiko Carstens
Cc: Martin Schwidefsky, linux-kernel, linux-s390, kernel-hardening,
Ingo Molnar
On 03/10/2016 06:31 PM, Kees Cook wrote:
> This is a temporary fix to let lkdtm run again on s390, though it'll
> still fail the ro_after_init tests. Until rodata and ro_after_init
> sections can be split on s390, disable special handling of ro_after_init.
>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> for -next ...
Given that the other patches are already merged in linus master via Ingo,
do you want this to go via Ingo as well?
> ---
> arch/s390/include/asm/cache.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/s390/include/asm/cache.h b/arch/s390/include/asm/cache.h
> index 4d7ccac5fd1d..22da3b34c655 100644
> --- a/arch/s390/include/asm/cache.h
> +++ b/arch/s390/include/asm/cache.h
> @@ -15,4 +15,7 @@
>
> #define __read_mostly __attribute__((__section__(".data..read_mostly")))
>
> +/* Read-only memory is marked before mark_rodata_ro() is called. */
> +#define __ro_after_init __read_mostly
> +
> #endif
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [kernel-hardening] Re: [PATCH] s390: disable postinit-readonly for now
2016-03-16 19:47 ` Christian Borntraeger
@ 2016-03-17 8:49 ` Heiko Carstens
2016-03-21 19:33 ` Kees Cook
0 siblings, 1 reply; 5+ messages in thread
From: Heiko Carstens @ 2016-03-17 8:49 UTC (permalink / raw
To: Christian Borntraeger
Cc: Kees Cook, Martin Schwidefsky, linux-kernel, linux-s390,
kernel-hardening, Ingo Molnar
On Wed, Mar 16, 2016 at 08:47:44PM +0100, Christian Borntraeger wrote:
> On 03/10/2016 06:31 PM, Kees Cook wrote:
> > This is a temporary fix to let lkdtm run again on s390, though it'll
> > still fail the ro_after_init tests. Until rodata and ro_after_init
> > sections can be split on s390, disable special handling of ro_after_init.
> >
> > Signed-off-by: Kees Cook <keescook@chromium.org>
> > ---
> > for -next ...
>
> Given that the other patches are already merged in linus master via Ingo,
> do you want this to go via Ingo as well?
Let's route this via the s390 tree. I will add another patch to get rid of
the bogus "This architecture does not have kernel memory protection."
message printed to the console, just like parisc.
> > ---
> > arch/s390/include/asm/cache.h | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/arch/s390/include/asm/cache.h b/arch/s390/include/asm/cache.h
> > index 4d7ccac5fd1d..22da3b34c655 100644
> > --- a/arch/s390/include/asm/cache.h
> > +++ b/arch/s390/include/asm/cache.h
> > @@ -15,4 +15,7 @@
> >
> > #define __read_mostly __attribute__((__section__(".data..read_mostly")))
> >
> > +/* Read-only memory is marked before mark_rodata_ro() is called. */
> > +#define __ro_after_init __read_mostly
> > +
^ permalink raw reply [flat|nested] 5+ messages in thread
* [kernel-hardening] Re: [PATCH] s390: disable postinit-readonly for now
2016-03-17 8:49 ` Heiko Carstens
@ 2016-03-21 19:33 ` Kees Cook
0 siblings, 0 replies; 5+ messages in thread
From: Kees Cook @ 2016-03-21 19:33 UTC (permalink / raw
To: Heiko Carstens
Cc: Christian Borntraeger, Martin Schwidefsky, LKML,
linux-s390@vger.kernel.org, kernel-hardening@lists.openwall.com,
Ingo Molnar
On Thu, Mar 17, 2016 at 1:49 AM, Heiko Carstens
<heiko.carstens@de.ibm.com> wrote:
> On Wed, Mar 16, 2016 at 08:47:44PM +0100, Christian Borntraeger wrote:
>> On 03/10/2016 06:31 PM, Kees Cook wrote:
>> > This is a temporary fix to let lkdtm run again on s390, though it'll
>> > still fail the ro_after_init tests. Until rodata and ro_after_init
>> > sections can be split on s390, disable special handling of ro_after_init.
>> >
>> > Signed-off-by: Kees Cook <keescook@chromium.org>
>> > ---
>> > for -next ...
>>
>> Given that the other patches are already merged in linus master via Ingo,
>> do you want this to go via Ingo as well?
>
> Let's route this via the s390 tree. I will add another patch to get rid of
> the bogus "This architecture does not have kernel memory protection."
> message printed to the console, just like parisc.
Yeah, we need to identify the 4 cases we have:
1- no memory protection
2- .rodata is ro after init (implements mark_rodata_ro(), can do
__ro_after_init)
3- .rodata is ro before init only and has no __ro_after_init
4- .rodata is ro before init and implements mark_rodata_ro() for __ro_after_init
What I have it reporting is misleading; I wrote it with ARM in mind
("1" without correct CONFIGs), rather than s390 and parisc ("3").
-Kees
>
>> > ---
>> > arch/s390/include/asm/cache.h | 3 +++
>> > 1 file changed, 3 insertions(+)
>> >
>> > diff --git a/arch/s390/include/asm/cache.h b/arch/s390/include/asm/cache.h
>> > index 4d7ccac5fd1d..22da3b34c655 100644
>> > --- a/arch/s390/include/asm/cache.h
>> > +++ b/arch/s390/include/asm/cache.h
>> > @@ -15,4 +15,7 @@
>> >
>> > #define __read_mostly __attribute__((__section__(".data..read_mostly")))
>> >
>> > +/* Read-only memory is marked before mark_rodata_ro() is called. */
>> > +#define __ro_after_init __read_mostly
>> > +
>
--
Kees Cook
Chrome OS & Brillo Security
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-03-21 19:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-10 17:31 [kernel-hardening] [PATCH] s390: disable postinit-readonly for now Kees Cook
2016-03-12 11:15 ` [kernel-hardening] " Heiko Carstens
2016-03-16 19:47 ` Christian Borntraeger
2016-03-17 8:49 ` Heiko Carstens
2016-03-21 19:33 ` Kees Cook
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).