linux_dsm_epyc7002/arch
Josh Poimboeuf 8023e0e2a4 x86/unwind: Adjust last frame check for aligned function stacks
Somehow, CONFIG_PARAVIRT=n convinces gcc to change the
x86_64_start_kernel() prologue from:

  0000000000000129 <x86_64_start_kernel>:
   129:	55                   	push   %rbp
   12a:	48 89 e5             	mov    %rsp,%rbp

to:

  0000000000000124 <x86_64_start_kernel>:
   124:	4c 8d 54 24 08       	lea    0x8(%rsp),%r10
   129:	48 83 e4 f0          	and    $0xfffffffffffffff0,%rsp
   12d:	41 ff 72 f8          	pushq  -0x8(%r10)
   131:	55                   	push   %rbp
   132:	48 89 e5             	mov    %rsp,%rbp

This is an unusual pattern which aligns rsp (though in this case it's
already aligned) and saves the start_cpu() return address again on the
stack before storing the frame pointer.

The unwinder assumes the last stack frame header is at a certain offset,
but the above code breaks that assumption, resulting in the following
warning:

  WARNING: kernel stack frame pointer at ffffffff82e03f40 in swapper:0 has bad value           (null)

Fix it by checking for the last task stack frame at the aligned offset
in addition to the normal unaligned offset.

Fixes: acb4608ad1 ("x86/unwind: Create stack frames for saved syscall registers")
Reported-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Link: http://lkml.kernel.org/r/9d7b4eb8cf55a7d6002cb738f25c23e7429c99a0.1481904011.git.jpoimboe@redhat.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2016-12-19 11:47:05 +01:00
..
alpha Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2016-12-14 14:09:48 -08:00
arc ARC updates for 4.10-rc1 (part 1) 2016-12-15 14:15:17 -08:00
arm MTD updates for v4.10-rc1: 2016-12-17 16:41:10 -08:00
arm64 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-12-18 11:12:53 -08:00
avr32 arch/avr32: add option to skip sync on DMA map 2016-12-14 16:04:07 -08:00
blackfin Merge branch 'akpm' (patches from Andrew) 2016-12-14 17:25:18 -08:00
c6x arch/c6x: add option to skip sync on DMA map and unmap 2016-12-14 16:04:07 -08:00
cris Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2016-12-14 14:09:48 -08:00
frv arch/frv: add option to skip sync on DMA map 2016-12-14 16:04:07 -08:00
h8300 locking/core: Provide common cpu_relax_yield() definition 2016-11-17 08:17:36 +01:00
hexagon arch/hexagon: Add option to skip DMA sync as a part of mapping 2016-12-14 16:04:07 -08:00
ia64 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-12-18 11:12:53 -08:00
m32r m32r: fix build warning 2016-12-12 18:55:06 -08:00
m68k arch/m68k: add option to skip DMA sync as a part of mapping 2016-12-14 16:04:07 -08:00
metag arch/metag: add option to skip DMA sync as a part of map and unmap 2016-12-14 16:04:07 -08:00
microblaze arch/microblaze: add option to skip DMA sync as a part of map and unmap 2016-12-14 16:04:07 -08:00
mips RTC for 4.10 2016-12-18 18:18:03 -08:00
mn10300 Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-12-12 10:48:02 -08:00
nios2 nios2 update for v4.10-rc1 2016-12-16 09:33:16 -08:00
openrisc arch/openrisc: add option to skip DMA sync as a part of mapping 2016-12-14 16:04:07 -08:00
parisc arch/parisc: add option to skip DMA sync as a part of map and unmap 2016-12-14 16:04:07 -08:00
powerpc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2016-12-17 18:44:00 -08:00
s390 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2016-12-16 09:05:25 -08:00
score locking/core: Provide common cpu_relax_yield() definition 2016-11-17 08:17:36 +01:00
sh Merge branch 'akpm' (patches from Andrew) 2016-12-14 17:25:18 -08:00
sparc sparc: implement watchdog_nmi_enable and watchdog_nmi_disable 2016-12-14 16:04:08 -08:00
tile Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile 2016-12-17 17:05:49 -08:00
um Merge branch 'for-linus-4.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml 2016-12-16 09:35:03 -08:00
unicore32 locking/core: Provide common cpu_relax_yield() definition 2016-11-17 08:17:36 +01:00
x86 x86/unwind: Adjust last frame check for aligned function stacks 2016-12-19 11:47:05 +01:00
xtensa arch/xtensa: add option to skip DMA sync as a part of mapping 2016-12-14 16:04:08 -08:00
.gitignore
Kconfig Minor changes to the gcc plugins: 2016-12-13 09:22:21 -08:00