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

Linux 5.18 と Intel 11世代以降の CPU でカーネルモジュールが動作しない #24

Open
rokoucha opened this issue Jul 27, 2022 · 0 comments

Comments

@rokoucha
Copy link

rokoucha commented Jul 27, 2022

Linux 5.18 と Intel 11世代以降の CPU でカーネルモジュールが読み込まれず、デバイスファイルが生成されませんでした。

dmseg を見ると、以下のエラーが発生していました。

[    2.989685] px4_drv: loading out-of-tree module taints kernel.
[    3.015334] px4_drv: module verification failed: signature and/or required key missing - tainting kernel
[    3.016303] traps: Missing ENDBR: init_module+0x0/0x1a [px4_drv]
[    3.016322] ------------[ cut here ]------------
[    3.016323] kernel BUG at arch/x86/kernel/traps.c:252!
[    3.016329] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
[    3.016333] CPU: 3 PID: 251 Comm: systemd-udevd Tainted: G           OE     5.18.14-arch1-1 #1 2cce37e37e4ad1ef84b589b4dfa593feee5baa49
[    3.016338] Hardware name: Intel(R) Client Systems NUC11PAHi3/NUC11PABi3, BIOS PATGL357.0035.2020.1113.1353 11/13/2020
[    3.016341] RIP: 0010:exc_control_protection+0xc2/0xd0
[    3.016347] Code: 8b 93 80 00 00 00 be f9 00 00 00 48 c7 c7 33 ec 26 b5 e8 81 8d 4d ff e9 72 ff ff ff 48 c7 c7 1a ec 26 b5 e8 02 24 fb ff 0f 0b <0f> 0b 66 66 2e 0f 1f 84 00 00 00 00 00 90 66 0f 1f 00 55 53 48 89
[    3.016353] RSP: 0018:ffffab82003bfcd8 EFLAGS: 00010002
[    3.016356] RAX: 0000000000000034 RBX: ffffab82003bfcf8 RCX: 0000000000000027
[    3.016359] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff93d2a87a16a0
[    3.016362] RBP: 0000000000000003 R08: 0000000000000000 R09: ffffab82003bfaf8
[    3.016365] R10: 0000000000000003 R11: ffffffffb5acaa08 R12: 0000000000000000
[    3.016367] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
[    3.016370] FS:  00007f7033868480(0000) GS:ffff93d2a8780000(0000) knlGS:0000000000000000
[    3.016373] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    3.016376] CR2: 00007f7032950000 CR3: 00000001047dc006 CR4: 0000000000f70ee0
[    3.016379] PKRU: 55555554
[    3.016381] Call Trace:
[    3.016384]  <TASK>
[    3.016386]  asm_exc_control_protection+0x25/0x30
[    3.016391] RIP: 0010:init_module+0x0/0x1a [px4_drv]
[    3.016403] Code: c0 0f 95 c0 c3 cc cc cc cc 66 66 2e 0f 1f 84 00 00 00 00 00 66 0f 1f 00 0f 1f 44 00 00 8b 47 38 85 c0 0f 95 c0 c3 cc cc cc cc <66> 0f 1f 00 0f 1f 44 00 00 48 c7 c7 d0 65 b2 c0 e8 67 13 e5 f3 e9
[    3.016408] RSP: 0018:ffffab82003bfda8 EFLAGS: 00010246
[    3.016410] RAX: 0000000000000000 RBX: ffffffffc0b20a06 RCX: 0000000000000000
[    3.016413] RDX: 0000000000000000 RSI: ffffffffc0b20a06 RDI: ffffab82003bfd90
[    3.016416] RBP: ffffab82003bfdb0 R08: 0000000000000010 R09: ffff93d10405bf40
[    3.016418] R10: ffff93d1039b8700 R11: ffff93d2b07fc000 R12: 0000000000000000
[    3.016421] R13: 000055c2910b100d R14: 00007f7034375343 R15: ffffab82003bfe48
[    3.016424]  ? ringbuffer_is_readable+0x16/0x16 [px4_drv 3c15070c798705fe9ead6f375364005ae7ed338a]
[    3.016436]  ? ringbuffer_is_readable+0x16/0x16 [px4_drv 3c15070c798705fe9ead6f375364005ae7ed338a]
[    3.016449]  do_one_initcall+0x5a/0x220
[    3.016455]  do_init_module+0x4a/0x250
[    3.016459]  __do_sys_init_module+0x138/0x1b0
[    3.016464]  do_syscall_64+0x5c/0x90
[    3.016468]  ? exc_page_fault+0x74/0x170
[    3.016471]  entry_SYSCALL_64_after_hwframe+0x61/0xcb
[    3.016475] RIP: 0033:0x7f703420e99e
[    3.016478] Code: 48 8b 0d fd a3 0e 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 49 89 ca b8 af 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d ca a3 0e 00 f7 d8 64 89 01 48
[    3.016483] RSP: 002b:00007fff5a7d6328 EFLAGS: 00000246 ORIG_RAX: 00000000000000af
[    3.016486] RAX: ffffffffffffffda RBX: 000055c290f64520 RCX: 00007f703420e99e
[    3.016489] RDX: 00007f7034375343 RSI: 000000000005ea1d RDI: 000055c2910525f0
[    3.016492] RBP: 00007f7034375343 R08: 27d4eb2f165667c5 R09: 85ebca77c2b2ae63
[    3.016494] R10: 00000000000e9631 R11: 0000000000000246 R12: 0000000000020000
[    3.016497] R13: 000055c290f63be0 R14: 000055c290f64520 R15: 000055c290f66bb0
[    3.016501]  </TASK>
[    3.016502] Modules linked in: px4_drv(OE+) fjes(+) acpi_cpufreq(-) drm_buddy ttm drm_dp_helper thunderbolt(+) ucsi_acpi intel_gtt typec_ucsi nft_limit typec roles wmi nft_ct nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables nfnetlink tpm_crb tpm_tis video tpm_tis_core tpm rng_core vfat fat acpi_pad acpi_tad mac_hid crypto_user fuse bpf_preload ip_tables x_tables btrfs blake2b_generic libcrc32c crc32c_generic xor raid6_pq rtsx_pci_sdmmc mmc_core crc32c_intel nvme xhci_pci rtsx_pci nvme_core xhci_pci_renesas
[    3.016542] ---[ end trace 0000000000000000 ]---
[    3.016544] RIP: 0010:exc_control_protection+0xc2/0xd0
[    3.016548] Code: 8b 93 80 00 00 00 be f9 00 00 00 48 c7 c7 33 ec 26 b5 e8 81 8d 4d ff e9 72 ff ff ff 48 c7 c7 1a ec 26 b5 e8 02 24 fb ff 0f 0b <0f> 0b 66 66 2e 0f 1f 84 00 00 00 00 00 90 66 0f 1f 00 55 53 48 89
[    3.016553] RSP: 0018:ffffab82003bfcd8 EFLAGS: 00010002
[    3.016556] RAX: 0000000000000034 RBX: ffffab82003bfcf8 RCX: 0000000000000027
[    3.016558] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff93d2a87a16a0
[    3.016561] RBP: 0000000000000003 R08: 0000000000000000 R09: ffffab82003bfaf8
[    3.016563] R10: 0000000000000003 R11: ffffffffb5acaa08 R12: 0000000000000000
[    3.016566] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
[    3.016569] FS:  00007f7033868480(0000) GS:ffff93d2a8780000(0000) knlGS:0000000000000000
[    3.016572] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    3.016574] CR2: 00007f7032950000 CR3: 00000001047dc006 CR4: 0000000000f70ee0
[    3.016577] PKRU: 55555554

Linux 5.18 で Indirect Branch Tracking という仕組みが導入されたらしく、Tiger Lake 以降の CPU で IBT が動作するようです。
現状ではカーネルパラメータで ibt=off として無効化することで正しくカーネルモジュールが読み込まれるようになります。

確認した環境は以下の通りです。
px4_drv: 7fa9f05 with pxw3u4_BDA_ver1x64
CPU: 11th Gen Intel(R) Core(TM) i3-1115G4 @ 3.00GHz
Kernel: Linux localhost 5.18.14-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 23 Jul 2022 11:46:17 +0000 x86_64 GNU/Linux

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

No branches or pull requests

1 participant