linux-kernel-test/arch/x86
Ingo Molnar 07a66d7c53 x86: use the right protections for split-up pagetables
Steven Rostedt found a bug in where in his modified kernel
ftrace was unable to modify the kernel text, due to the PMD
itself having been marked read-only as well in
split_large_page().

The fix, suggested by Linus, is to not try to 'clone' the
reference protection of a huge-page, but to use the standard
(and permissive) page protection bits of KERNPG_TABLE.

The 'cloning' makes sense for the ptes but it's a confused and
incorrect concept at the page table level - because the
pagetable entry is a set of all ptes and hence cannot
'clone' any single protection attribute - the ptes can be any
mixture of protections.

With the permissive KERNPG_TABLE, even if the pte protections
get changed after this point (due to ftrace doing code-patching
or other similar activities like kprobes), the resulting combined
protections will still be correct and the pte's restrictive
(or permissive) protections will control it.

Also update the comment.

This bug was there for a long time but has not caused visible
problems before as it needs a rather large read-only area to
trigger. Steve possibly hacked his kernel with some really
large arrays or so. Anyway, the bug is definitely worth fixing.

[ Huang Ying also experienced problems in this area when writing
  the EFI code, but the real bug in split_large_page() was not
  realized back then. ]

Reported-by: Steven Rostedt <rostedt@goodmis.org>
Reported-by: Huang Ying <ying.huang@intel.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-02-20 08:35:03 +01:00
..
boot x86 setup: fix asm constraints in vesa_store_edid 2009-01-30 23:55:25 +01:00
configs eeprom: More consistent symbol names 2009-01-26 21:19:57 +01:00
crypto crypto: crc32c-intel - Switch to shash 2008-12-25 11:01:37 +11:00
ia32 x86-64: fix int $0x80 -ENOSYS return 2009-02-06 18:22:29 -08:00
include/asm mm: clean up for early_pfn_to_nid() 2009-02-18 15:37:55 -08:00
kernel x86, vmi: TSC going backwards check in vmi clocksource 2009-02-20 07:53:08 +01:00
kvm KVM: VMX: Flush volatile msrs before emulating rdmsr 2009-02-15 02:47:39 +02:00
lguest lguest: typos fix 2009-01-30 11:34:10 +10:30
lib x86: use early clobbers in usercopy*.c 2009-01-21 09:43:17 +01:00
mach-default x86/Voyager: make it build and boot 2009-01-31 18:26:07 +01:00
mach-generic x86: rename all fields of mpc_table mpc_X to X 2009-01-05 14:08:34 +01:00
mach-rdc321x
mach-voyager x86/Voyager: make it build and boot 2009-01-31 18:26:07 +01:00
math-emu x86: fix math_emu register frame access 2009-02-10 00:39:14 +01:00
mm x86: use the right protections for split-up pagetables 2009-02-20 08:35:03 +01:00
oprofile Merge branch 'oprofile/ring_buffer' into oprofile/oprofile-for-tip 2009-01-08 14:27:34 +01:00
pci PCI: irq and pci_ids patch for Intel Tigerpoint DeviceIDs 2009-01-27 09:46:08 -08:00
power x86, hibernate: fix breakage on x86_32 with CONFIG_NUMA set 2008-11-12 23:28:51 +01:00
vdso Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 2008-12-28 12:33:21 -08:00
video
xen xen: disable interrupts before saving in percpu 2009-02-03 17:22:40 -08:00
Kconfig x86: disable intel_iommu support by default 2009-02-05 16:48:38 +01:00
Kconfig.cpu x86/Kconfig.cpu: make Kconfig help readable in the console 2009-02-04 22:19:27 +01:00
Kconfig.debug trace: mmiotrace to the tracer menu in Kconfig 2009-02-15 20:03:28 +01:00
Makefile x86, um: ... and asm-x86 move 2008-10-22 22:55:20 -07:00
Makefile_32.cpu x86: merge winchip-2 and winchip-2a cpu choices 2008-10-13 10:22:48 +02:00