android_kernel_motorola_sm6225/arch
Ingo Molnar 0796bdb7e9 [PATCH] x86_64: stack unwinder crash fix
the new dwarf2 unwinder crashes while trying to dump the stack:

  Leftover inexact backtrace:

  Unable to handle kernel paging request at ffffffff82800000 RIP:
   [<ffffffff8026cf26>] dump_trace+0x35b/0x3d2
  PGD 203027 PUD 205027 PMD 0
  Oops: 0000 [2] PREEMPT SMP
  CPU 0
  Modules linked in:
  Pid: 30, comm: khelper Not tainted 2.6.19-rc6-rt1 #11
  RIP: 0010:[<ffffffff8026cf26>]  [<ffffffff8026cf26>] dump_trace+0x35b/0x3d2
  RSP: 0000:ffff81003fb9d848  EFLAGS: 00010006
  RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
  RDX: 0000000000000000 RSI: ffffffff805b3520 RDI: 0000000000000000
  RBP: ffffffff827ffff9 R08: ffffffff80aad000 R09: 0000000000000005
  R10: ffffffff80aae000 R11: ffffffff8037961b R12: ffff81003fb9d858
  R13: 0000000000000000 R14: ffffffff80598460 R15: ffffffff80ab1fc0
  FS:  0000000000000000(0000) GS:ffffffff806c4200(0000) knlGS:0000000000000000
  CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
  CR2: ffffffff82800000 CR3: 0000000000201000 CR4: 00000000000006e0

this crash happened because it did not sanitize the dwarf2 data it
got, and got an unaligned stack pointer - which happily walked past
the process stack (and eventually reached the end of kernel memory
and pagefaulted there) due to this naive iteration condition:

        HANDLE_STACK (((long) stack & (THREAD_SIZE-1)) != 0);

note that i386 is alot more conservative when it comes to trusting
stack pointers:

  static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)
  {
         return  p > (void *)tinfo &&
                 p < (void *)tinfo + THREAD_SIZE - 3;
  }

but the x86_64 code did not take this bit of i386 code.

The fix is to align the stack pointer.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Andi Kleen <ak@suse.de>
Cc: Jan Beulich <jbeulich@novell.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-11-17 08:20:09 -08:00
..
alpha Update for the srm_env driver. 2006-11-07 23:50:37 +01:00
arm [ARM] Remove OP_MAX_COUNTER 2006-11-14 15:15:40 +00:00
arm26 [PATCH] remove bogus arch-specific syscall exports 2006-10-11 11:17:07 -07:00
avr32 AVR32: Add missing return instruction in __raw_writesb 2006-11-06 14:07:16 +01:00
cris [PATCH] cryptocop: double spin_lock_irqsave() 2006-10-30 12:08:41 -08:00
frv [PATCH] vmlinux.lds: consolidate initcall sections 2006-10-27 15:34:51 -07:00
h8300 [PATCH] vmlinux.lds: consolidate initcall sections 2006-10-27 15:34:51 -07:00
i386 [PATCH] Use delayed disable mode of ioapic edge triggered interrupts 2006-11-15 09:04:32 -08:00
ia64 [IA64] a fix towards allmodconfig build 2006-11-16 11:25:12 -08:00
m32r [PATCH] vmlinux.lds: consolidate initcall sections 2006-10-27 15:34:51 -07:00
m68k [PATCH] m68k: consolidate initcall sections 2006-10-29 12:07:41 -08:00
m68knommu [PATCH] vmlinux.lds: consolidate initcall sections 2006-10-27 15:34:51 -07:00
mips [MIPS] Fix EV64120 and Ocelot builds by providing a plat_timer_setup(). 2006-11-06 20:55:39 +00:00
parisc [PATCH] vmlinux.lds: consolidate initcall sections 2006-10-27 15:34:51 -07:00
powerpc [PATCH] hugetlb: prepare_hugepage_range check offset too 2006-11-14 09:09:27 -08:00
ppc [POWERPC] Make alignment exception always check exception table 2006-11-01 15:16:04 +11:00
s390 [S390] IRQs too early enabled. 2006-11-06 10:49:02 +01:00
sh sh: Titan defconfig update. 2006-10-31 12:53:29 +09:00
sh64 [PATCH] vmlinux.lds: consolidate initcall sections 2006-10-27 15:34:51 -07:00
sparc [SPARC]: Fix robust futex syscalls and wire up migrate_pages. 2006-11-05 16:51:03 -08:00
sparc64 [SPARC]: Fix robust futex syscalls and wire up migrate_pages. 2006-11-05 16:51:03 -08:00
um [PATCH] uml: include tidying 2006-11-03 12:27:59 -08:00
v850 [PATCH] vmlinux.lds: consolidate initcall sections 2006-10-27 15:34:51 -07:00
x86_64 [PATCH] x86_64: stack unwinder crash fix 2006-11-17 08:20:09 -08:00
xtensa [PATCH] vmlinux.lds: consolidate initcall sections 2006-10-27 15:34:51 -07:00