Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57946
b: refs/heads/master
c: 0864a4e
h: refs/heads/master
v: v3
  • Loading branch information
Arjan van de Ven authored and Linus Torvalds committed Jun 21, 2007
1 parent cc443eb commit 4ab7427
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 79d9a72f87d0a6f910be262a9dd4c36e96972a92
refs/heads/master: 0864a4e201b1ea442f4c8b887418a29f67e24d30
1 change: 0 additions & 1 deletion trunk/arch/i386/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ config DEBUG_PAGEALLOC
config DEBUG_RODATA
bool "Write protect kernel read-only data structures"
depends on DEBUG_KERNEL
depends on !KPROBES # temporary for 2.6.22
help
Mark the kernel read-only data as write-protected in the pagetables,
in order to catch accidental (and incorrect) writes to such const
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/i386/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ void mark_rodata_ro(void)
unsigned long start = PFN_ALIGN(_text);
unsigned long size = PFN_ALIGN(_etext) - start;

#ifndef CONFIG_KPROBES
#ifdef CONFIG_HOTPLUG_CPU
/* It must still be possible to apply SMP alternatives. */
if (num_possible_cpus() <= 1)
Expand All @@ -808,7 +809,7 @@ void mark_rodata_ro(void)
size >> PAGE_SHIFT, PAGE_KERNEL_RX);
printk("Write protecting the kernel text: %luk\n", size >> 10);
}

#endif
start += size;
size = (unsigned long)__end_rodata - start;
change_page_attr(virt_to_page(start),
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/x86_64/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ source "lib/Kconfig.debug"
config DEBUG_RODATA
bool "Write protect kernel read-only data structures"
depends on DEBUG_KERNEL
depends on !KPROBES # temporary for 2.6.22
help
Mark the kernel read-only data as write-protected in the pagetables,
in order to catch accidental (and incorrect) writes to such const data.
Expand Down
5 changes: 5 additions & 0 deletions trunk/arch/x86_64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,11 @@ void mark_rodata_ro(void)
if (num_possible_cpus() > 1)
start = (unsigned long)_etext;
#endif

#ifdef CONFIG_KPROBES
start = (unsigned long)__start_rodata;
#endif

end = (unsigned long)__end_rodata;
start = (start + PAGE_SIZE - 1) & PAGE_MASK;
end &= PAGE_MASK;
Expand Down

0 comments on commit 4ab7427

Please sign in to comment.