LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH][v3.2] Revert: x86, 64bit, mm: Mark data/bss/brk to nx
@ 2015-01-19 21:49 Steven Rostedt
  2015-01-19 22:07 ` Ben Hutchings
  0 siblings, 1 reply; 5+ messages in thread
From: Steven Rostedt @ 2015-01-19 21:49 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: LKML, stable, Yinghai Lu, H. Peter Anvin


Testing v3.2-rt I found that after merging the latest v3.2 stable tree,
hotplug stopped working. I tested the latest v3.2 stable, and it was
not working there either. I bisected it down to:

commit e105c8187b7101e8a8a54ac0218c9d9c9463c636
Author: Yinghai Lu <yinghai@kernel.org>
Date:   Thu Jan 24 12:20:13 2013 -0800

    x86, 64bit, mm: Mark data/bss/brk to nx
    
    commit 72212675d1c96f5db8ec6fb35701879911193158 upstream.

Simply doing:

 # echo 0 > /sys/devices/system/cpu/cpu1/online
 # echo 1 > /sys/devices/system/cpu/cpu1/online

caused the system to reboot.

After reverting that commit, hotplug works again on the v3.2 stable
tree.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 266f71719e42..783eba48d00c 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -778,7 +778,6 @@ void mark_rodata_ro(void)
 	unsigned long text_end = PAGE_ALIGN((unsigned long) &__stop___ex_table);
 	unsigned long rodata_end = PAGE_ALIGN((unsigned long) &__end_rodata);
 	unsigned long data_start = (unsigned long) &_sdata;
-	unsigned long all_end;
 
 	printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n",
 	       (end - start) >> 10);
@@ -787,8 +786,8 @@ void mark_rodata_ro(void)
 	kernel_set_to_readonly = 1;
 
 	/*
-	 * The rodata/data/bss/brk section (but not the kernel text!)
-	 * should also be not-executable.
+	 * The rodata section (but not the kernel text!) should also be
+	 * not-executable.
 	 *
 	 * We align all_end to PMD_SIZE because the existing mapping
 	 * is a full PMD. If we would align _brk_end to PAGE_SIZE we
@@ -798,8 +797,7 @@ void mark_rodata_ro(void)
 	 * Any PMD which was setup after the one which covers _brk_end
 	 * has been zapped already via cleanup_highmem().
 	 */
-	all_end = roundup((unsigned long)_brk_end, PMD_SIZE);
-	set_memory_nx(rodata_start, (all_end - rodata_start) >> PAGE_SHIFT);
+	set_memory_nx(rodata_start, (end - rodata_start) >> PAGE_SHIFT);
 
 	rodata_test();
 

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

* Re: [PATCH][v3.2] Revert: x86, 64bit, mm: Mark data/bss/brk to nx
  2015-01-19 21:49 [PATCH][v3.2] Revert: x86, 64bit, mm: Mark data/bss/brk to nx Steven Rostedt
@ 2015-01-19 22:07 ` Ben Hutchings
  2015-01-19 22:19   ` Steven Rostedt
  0 siblings, 1 reply; 5+ messages in thread
From: Ben Hutchings @ 2015-01-19 22:07 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: LKML, stable, Yinghai Lu, H. Peter Anvin

[-- Attachment #1: Type: text/plain, Size: 2461 bytes --]

On Mon, 2015-01-19 at 16:49 -0500, Steven Rostedt wrote:
> Testing v3.2-rt I found that after merging the latest v3.2 stable tree,
> hotplug stopped working. I tested the latest v3.2 stable, and it was
> not working there either. I bisected it down to:
> 
> commit e105c8187b7101e8a8a54ac0218c9d9c9463c636
> Author: Yinghai Lu <yinghai@kernel.org>
> Date:   Thu Jan 24 12:20:13 2013 -0800
> 
>     x86, 64bit, mm: Mark data/bss/brk to nx
>     
>     commit 72212675d1c96f5db8ec6fb35701879911193158 upstream.
> 
> Simply doing:
> 
>  # echo 0 > /sys/devices/system/cpu/cpu1/online
>  # echo 1 > /sys/devices/system/cpu/cpu1/online
> 
> caused the system to reboot.
> 
> After reverting that commit, hotplug works again on the v3.2 stable
> tree.

Yes, I know this needs fixing.  It also broke suspend/resume on SMP
machines since that involves offlining and onlining CPUs 1-n.

Ben.

> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---
> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
> index 266f71719e42..783eba48d00c 100644
> --- a/arch/x86/mm/init_64.c
> +++ b/arch/x86/mm/init_64.c
> @@ -778,7 +778,6 @@ void mark_rodata_ro(void)
>  	unsigned long text_end = PAGE_ALIGN((unsigned long) &__stop___ex_table);
>  	unsigned long rodata_end = PAGE_ALIGN((unsigned long) &__end_rodata);
>  	unsigned long data_start = (unsigned long) &_sdata;
> -	unsigned long all_end;
>  
>  	printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n",
>  	       (end - start) >> 10);
> @@ -787,8 +786,8 @@ void mark_rodata_ro(void)
>  	kernel_set_to_readonly = 1;
>  
>  	/*
> -	 * The rodata/data/bss/brk section (but not the kernel text!)
> -	 * should also be not-executable.
> +	 * The rodata section (but not the kernel text!) should also be
> +	 * not-executable.
>  	 *
>  	 * We align all_end to PMD_SIZE because the existing mapping
>  	 * is a full PMD. If we would align _brk_end to PAGE_SIZE we
> @@ -798,8 +797,7 @@ void mark_rodata_ro(void)
>  	 * Any PMD which was setup after the one which covers _brk_end
>  	 * has been zapped already via cleanup_highmem().
>  	 */
> -	all_end = roundup((unsigned long)_brk_end, PMD_SIZE);
> -	set_memory_nx(rodata_start, (all_end - rodata_start) >> PAGE_SHIFT);
> +	set_memory_nx(rodata_start, (end - rodata_start) >> PAGE_SHIFT);
>  
>  	rodata_test();
>  

-- 
Ben Hutchings
Larkinson's Law: All laws are basically false.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* Re: [PATCH][v3.2] Revert: x86, 64bit, mm: Mark data/bss/brk to nx
  2015-01-19 22:07 ` Ben Hutchings
