umber-kernel/arch/parisc/kernel
Helge Deller fd9f30d103 parisc: Avoid crash due to unaligned access in unwinder
Guenter Roeck reported this kernel crash on his emulated B160L machine:

Starting network: udhcpc: started, v1.36.1
 Backtrace:
  [<104320d4>] unwind_once+0x1c/0x5c
  [<10434a00>] walk_stackframe.isra.0+0x74/0xb8
  [<10434a6c>] arch_stack_walk+0x28/0x38
  [<104e5efc>] stack_trace_save+0x48/0x5c
  [<105d1bdc>] set_track_prepare+0x44/0x6c
  [<105d9c80>] ___slab_alloc+0xfc4/0x1024
  [<105d9d38>] __slab_alloc.isra.0+0x58/0x90
  [<105dc80c>] kmem_cache_alloc_noprof+0x2ac/0x4a0
  [<105b8e54>] __anon_vma_prepare+0x60/0x280
  [<105a823c>] __vmf_anon_prepare+0x68/0x94
  [<105a8b34>] do_wp_page+0x8cc/0xf10
  [<105aad88>] handle_mm_fault+0x6c0/0xf08
  [<10425568>] do_page_fault+0x110/0x440
  [<10427938>] handle_interruption+0x184/0x748
  [<11178398>] schedule+0x4c/0x190
  BUG: spinlock recursion on CPU#0, ifconfig/2420
  lock: terminate_lock.2+0x0/0x1c, .magic: dead4ead, .owner: ifconfig/2420, .owner_cpu: 0

While creating the stack trace, the unwinder uses the stack pointer to guess
the previous frame to read the previous stack pointer from memory.  The crash
happens, because the unwinder tries to read from unaligned memory and as such
triggers the unalignment trap handler which then leads to the spinlock
recursion and finally to a deadlock.

Fix it by checking the alignment before accessing the memory.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Cc: stable@vger.kernel.org # v6.12+
2025-11-04 12:21:59 +01:00
..
syscalls fs: introduce file_getattr and file_setattr syscalls 2025-07-02 17:05:17 +02:00
vdso32
vdso64
.gitignore
Makefile parisc: Add initial kernel-side perf_event support 2025-10-07 19:35:51 +02:00
alternative.c
asm-offsets.c arch: Add the macro COMPILE_OFFSETS to all the asm-offsets.c 2025-09-25 09:57:15 +02:00
audit.c
cache.c mm: introduce memdesc_flags_t 2025-09-13 16:55:07 -07:00
compat_audit.c
drivers.c parisc: Fix iodc and device path return values on old machines 2025-10-09 23:45:04 +02:00
entry.S parisc: Update comments in make_insert_tlb 2025-07-25 22:45:23 +02:00
firmware.c parisc: Firmware: Fix returned path for PDC_MODULE_FIND on older machines 2025-10-09 23:45:04 +02:00
ftrace.c
hardware.c
head.S
hpmc.S
inventory.c
irq.c
jump_label.c
kexec.c
kexec_file.c
kgdb.c
kprobes.c
module.c
pacache.S
parisc_ksyms.c
patch.c
pci-dma.c
pci.c
pdc_chassis.c
pdc_cons.c
pdt.c
perf.c
perf_asm.S
perf_event.c parisc: Add initial kernel-side perf_event support 2025-10-07 19:35:51 +02:00
perf_images.h
perf_regs.c parisc: Add initial kernel-side perf_event support 2025-10-07 19:35:51 +02:00
process.c arch: copy_thread: pass clone_flags as u64 2025-09-01 15:31:34 +02:00
processor.c
ptrace.c parisc: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names 2025-07-14 22:27:48 -07:00
real2.S
relocate_kernel.S
setup.c
signal.c
signal32.c
signal32.h
smp.c
stacktrace.c
sys_parisc.c parisc: constify mmap_upper_limit() parameter 2025-09-21 14:22:14 -07:00
sys_parisc32.c
syscall.S parisc: Revise gateway LWS calls to probe user read access 2025-07-25 22:45:24 +02:00
time.c
toc.c
toc_asm.S
topology.c
traps.c parisc: Report emulation faults via perf 2025-10-07 18:01:53 +02:00
unaligned.c parisc: Report software alignment faults via perf 2025-10-07 18:01:53 +02:00
unaligned.h
unwind.c parisc: Avoid crash due to unaligned access in unwinder 2025-11-04 12:21:59 +01:00
vdso.c
vmlinux.lds.S