Mips32 Kexec crashes running kernel 21.02-RC3 (MT7621 Target)

Strontium strntydog at gmail.com
Tue Jun 22 03:59:15 PDT 2021


OK, so i worked out mips kexec needs an .elf file.  So, i got the kernel
.elf from the targets build.  It is the same kernel that is running in
the board, so in theory, kexecing it should just restart the kernel.

So, i scp vmlinux.elf to /tmp

run:

# kexec /tmp/vmlinux.elf

and it crashes,  same as if i run kexec -l.

It is complaining that the kernel is attempting to over-write its own
memory.  Which would make sense, except i would expect kexec to handle
that properly.  What am i doing wrong?

Output from the command:

Modified cmdline:
Unable to find /proc/device-tree/chosen/[linux,]stdout-path, printing
from purgatory is disabled
[  135.527029] kexec command line truncated to 256 bytes
[  135.532110] usercopy: Kernel memory overwrite attempt detected to
kernel text (offset 81828, size 256)!
[  135.541512] Kernel bug detected[#1]:
[  135.545080] CPU: 2 PID: 2020 Comm: kexec Not tainted 5.4.124 #0
[  135.550971] $ 0   : 00000000 00000001 0000005b 00000000
[  135.556181] $ 4   : 8101c34c 8101c34c 81021070 000001b0
[  135.561389] $ 8   : 00000000 74657366 38313820 202c3832
[  135.566596] $12   : 656e696c ffffff7f 00000001 75727420
[  135.571806] $16   : 800153a4 00000100 00000000 800154a4
[  135.577014] $20   : 0041e02c 80010000 00000000 00000000
[  135.582222] $24   : 00000002 802a8db0                 
[  135.587431] $28   : 8f340000 8f341e50 80550000 8012ecc4
[  135.592640] Hi    : 00000122
[  135.595505] Lo    : d1768000
[  135.598399] epc   : 8012ecc4 usercopy_abort+0x94/0x98
[  135.603430] ra    : 8012ecc4 usercopy_abort+0x94/0x98
[  135.608455] Status: 11007c03 KERNEL EXL IE
[  135.612625] Cause : 50800024 (ExcCode 09)
[  135.616615] PrId  : 0001992f (MIPS 1004Kc)
[  135.620688] Modules linked in: mt7915e mt76 mac80211 cfg80211 hwmon
crc_ccitt compat leds_gpio gpio_button_hotplug zram zsmalloc
[  135.632238] Process kexec (pid: 2020, threadinfo=ed102de2,
task=6523d5dc, tls=77ed1ec8)
[  135.640201] Stack : 8e092c00 804db438 80523508 804db560 804d4284
804d4284 804d4284 00013fa4
[  135.648529]         00000100 8e092c00 00000000 8012ee1c 804c65bc
8f341eb4 0041e02c 80064a84
[  135.656856]         00000100 8e092c00 38e38e39 00000100 80015378
8e092c00 80010000 80014c9c
[  135.665184]         8f341eb0 00000100 00000006 804c65ba 8e092c00
806c8fe8 00000000 8e092c20
[  135.673511]         00000000 00000003 00000000 80097ae4 00000000
80109640 60d1c076 00000000
[  135.681837]         ...
[  135.684275] Call Trace:
[  135.686714] [<8012ecc4>] usercopy_abort+0x94/0x98
[  135.691406] [<8012ee1c>] __check_object_size+0x154/0x1c4
[  135.696714] [<80014c9c>] machine_kexec_prepare+0x124/0x2c4
[  135.702189] [<80097ae4>] sys_kexec_load+0x268/0x39c
[  135.707049] [<800135d8>] syscall_common+0x34/0x58
[  135.711738] Code: afa30010  0c019299  2484b4dc <000c000d> 3c028053 
8c422da0  1c40006c  00000000  27bdffd0
[  135.721456]
[  135.723231] ---[ end trace cb64d01840ff96a3 ]---
[  135.727845] Kernel panic - not syncing: Fatal exception
[  135.733082] Rebooting in 3 seconds..




More information about the openwrt-devel mailing list