@ 2015-01-19 22:19   ` Steven Rostedt
  2015-01-20 16:06     ` Ben Hutchings
  0 siblings, 1 reply; 5+ messages in thread
From: Steven Rostedt @ 2015-01-19 22:19 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: LKML, stable, Yinghai Lu, H. Peter Anvin

On Mon, 19 Jan 2015 22:07:11 +0000
Ben Hutchings <ben@decadent.org.uk> wrote:
 
> Yes, I know this needs fixing.  It also broke suspend/resume on SMP
> machines since that involves offlining and onlining CPUs 1-n.

OK, as long as you know. Also, have you seen my other patch?

http://marc.info/?l=linux-kernel&m=142150909924885


-- Steve

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

* Re: [PATCH][v3.2] Revert: x86, 64bit, mm: Mark data/bss/brk to nx
  2015-01-19 22:19   ` Steven Rostedt
@ 2015-01-20 16:06     ` Ben Hutchings
  2015-01-20 16:12       ` Steven Rostedt
  0 siblings, 1 reply; 5+ messages in thread
From: Ben Hutchings @ 2015-01-20 16:06 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: LKML, stable, Yinghai Lu, H. Peter Anvin

[-- Attachment #1: Type: text/plain, Size: 588 bytes --]

On Mon, 2015-01-19 at 17:19 -0500, Steven Rostedt wrote:
> On Mon, 19 Jan 2015 22:07:11 +0000
> Ben Hutchings <ben@decadent.org.uk> wrote:
>  
> > Yes, I know this needs fixing.  It also broke suspend/resume on SMP
> > machines since that involves offlining and onlining CPUs 1-n.
> 
> OK, as long as you know. Also, have you seen my other patch?
> 
> http://marc.info/?l=linux-kernel&m=142150909924885

Yes, I saw that and have filed it away for whenever I start working on
the next 3.2 release.

Ben.

-- 
Ben Hutchings
Larkinson's Law: All laws are basically false.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* Re: [PATCH][v3.2] Revert: x86, 64bit, mm: Mark data/bss/brk to nx
  2015-01-20 16:06     ` Ben Hutchings
@ 2015-01-20 16:12       ` Steven Rostedt
  0 siblings, 0 replies; 5+ messages in thread
From: Steven Rostedt @ 2015-01-20 16:12 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: LKML, stable, Yinghai Lu, H. Peter Anvin

On Tue, 20 Jan 2015 16:06:06 +0000
Ben Hutchings <ben@decadent.org.uk> wrote:

> On Mon, 2015-01-19 at 17:19 -0500, Steven Rostedt wrote:
> > On Mon, 19 Jan 2015 22:07:11 +0000
> > Ben Hutchings <ben@decadent.org.uk> wrote:
> >  
> > > Yes, I know this needs fixing.  It also broke suspend/resume on SMP
> > > machines since that involves offlining and onlining CPUs 1-n.
> > 
> > OK, as long as you know. Also, have you seen my other patch?
> > 
> > http://marc.info/?l=linux-kernel&m=142150909924885
> 
> Yes, I saw that and have filed it away for whenever I start working on
> the next 3.2 release.

OK,

I'm going to hold off releasing another 3.2-rt until then.

-- Steve

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

end of thread, other threads:[~2015-01-20 16:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-19 21:49 [PATCH][v3.2] Revert: x86, 64bit, mm: Mark data/bss/brk to nx Steven Rostedt
2015-01-19 22:07 ` Ben Hutchings
2015-01-19 22:19   ` Steven Rostedt
2015-01-20 16:06     ` Ben Hutchings
2015-01-20 16:12       ` Steven Rostedt

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 NNTP newsgroup(s).