ejcosta / clevo-keyboard-backlight

Driver for Clevo keyboards w/backlights
29 stars 14 forks source link

Null pointer #5

Open Kassec opened 5 years ago

Kassec commented 5 years ago

Hi,

On Ubuntu bionic, kernel 4.18.0-18, there's an issue when inserting the module:

Apr 30 15:55:23 i508 kernel: [ 6198.480710] tuxedo_wmi: loading out-of-tree module taints kernel. Apr 30 15:55:23 i508 kernel: [ 6198.480799] tuxedo_wmi: module verification failed: signature and/or required key missing - tainting kernel Apr 30 15:55:23 i508 kernel: [ 6198.485421] input: Clevo Airplane-Mode Hotkey as /devices/platform/tuxedo_wmi/input/input51 Apr 30 15:55:23 i508 kernel: [ 6198.485570] tuxedo_wmi: Polling thread started (PID: 20000), polling at 5 Hz Apr 30 15:55:23 i508 kernel: [ 6198.487335] BUG: unable to handle kernel NULL pointer dereference at 0000000000000018 Apr 30 15:55:23 i508 kernel: [ 6198.487338] PGD 0 P4D 0 Apr 30 15:55:23 i508 kernel: [ 6198.487341] Oops: 0000 [#1] SMP NOPTI Apr 30 15:55:23 i508 kernel: [ 6198.487345] CPU: 0 PID: 19999 Comm: modprobe Tainted: G OE 4.18.0-18-generic #19~18.04.1-Ubuntu Apr 30 15:55:23 i508 kernel: [ 6198.487347] Hardware name: Notebook N150ZU /N150ZU , BIOS 1.07.04 01/03/2019 Apr 30 15:55:23 i508 kernel: [ 6198.487352] RIP: 0010:tuxedo_init+0x30b/0xfcd [tuxedo_wmi] Apr 30 15:55:23 i508 kernel: [ 6198.487353] Code: ff ff e8 45 66 e8 f1 48 c7 05 62 bd ff ff 00 00 00 00 48 c7 c7 08 38 e2 c0 e8 81 d1 ec f1 48 8b 05 7f bd ff ff bf 01 00 00 00 <48> 8b 40 18 e8 b9 9c 9d f2 48 8b 05 6a bd ff ff 48 8b 40 20 e8 a9 Apr 30 15:55:23 i508 kernel: [ 6198.487384] RSP: 0018:ffffa047c38bbc60 EFLAGS: 00010246 Apr 30 15:55:23 i508 kernel: [ 6198.487386] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 Apr 30 15:55:23 i508 kernel: [ 6198.487388] RDX: ffff8d1a7a9c9780 RSI: ffffffffb3448290 RDI: 0000000000000001 Apr 30 15:55:23 i508 kernel: [ 6198.487390] RBP: ffffa047c38bbc70 R08: 0000000000000000 R09: ffffa047c38bba78 Apr 30 15:55:23 i508 kernel: [ 6198.487391] R10: 0000000000000000 R11: 0000000000000356 R12: ffffffffc0e29033 Apr 30 15:55:23 i508 kernel: [ 6198.487393] R13: ffff8d1997a971e0 R14: 0000000000000001 R15: ffff8d197bc96600 Apr 30 15:55:23 i508 kernel: [ 6198.487396] FS: 00007fca5f53a540(0000) GS:ffff8d1b90400000(0000) knlGS:0000000000000000 Apr 30 15:55:23 i508 kernel: [ 6198.487397] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 Apr 30 15:55:23 i508 kernel: [ 6198.487399] CR2: 0000000000000018 CR3: 0000000679564001 CR4: 00000000003606f0 Apr 30 15:55:23 i508 kernel: [ 6198.487401] Call Trace: Apr 30 15:55:23 i508 kernel: [ 6198.487406] do_one_initcall+0x4a/0x1c9 Apr 30 15:55:23 i508 kernel: [ 6198.487410] ? free_pcp_prepare+0x4f/0xc0 Apr 30 15:55:23 i508 kernel: [ 6198.487413] ? _cond_resched+0x19/0x40 Apr 30 15:55:23 i508 kernel: [ 6198.487416] ? kmem_cache_alloc_trace+0x166/0x1c0 Apr 30 15:55:23 i508 kernel: [ 6198.487419] ? do_init_module+0x27/0x209 Apr 30 15:55:23 i508 kernel: [ 6198.487422] do_init_module+0x5f/0x209 Apr 30 15:55:23 i508 kernel: [ 6198.487425] load_module+0x1930/0x1f60 Apr 30 15:55:23 i508 kernel: [ 6198.487430] do_sys_finit_module+0xfc/0x120 Apr 30 15:55:23 i508 kernel: [ 6198.487432] ? __do_sys_finit_module+0xfc/0x120 Apr 30 15:55:23 i508 kernel: [ 6198.487436] x64_sys_finit_module+0x1a/0x20 Apr 30 15:55:23 i508 kernel: [ 6198.487438] do_syscall_64+0x5a/0x120 Apr 30 15:55:23 i508 kernel: [ 6198.487441] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Apr 30 15:55:23 i508 kernel: [ 6198.487444] RIP: 0033:0x7fca5f05e839 Apr 30 15:55:23 i508 kernel: [ 6198.487445] Code: 00 f3 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 1f f6 2c 00 f7 d8 64 89 01 48 Apr 30 15:55:23 i508 kernel: [ 6198.487475] RSP: 002b:00007ffcfa6480f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 Apr 30 15:55:23 i508 kernel: [ 6198.487478] RAX: ffffffffffffffda RBX: 0000561bbfbcc180 RCX: 00007fca5f05e839 Apr 30 15:55:23 i508 kernel: [ 6198.487480] RDX: 0000000000000000 RSI: 0000561bbdd1ed2e RDI: 0000000000000003 Apr 30 15:55:23 i508 kernel: [ 6198.487481] RBP: 0000561bbdd1ed2e R08: 0000000000000000 R09: 0000000000000000 Apr 30 15:55:23 i508 kernel: [ 6198.487483] R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000000 Apr 30 15:55:23 i508 kernel: [ 6198.487485] R13: 0000561bbfbcc100 R14: 0000000000040000 R15: 0000561bbfbcc180 Apr 30 15:55:23 i508 kernel: [ 6198.487487] Modules linked in: tuxedo_wmi(OE+) rfcomm snd_usb_audio snd_usbmidi_lib cdc_ether usbnet r8152 ccm xt_CHECKSUM iptable_mangle ipt_MASQUERADE iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack ipt_REJECT nf_reject_ipv4 xt_tcpudp bridge stp llc ebtable_filter ebtables devlink ip6table_filter ip6_tables iptable_filter bpfilter cmac bnep uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 btusb videobuf2_common btrtl btbcm videodev btintel media bluetooth ecdh_generic nls_iso8859_1 snd_hda_codec_hdmi snd_soc_skl snd_soc_skl_ipc snd_soc_sst_ipc snd_soc_sst_dsp snd_hda_ext_core snd_soc_acpi snd_soc_core snd_hda_codec_realtek snd_compress snd_hda_codec_generic ac97_bus snd_pcm_dmaengine hid_multitouch snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep Apr 30 15:55:23 i508 kernel: [ 6198.487528] intel_rapl snd_pcm x86_pkg_temp_thermal intel_powerclamp snd_seq_midi coretemp snd_seq_midi_event snd_rawmidi arc4 kvm_intel kvm snd_seq irqbypass intel_cstate snd_seq_device iwlmvm mac80211 snd_timer intel_rapl_perf rtsx_pci_ms joydev input_leds idma64 iwlwifi virt_dma snd intel_wmi_thunderbolt memstick mei_me intel_lpss_pci intel_hid serio_raw mei intel_lpss mac_hid soundcore sparse_keymap intel_pch_thermal cfg80211 acpi_pad sch_fq_codel parport_pc ppdev lp parport ip_tables x_tables autofs4 btrfs xor zstd_compress raid6_pq libcrc32c algif_skcipher af_alg dm_crypt hid_logitech_hidpp hid_logitech_dj hid_generic usbhid crct10dif_pclmul crc32_pclmul ghash_clmulni_intel rtsx_pci_sdmmc i915 pcbc i2c_algo_bit aesni_intel drm_kms_helper aes_x86_64 syscopyarea crypto_simd sysfillrect cryptd Apr 30 15:55:23 i508 kernel: [ 6198.487608] sysimgblt fb_sys_fops glue_helper thunderbolt psmouse drm r8169 rtsx_pci ahci mii i2c_hid libahci hid wmi video Apr 30 15:55:23 i508 kernel: [ 6198.487619] CR2: 0000000000000018 Apr 30 15:55:23 i508 kernel: [ 6198.487621] ---[ end trace 213983d8d5528493 ]--- Apr 30 15:55:23 i508 kernel: [ 6198.487625] RIP: 0010:tuxedo_init+0x30b/0xfcd [tuxedo_wmi] Apr 30 15:55:23 i508 kernel: [ 6198.487627] Code: ff ff e8 45 66 e8 f1 48 c7 05 62 bd ff ff 00 00 00 00 48 c7 c7 08 38 e2 c0 e8 81 d1 ec f1 48 8b 05 7f bd ff ff bf 01 00 00 00 <48> 8b 40 18 e8 b9 9c 9d f2 48 8b 05 6a bd ff ff 48 8b 40 20 e8 a9 Apr 30 15:55:23 i508 kernel: [ 6198.487663] RSP: 0018:ffffa047c38bbc60 EFLAGS: 00010246 Apr 30 15:55:23 i508 kernel: [ 6198.487666] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 Apr 30 15:55:23 i508 kernel: [ 6198.487667] RDX: ffff8d1a7a9c9780 RSI: ffffffffb3448290 RDI: 0000000000000001 Apr 30 15:55:23 i508 kernel: [ 6198.487670] RBP: ffffa047c38bbc70 R08: 0000000000000000 R09: ffffa047c38bba78 Apr 30 15:55:23 i508 kernel: [ 6198.487672] R10: 0000000000000000 R11: 0000000000000356 R12: ffffffffc0e29033 Apr 30 15:55:23 i508 kernel: [ 6198.487673] R13: ffff8d1997a971e0 R14: 0000000000000001 R15: ffff8d197bc96600 Apr 30 15:55:23 i508 kernel: [ 6198.487676] FS: 00007fca5f53a540(0000) GS:ffff8d1b90400000(0000) knlGS:0000000000000000 Apr 30 15:55:23 i508 kernel: [ 6198.487677] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 Apr 30 15:55:23 i508 kernel: [ 6198.487679] CR2: 0000000000000018 CR3: 0000000679564001 CR4: 00000000003606f0

cwendling commented 2 years ago

AFAICT this happens if the module is loaded on unsupported hardware. Somehow a check for whether the hardware matched is missing I guess, but AIUI the crash happens when calling kb_backlight.ops->set_mode(), because kb_backlight.ops is NULL (has not been set from a model).