android_kernel_motorola_sm6225/arch
Jiri Slaby 5f01c98859 x86/dumpstack: Fix printk_address for direct addresses
Consider a kernel crash in a module, simulated the following way:

 static int my_init(void)
 {
         char *map = (void *)0x5;
         *map = 3;
         return 0;
 }
 module_init(my_init);

When we turn off FRAME_POINTERs, the very first instruction in
that function causes a BUG. The problem is that we print IP in
the BUG report using %pB (from printk_address). And %pB
decrements the pointer by one to fix printing addresses of
functions with tail calls.

This was added in commit 71f9e59800 ("x86, dumpstack: Use
%pB format specifier for stack trace") to fix the call stack
printouts.

So instead of correct output:

  BUG: unable to handle kernel NULL pointer dereference at 0000000000000005
  IP: [<ffffffffa01ac000>] my_init+0x0/0x10 [pb173]

We get:

  BUG: unable to handle kernel NULL pointer dereference at 0000000000000005
  IP: [<ffffffffa0152000>] 0xffffffffa0151fff

To fix that, we use %pS only for stack addresses printouts (via
newly added printk_stack_address) and %pB for regs->ip (via
printk_address). I.e. we revert to the old behaviour for all
except call stacks. And since from all those reliable is 1, we
remove that parameter from printk_address.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: joe@perches.com
Cc: jirislaby@gmail.com
Link: http://lkml.kernel.org/r/1382706418-8435-1-git-send-email-jslaby@suse.cz
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2013-11-12 21:06:06 +01:00
..
alpha sched, arch: Create asm/preempt.h 2013-09-25 14:07:50 +02:00
arc Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-11-12 10:20:12 +09:00
arm Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-11-12 10:36:00 +09:00
arm64 Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-11-12 10:36:00 +09:00
avr32 Linux 3.12-rc4 2013-10-09 12:36:13 +02:00
blackfin sched, arch: Create asm/preempt.h 2013-09-25 14:07:50 +02:00
c6x sched, arch: Create asm/preempt.h 2013-09-25 14:07:50 +02:00
cris sched, arch: Create asm/preempt.h 2013-09-25 14:07:50 +02:00
frv sched, arch: Create asm/preempt.h 2013-09-25 14:07:50 +02:00
h8300 sched, arch: Create asm/preempt.h 2013-09-25 14:07:50 +02:00
hexagon sched, arch: Create asm/preempt.h 2013-09-25 14:07:50 +02:00
ia64 Merge branch 'x86-mce-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-11-12 11:16:44 +09:00
m32r sched, arch: Create asm/preempt.h 2013-09-25 14:07:50 +02:00
m68k Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-11-12 10:20:12 +09:00
metag Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-11-12 10:20:12 +09:00
microblaze sched, arch: Create asm/preempt.h 2013-09-25 14:07:50 +02:00
mips Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-11-12 10:20:12 +09:00
mn10300 sched, arch: Create asm/preempt.h 2013-09-25 14:07:50 +02:00
openrisc Linux 3.12-rc4 2013-10-09 12:36:13 +02:00
parisc Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-11-12 10:20:12 +09:00
powerpc Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-11-12 10:20:12 +09:00
s390 Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-11-12 10:20:12 +09:00
score Linux 3.12-rc4 2013-10-09 12:36:13 +02:00
sh Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-11-12 10:20:12 +09:00
sparc Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-11-12 10:20:12 +09:00
tile Merge branch 'core/urgent' into sched/core 2013-10-11 07:39:37 +02:00
um Merge branch 'linus' into sched/core 2013-11-01 08:24:41 +01:00
unicore32 sched, arch: Create asm/preempt.h 2013-09-25 14:07:50 +02:00
x86 x86/dumpstack: Fix printk_address for direct addresses 2013-11-12 21:06:06 +01:00
xtensa Merge branch 'linus' into sched/core 2013-11-01 08:24:41 +01:00
.gitignore
Kconfig Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-11-12 10:36:00 +09:00