aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-12 14:50:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-12 14:50:37 -0400
commitcbf7e9490ea3d1680362b4be3a7809042d493617 (patch)
tree4c32a7931b894d04f92b1659d258e1c1b98a8d7b
parent06270d5d6aefb46b88bf44a7c5b1b9b3ef352c48 (diff)
parentcb58ffc3889f0545628f138f849e759a331b8ddc (diff)
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: x86: fix early panic on amd64 due to typo in supported CPU section x86, early_ioremap: fix fencepost error x86: avoid dereferencing beyond stack + THREAD_SIZE
-rw-r--r--arch/x86/kernel/process_64.c4
-rw-r--r--arch/x86/kernel/vmlinux_64.lds.S2
-rw-r--r--arch/x86/mm/ioremap.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 2a8ccb9238b4..b6b508ea7110 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -754,12 +754,12 @@ unsigned long get_wchan(struct task_struct *p)
754 if (!p || p == current || p->state == TASK_RUNNING) 754 if (!p || p == current || p->state == TASK_RUNNING)
755 return 0; 755 return 0;
756 stack = (unsigned long)task_stack_page(p); 756 stack = (unsigned long)task_stack_page(p);
757 if (p->thread.sp < stack || p->thread.sp > stack+THREAD_SIZE) 757 if (p->thread.sp < stack || p->thread.sp >= stack+THREAD_SIZE)
758 return 0; 758 return 0;
759 fp = *(u64 *)(p->thread.sp); 759 fp = *(u64 *)(p->thread.sp);
760 do { 760 do {
761 if (fp < (unsigned long)stack || 761 if (fp < (unsigned long)stack ||
762 fp > (unsigned long)stack+THREAD_SIZE) 762 fp >= (unsigned long)stack+THREAD_SIZE)
763 return 0; 763 return 0;
764 ip = *(u64 *)(fp+8); 764 ip = *(u64 *)(fp+8);
765 if (!in_sched_functions(ip)) 765 if (!in_sched_functions(ip))
diff --git a/arch/x86/kernel/vmlinux_64.lds.S b/arch/x86/kernel/vmlinux_64.lds.S
index 201e81a91a95..46e05447405b 100644
--- a/arch/x86/kernel/vmlinux_64.lds.S
+++ b/arch/x86/kernel/vmlinux_64.lds.S
@@ -172,8 +172,8 @@ SECTIONS
172 .x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) { 172 .x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) {
173 *(.x86_cpu_dev.init) 173 *(.x86_cpu_dev.init)
174 } 174 }
175 SECURITY_INIT
176 __x86_cpu_dev_end = .; 175 __x86_cpu_dev_end = .;
176 SECURITY_INIT
177 177
178 . = ALIGN(8); 178 . = ALIGN(8);
179 .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) { 179 .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) {
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index 6ab3196d12b4..10b52309aefd 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -614,7 +614,7 @@ void __init *early_ioremap(unsigned long phys_addr, unsigned long size)
614 */ 614 */
615 offset = phys_addr & ~PAGE_MASK; 615 offset = phys_addr & ~PAGE_MASK;
616 phys_addr &= PAGE_MASK; 616 phys_addr &= PAGE_MASK;
617 size = PAGE_ALIGN(last_addr) - phys_addr; 617 size = PAGE_ALIGN(last_addr + 1) - phys_addr;
618 618
619 /* 619 /*
620 * Mappings have to fit in the FIX_BTMAP area. 620 * Mappings have to fit in the FIX_BTMAP area.