rpms/kernel/devel kernel-2.6.spec, 1.1703, 1.1704 linux-2.6-write-protect-rodata.patch, 1.5, 1.6

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Nov 22 15:16:35 UTC 2005


Author: davej

Update of /cvs/dist/rpms/kernel/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv15628

Modified Files:
	kernel-2.6.spec linux-2.6-write-protect-rodata.patch 
Log Message:
add a runtime disable for the rodata wp




Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/kernel-2.6.spec,v
retrieving revision 1.1703
retrieving revision 1.1704
diff -u -r1.1703 -r1.1704
--- kernel-2.6.spec	22 Nov 2005 14:24:47 -0000	1.1703
+++ kernel-2.6.spec	22 Nov 2005 15:16:32 -0000	1.1704
@@ -1298,6 +1298,7 @@
 %changelog
 * Tue Nov 22 2005 Dave Jones <davej at redhat.com>
 - 2.6.15-rc2-git2
+- Add a 'nowprodata' to disable rodata protection during debug.
 
 * Mon Nov 21 2005 David Woodhouse <dwmw2 at redhat.com>
 - No pcskpr on ppc64
@@ -1319,6 +1320,7 @@
 
 * Fri Nov 18 2005 David Woodhouse <dwmw2 at redhat.com>
 - Fix ppc64 sparsemem with memory holes.
+- Fix ppc64 sparsemem with memory holes.
 
 * Fri Nov 18 2005 Dave Jones <davej at redhat.com>
 - Write protect kernel space rodata on x86-32 too.

linux-2.6-write-protect-rodata.patch:
 linux-2.6.14-fordiff/arch/i386/Kconfig.debug           |   10 +++++++
 linux-2.6.14-fordiff/arch/i386/kernel/entry.S          |    1 
 linux-2.6.14-fordiff/arch/i386/kernel/syscall_table.S  |    1 
 linux-2.6.14-fordiff/arch/i386/mm/init.c               |   24 +++++++++++++++++
 linux-2.6.14-fordiff/arch/x86_64/Kconfig.debug         |   10 +++++++
 linux-2.6.14-fordiff/arch/x86_64/kernel/syscall.c      |    2 -
 linux-2.6.14-fordiff/arch/x86_64/mm/init.c             |   23 ++++++++++++++++
 linux-2.6.14-fordiff/arch/x86_64/mm/pageattr.c         |    9 ++++--
 linux-2.6.14-fordiff/include/asm-generic/vmlinux.lds.h |    4 ++
 linux-2.6.14-fordiff/include/asm-x86_64/pgtable.h      |    2 +
 linux-2.6.14-fordiff/init/main.c                       |    6 ++++
 linux-2.6.14/arch/i386/mm/init.c                       |   12 ++++++++
 linux-2.6.14/arch/x86_64/mm/init.c                     |   12 ++++++++
 13 files changed, 112 insertions(+), 4 deletions(-)

Index: linux-2.6-write-protect-rodata.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/linux-2.6-write-protect-rodata.patch,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- linux-2.6-write-protect-rodata.patch	9 Nov 2005 21:53:08 -0000	1.5
+++ linux-2.6-write-protect-rodata.patch	22 Nov 2005 15:16:32 -0000	1.6
@@ -250,3 +250,68 @@
  	numa_default_policy();
  
 
+--- linux-2.6.14/arch/i386/mm/init.c~	2005-11-22 10:05:02.000000000 -0500
++++ linux-2.6.14/arch/i386/mm/init.c	2005-11-22 10:08:07.000000000 -0500
+@@ -809,10 +809,14 @@ void free_initmem(void)
+ 
+ #ifdef CONFIG_DEBUG_RODATA
+ 
++static int nowprodata;
++
+ extern char __start_rodata, __end_rodata;
+ void mark_rodata_ro(void)
+ {
+ 	unsigned long addr = (unsigned long)&__start_rodata;
++	if (nowprodata == 1)
++		return;
+ 
+ 	for (; addr < (unsigned long)&__end_rodata; addr += PAGE_SIZE)
+ 		change_page_attr(virt_to_page(addr), 1, PAGE_KERNEL_RO);
+@@ -828,6 +832,14 @@ void mark_rodata_ro(void)
+ 	 */
+ 	global_flush_tlb();
+ }
++ 
++static int __init disable_rodata(char *str)
++{
++	nowprodata = 1;
++	return 1;
++}
++__setup("nowprodata", disable_rodata);
++
+ #endif
+ 
+ 
+--- linux-2.6.14/arch/x86_64/mm/init.c~	2005-11-22 10:11:34.000000000 -0500
++++ linux-2.6.14/arch/x86_64/mm/init.c	2005-11-22 10:14:00.000000000 -0500
+@@ -576,11 +576,16 @@ void free_initmem(void)
+ 
+ #ifdef CONFIG_DEBUG_RODATA
+ 
++static int nowprodata;
++
+ extern char __start_rodata, __end_rodata;
+ void mark_rodata_ro(void)
+ {
+ 	unsigned long addr = (unsigned long)&__start_rodata;
+ 
++	if (nowprodata == 1)
++		return;
++
+ 	for (; addr < (unsigned long)&__end_rodata; addr += PAGE_SIZE)
+ 		change_page_attr_addr(addr, 1, PAGE_KERNEL_RO);
+ 
+@@ -595,6 +600,13 @@ void mark_rodata_ro(void)
+ 	 */
+ 	global_flush_tlb();
+ }
++
++static int __init disable_rodata(char *str)
++{
++	nowprodata = 1;
++	return 1;
++}
++__setup("nowprodata", disable_rodata);
+ #endif
+ 
+ #ifdef CONFIG_BLK_DEV_INITRD




More information about the fedora-cvs-commits mailing list