Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#153 - KERNEL_DYNAMIC_FTRACE=y on mips => panic #7089

Closed
openwrt-bot opened this issue Sep 4, 2016 · 5 comments
Closed

FS#153 - KERNEL_DYNAMIC_FTRACE=y on mips => panic #7089

openwrt-bot opened this issue Sep 4, 2016 · 5 comments
Labels

Comments

@openwrt-bot
Copy link

github-import:

Github issue #129 reported by: https://github.com/stsydow

If KERNEL_DYNAMIC_FTRACE is enabled on a MIPS system it will panic in late boot. (tested on ar71xx and malta)
The error message is not very helpful, maybe some one has an idea how to track it down:

[ 5.579744] procd: - init -
Please press Enter to activate this console.
[ 5.854903] CPU 0 Unable to handle kernel paging request at virtual address 00c03849, epc == 8026a400, ra == 8026a3e4
[ 5.855392] Oops[#1]:
[ 5.855602] CPU: 0 PID: 1611 Comm: kmodloader Not tainted 4.4.13 #20
[ 5.855862] task: 8d86a0a0 ti: 8fa22000 task.ti: 8fa22000
[ 5.856060] $ 0 : 00000000 8026a3e4 80130620 00000000
[ 5.856380] $ 4 : 8dc48ab0 00000001 0000000e 81b97540
[ 5.856607] $ 8 : 0024f000 00003edc 00000000 00000001
[ 5.856795] $12 : 8d8410c0 00000025 00000000 6261745f
[ 5.856984] $16 : 8dc48a80 81980000 00c03821 801305f4
[ 5.857174] $20 : 8dc48ad9 80130620 0000001d 024000c0
[ 5.857362] $24 : 00000000 8015655c
[ 5.857569] $28 : 8fa22000 8fa23bd0 80194d48 8026a3e4
[ 5.857766] Hi : 00000018
[ 5.857863] Lo : 00000007
[ 5.858008] epc : 8026a400 proc_register+0x74/0x130
[ 5.858167] ra : 8026a3e4 proc_register+0x58/0x130
[ 5.858317] Status: 1000b703 KERNEL EXL IE
[ 5.858529] Cause : 00800008 (ExcCode 02)
[ 5.858655] BadVA : 00c03849
[ 5.858764] PrId : 00019300 (MIPS 24Kc)
[ 5.858895] Modules linked in: ip6_tables(+) x_tables mii
[ 5.859219] Process kmodloader (pid: 1611, threadinfo=8fa22000, task=8d86a0a0, tls=77528e48)
[ 5.859477] Stack : 8da50000 8026a1a4 8f898000 81b94a40 81945a40 8014d8c4 00000001 8dc48a80
8da4e540 00000000 8f9d6370 8da50000 8da50000 8026a724 00000000 80650000
8da4e400 00000000 8f9d6370 80650000 8da4e400 8da4d134 00000000 8d86a0e8
801305f4 00000000 00000000 5ce6d83d 81b94a40 61745f78 73656c62 6d616e5f
8d007365 0000af3b 81b94a40 81b94a40 8dad46b0 00000000 8fa23d30 80650000
...
[ 5.861631] Call Trace:
[ 5.861728] [<8026a400>] proc_register+0x74/0x130
[ 5.861954] [<8026a724>] proc_create_data+0xac/0xd8
[ 5.862188] [<8da4d134>] xt_proto_init+0xa4/0x1d0 [x_tables]
[ 5.862414] [<8042e640>] ops_init.constprop.9+0x10c/0x150
[ 5.862593] [<8042e71c>] register_pernet_operations.isra.4+0x98/0xec
[ 5.862796] [<8042e7a4>] register_pernet_subsys+0x34/0x58
[ 5.862986] [<8f9d7030>] init_module+0x28/0xcc [ip6_tables]
[ 5.863174] [<801006b4>] do_one_initcall+0x1f8/0x224
[ 5.863341] [<801c5c8c>] do_init_module+0x84/0x1f8
[ 5.863504] [<80197ca0>] load_module+0x1888/0x1d58
[ 5.863680] [<80198290>] SyS_init_module+0x120/0x164
[ 5.863846] [<80113908>] syscall_common+0x30/0x54
[ 5.864046]
[ 5.864130]
Code: 12400014 26040030 92060058 <92420028> 00c2182b 14600008 00000000 0046102b 14400009
[ 5.864794] ---[ end trace 6cd948b6ebb870af ]---

To test, try this config: [[https://github.com/lede-project/source/files/320658/config.zip|config.zip]]

(default config for malta-mips + KERNEL_DYNAMIC_FTRACE)
and run

qemu-system-mipsel -kernel bin/targets/malta/le/lede-malta-le-vmlinux-initramfs.elf -nographic -m 256

Full boot log: [[https://github.com/lede-project/source/files/320655/crash-dyn-trace.log.txt|crash-dyn-trace.log.txt]]

@openwrt-bot
Copy link
Author

github-import:

*blogic commented on Jun 30
**
i had a look at this last night, the panic happens when the nd_conntrack
modules get loaded. some die with an unaligned access, others with the error shown above.

@openwrt-bot
Copy link
Author

lynxis:

still happens with reboot-4214-g822ee54544

@openwrt-bot
Copy link
Author

mkresin:

It works as soon as:

  • Stack-Smashing Protection
  • buffer-overflows detection
  • RELRO protection

is disabled. Most likely not all of them need to be disabled.

@openwrt-bot
Copy link
Author

lynxis:

I still run into error, when disabling stack smashing, bufferoverflow in fortify source, and RELRO protection.

@openwrt-bot
Copy link
Author

lynxis:

I've a working patch to fix this. I'm testing the fix with a vanilla kernel to upstream it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant