Comments (5)
Both intrpt
and bottomhalf
were dedicated to Raspberry Pi. It is expectedly not working on x86-based VM instance.
from lkmpg.
The problems of chardev2.ko
and syscall.ko
have been fixed.
See the commit 06b7594 and cccc98a.
from lkmpg.
I wrote a simple shell script trying "insmod" and "rmmod" all module on my machine (5.11.0-27-generic) and meet following errors:
chardev2.ko
:
At first time insmod and rmmod didn't throw any errors, however when using command dmesg
, it shows:
[ 78.479322] chardev2: loading out-of-tree module taints kernel.
[ 78.479463] chardev2: module verification failed: signature and/or required key missing - tainting kernel
[ 78.480170] Device created on /dev/char_dev
And when I tried to insmod the module again, terminal shows:
insmod: ERROR: could not insert module chardev2.ko: Device or resource busy
And the output of dmesg
was:
[ 157.168167] Sorry, registering the character device failed with -16
bottomhalf.ko
:
intrpt.ko
:
When insmod bottomhalf.ko
or intrpt.ko
, the error was something like:
insmod: ERROR: could not insert module xxx.ko: Unknown error 517
And the output of dmesg
was:
Unable to request GPIOs for LEDs: -517
I think my board's GPIO number may be different from sample code, which cause this error.
But I currently don't know how to check GPIO number of my board.
syscall.ko
When insmod syscall.ko
first time, the terminal simply shows
killed
And the output of dmesg
was:
[ 384.864739] BUG: unable to handle page fault for address: ffff8aad47458000
[ 384.864755] #PF: supervisor read access in kernel mode
[ 384.864757] #PF: error_code(0x0000) - not-present page
[ 384.864758] PGD 1aa01067 P4D 1aa01067 PUD 4907ff067 PMD 4907fe067 PTE 0
[ 384.864761] Oops: 0000 [#1] SMP NOPTI
[ 384.864763] CPU: 3 PID: 3017 Comm: insmod Tainted: G OE 5.11.0-27-generic #29~20.04.1-Ubuntu
[ 384.864765] Hardware name: CJSCOPE INC. Z Series/Z Series, BIOS 1.07.07TCOP1 05/09/2019
[ 384.864766] RIP: 0010:syscall_start+0x15/0x1000 [syscall]
[ 384.864771] Code: Unable to access opcode bytes at RIP 0xffffffffc056bfeb.
[ 384.864772] RSP: 0018:ffff9ae78084bc80 EFLAGS: 00010293
[ 384.864774] RAX: ffff8aad47457fe8 RBX: 0000000000000000 RCX: 0000000000000000
[ 384.864775] RDX: ffff8aad47457fe8 RSI: ffffffff9b75cea8 RDI: ffffffffc056c000
[ 384.864776] RBP: ffff9ae78084bce8 R08: 0000000000000010 R09: ffff8aae578d7370
[ 384.864777] R10: ffff8ab1907d4b80 R11: 0000000000000000 R12: ffffffffc056c000
[ 384.864778] R13: ffff8aae578d7370 R14: 0000000000000000 R15: ffff9ae78084be70
[ 384.864779] FS: 00007f60559ef540(0000) GS:ffff8ab1806c0000(0000) knlGS:0000000000000000
[ 384.864781] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 384.864782] CR2: ffffffffc056bfeb CR3: 0000000109480002 CR4: 00000000003706e0
[ 384.864783] Call Trace:
[ 384.864785] ? do_one_initcall+0x48/0x1d0
[ 384.864789] ? _cond_resched+0x19/0x30
[ 384.864792] ? kmem_cache_alloc_trace+0x380/0x430
[ 384.864794] ? do_init_module+0x28/0x250
[ 384.864797] do_init_module+0x62/0x250
[ 384.864799] load_module+0x11aa/0x1370
[ 384.864802] ? security_kernel_post_read_file+0x5c/0x70
[ 384.864804] ? security_kernel_post_read_file+0x5c/0x70
[ 384.864807] __do_sys_finit_module+0xc2/0x120
[ 384.864809] ? __do_sys_finit_module+0xc2/0x120
[ 384.864811] __x64_sys_finit_module+0x1a/0x20
[ 384.864813] do_syscall_64+0x38/0x90
[ 384.864816] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 384.864818] RIP: 0033:0x7f6055b3489d
[ 384.864820] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d c3 f5 0c 00 f7 d8 64 89 01 48
[ 384.864821] RSP: 002b:00007ffcb7977a88 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[ 384.864823] RAX: ffffffffffffffda RBX: 00005607d93e97b0 RCX: 00007f6055b3489d
[ 384.864824] RDX: 0000000000000000 RSI: 00005607d7628358 RDI: 0000000000000003
[ 384.864825] RBP: 0000000000000000 R08: 0000000000000000 R09: 00007f6055c08260
[ 384.864826] R10: 0000000000000003 R11: 0000000000000246 R12: 00005607d7628358
[ 384.864827] R13: 0000000000000000 R14: 00005607d93e9760 R15: 0000000000000000
[ 384.864829] Modules linked in: syscall(OE+) snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic rfcomm ccm cmac algif_hash algif_skcipher af_alg bnep snd_sof_pci snd_sof_intel_hda_common intel_rapl_msr snd_soc_hdac_hda intel_rapl_common snd_sof_intel_hda x86_pkg_temp_thermal intel_powerclamp snd_sof_intel_byt coretemp snd_sof_intel_ipc snd_sof snd_sof_xtensa_dsp snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi nls_iso8859_1 ledtrig_audio kvm_intel snd_hda_intel snd_intel_dspcfg soundwire_intel soundwire_generic_allocation soundwire_cadence kvm snd_hda_codec crct10dif_pclmul snd_hda_core snd_hwdep soundwire_bus ghash_clmulni_intel mei_hdcp snd_soc_core snd_compress iwlmvm ac97_bus snd_pcm_dmaengine snd_pcm aesni_intel mac80211 crypto_simd cryptd glue_helper rapl i915 snd_seq_midi snd_seq_midi_event snd_rawmidi libarc4 intel_cstate iwlwifi uvcvideo videobuf2_vmalloc drm_kms_helper snd_seq videobuf2_memops btusb videobuf2_v4l2 btrtl videobuf2_common btbcm cec
[ 384.864864] snd_seq_device serio_raw btintel videodev snd_timer rc_core bluetooth mc intel_wmi_thunderbolt efi_pstore snd joydev input_leds cfg80211 ecdh_generic ee1004 ecc drm soundcore mei_me i2c_algo_bit mei fb_sys_fops syscopyarea sysfillrect sysimgblt intel_pch_thermal intel_hid mac_hid sparse_keymap acpi_pad sch_fq_codel msr parport_pc ppdev lp parport ip_tables x_tables autofs4 hid_generic usbhid hid rtsx_pci_sdmmc nvme thunderbolt nvme_core crc32_pclmul xhci_pci psmouse r8169 i2c_i801 ahci rtsx_pci i2c_smbus realtek libahci xhci_pci_renesas wmi video [last unloaded: chardev2]
[ 384.864894] CR2: ffff8aad47458000
[ 384.864895] ---[ end trace 5d56f581996be5cd ]---
[ 385.030373] RIP: 0010:syscall_start+0x15/0x1000 [syscall]
[ 385.030384] Code: Unable to access opcode bytes at RIP 0xffffffffc056bfeb.
[ 385.030385] RSP: 0018:ffff9ae78084bc80 EFLAGS: 00010293
[ 385.030387] RAX: ffff8aad47457fe8 RBX: 0000000000000000 RCX: 0000000000000000
[ 385.030388] RDX: ffff8aad47457fe8 RSI: ffffffff9b75cea8 RDI: ffffffffc056c000
[ 385.030389] RBP: ffff9ae78084bce8 R08: 0000000000000010 R09: ffff8aae578d7370
[ 385.030390] R10: ffff8ab1907d4b80 R11: 0000000000000000 R12: ffffffffc056c000
[ 385.030391] R13: ffff8aae578d7370 R14: 0000000000000000 R15: ffff9ae78084be70
[ 385.030392] FS: 00007f60559ef540(0000) GS:ffff8ab1806c0000(0000) knlGS:0000000000000000
[ 385.030394] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 385.030395] CR2: ffffffffc056bfeb CR3: 0000000109480002 CR4: 00000000003706e0
And when trying to insmod syscall.ko
again, terminal just freeze without any output.
start.ko
:
insmod seems worked well.
And no error message found in dmesg
:
Hello, world - this is the kernel speaking
However when trying to rmmod, terminal showed:
rmmod: ERROR: ../libkmod/libkmod-module.c:799 kmod_module_remove_module() could not remove 'start': Device or resource busy
rmmod: ERROR: could not remove module start: Device or resource busy
Perhaps we should fix these errors before we set up CI flows?
from lkmpg.
@linD026, can you help resolve the LKM problems?
from lkmpg.
In Multipass(5.4.0-80-generic), I also got the error messages with chardev2.ko
:
[ 65.668320] chardev2: loading out-of-tree module taints kernel.
[ 65.668338] chardev2: module verification failed: signature and/or required key missing - tainting kernel
[ 65.670278] Device created on /dev/char_dev
Checking out this guide found out:
ubuntu@ubuntu:~/lkmpg/examples$ sudo insmod chardev2.ko
ubuntu@ubuntu:~/lkmpg/examples$ cat /proc/sys/kernel/tainted
12288
ubuntu@ubuntu:~/lkmpg/examples$ for i in $(seq 18); do echo $(($i-1)) $(($(cat /proc/sys/kernel/tainted)>>($i-1)&1));done
0 0
1 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0
10 0
11 0
12 1
13 1
14 0
15 0
16 0
17 0
12 O if an externally-built (“out-of-tree”) module has been loaded.
13 E if an unsigned module has been loaded in a kernel supporting module signature.
I still looking at why this happen.
from lkmpg.
Related Issues (20)
- procfs3.ko used by -1 HOT 2
- procfs2.c vs. procfs3.c HOT 1
- 11.1 Sleep chapter. API module_interruptible_sleep_on HOT 1
- Reason to reset the offset HOT 2
- Smatch repository is unavailable HOT 1
- Build kernel module for Rpi3MB HOT 1
- Building kernel modules in RpiOS32bit/Rpi3MB platform HOT 2
- lkmpg on RpiOsLite/rpi3MB HOT 1
- Consistent usage of __init and __exit HOT 1
- About 16.2 Symmetric key encryption sample code HOT 2
- examples/kbleds.c:64:55: error: ‘struct tty_driver’ has no member named ‘magic’
- Building kbleds.ko on RpiOSLite64bit (Linux 6.1.21-v8+) HOT 4
- examples/sched.ko HOT 4
- Module parameters callback : be notified when a parameter is updated
- Little introduction to debugfs
- About /proc, try_module_get and python3 HOT 3
- If you want to build device drivers for an cross target (yocto build) ... HOT 1
- typo
- Linux HOT 1
- Talking to other subsystems
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lkmpg.