Skip to content

incompatibility with INTEL LGA1151 cpu , Kernel error

Hi,
It seems there is some issue in can_write function. When i'm tring to use transmitblock in example folder.
I tested it with 3 different LGA1151 motherboard, with Ubuntu 14.04 , 16.04 , 18.04 and CentOS 7 all have same issue. But in motherboards with other sockets like LGA1555, or LGA775 it works without problem with same OSs.
It seems it is an architect dependent problem. I have same problem in my laptop which has LGA1151 cpu family.
It even works in Vbox machine in LGA1151 HWs with same OS.

I narrowed down problem, it occur exactly in this line
I think there is some problem with this cast:
addr = (canmsg_t __user *) buffer;
Please tell me of you need extra information or more tests.

dmesg -T
...
[Fri Feb 15 00:21:33 2019] can4linux: Can[-1]: - : in  can_init()
[Fri Feb 15 00:21:33 2019] can4linux: The generic driver supports the virtual CAN network feature
[Fri Feb 15 00:21:33 2019] can4linux: ISA-Generic CAN Driver 4.5_GENERIC SVN version  (c) Feb 15 2019 09:02:21
[Fri Feb 15 00:21:33 2019] can4linux:  virtual CAN network, (c) H.J. Oertel (hj.oertel@t-online.de)
[Fri Feb 15 00:21:33 2019] can4linux:  MAX_CHANNELS 4
[Fri Feb 15 00:21:33 2019] can4linux:  CAN_MAX_OPEN 16
[Fri Feb 15 00:21:33 2019] can4linux: Can[-1]: - : in  init_board_hw()
[Fri Feb 15 00:21:33 2019] can4linux: Can[-1]: - : out init_board_hw()
[Fri Feb 15 00:21:33 2019] can4linux: Can[-1]: - : in  init_board_hw()
[Fri Feb 15 00:21:33 2019] can4linux: Can[-1]: - : out init_board_hw()
[Fri Feb 15 00:21:33 2019] can4linux: Can[-1]: - : in  init_board_hw()
[Fri Feb 15 00:21:33 2019] can4linux: Can[-1]: - : out init_board_hw()
[Fri Feb 15 00:21:33 2019] can4linux: Can[-1]: - : in  init_board_hw()
[Fri Feb 15 00:21:33 2019] can4linux: Can[-1]: - : out init_board_hw()
[Fri Feb 15 00:21:33 2019] can4linux: Can[-1]: - : out can_init()
[Fri Feb 15 00:22:21 2019] can4linux: Can[1]: - : in  can_open()
[Fri Feb 15 00:22:21 2019] can4linux: Can[1]: - : in  can_tx_fifo_init()
[Fri Feb 15 00:22:21 2019] can4linux: Can[1]: - : out can_tx_fifo_init()
[Fri Feb 15 00:22:21 2019] can4linux: Can[1]: - : in  can_rx_fifo_init()
[Fri Feb 15 00:22:21 2019] can4linux: Can[1]: - : out can_rx_fifo_init()
[Fri Feb 15 00:22:21 2019] can4linux: Can[1]: - : out can_open()
[Fri Feb 15 00:22:21 2019] can4linux: Can[1]: - : in  can_write()
[Fri Feb 15 00:22:21 2019] can4linux: Can[1]: - :
[Fri Feb 15 00:22:21 2019]  -- write 100 msg, blocking=1

[Fri Feb 15 00:22:21 2019] can4linux: Can[1]: - :
[Fri Feb 15 00:22:21 2019] BUG: unable to handle kernel paging request at 00007ffeec3fea50
[Fri Feb 15 00:22:21 2019] IP: can_write+0x73d/0x840 [can4linux]
[Fri Feb 15 00:22:21 2019] PGD 80000003a9919067 P4D 80000003a9919067 PUD 3b6986067 PMD 4a20d0067 PTE 80000003196f8867
[Fri Feb 15 00:22:21 2019] Oops: 0001 [#1] SMP PTI
[Fri Feb 15 00:22:21 2019] Modules linked in: can4linux(OE) ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack pppoe libcrc32c pppox iptable_filter thunderbolt rfcomm pci_stub vboxpci(OE) vboxnetadp(OE) vboxnetflt(OE) cmac vboxdrv(OE) bnep binfmt_misc nls_iso8859_1 intel_rapl arc4 x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm snd_hda_codec_hdmi irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcbc snd_hda_codec_realtek mxm_wmi intel_wmi_thunderbolt asus_nb_wmi asus_wmi snd_hda_codec_generic sparse_keymap uvcvideo iwlmvm videobuf2_vmalloc aesni_intel videobuf2_memops btusb videobuf2_v4l2 mac80211 aes_x86_64 crypto_simd videobuf2_core btrtl glue_helper btbcm cryptd snd_hda_intel videodev btintel snd_hda_codec intel_cstate media
[Fri Feb 15 00:22:21 2019]  bluetooth joydev intel_rapl_perf iwlwifi snd_hda_core snd_hwdep ecdh_generic input_leds snd_pcm cfg80211 serio_raw snd_seq_midi snd_seq_midi_event elan_i2c int3403_thermal snd_rawmidi snd_seq snd_seq_device snd_timer snd processor_thermal_device soundcore idma64 int3400_thermal int340x_thermal_zone virt_dma mei_me intel_soc_dts_iosf acpi_thermal_rel intel_pch_thermal mei intel_lpss_pci mac_hid intel_lpss shpchp acpi_pad wmi asus_wireless sch_fq_codel parport_pc ppdev lp parport ip_tables x_tables autofs4 hid_generic usbhid i915 i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm ahci libahci i2c_hid hid video
[Fri Feb 15 00:22:21 2019] CPU: 4 PID: 7576 Comm: transmitblock Tainted: G        W  OE    4.15.0-36-generic #39-Ubuntu
[Fri Feb 15 00:22:21 2019] Hardware name: ASUSTeK COMPUTER INC. G501VW/G501VW, BIOS G501VW.304_170125 02/20/2017
[Fri Feb 15 00:22:21 2019] RIP: 0010:can_write+0x73d/0x840 [can4linux]
[Fri Feb 15 00:22:21 2019] RSP: 0018:ffff9c0c4482fd58 EFLAGS: 00010282
[Fri Feb 15 00:22:21 2019] RAX: 0000000000000016 RBX: 00007ffeec3fea30 RCX: ffffffffbdc62728
[Fri Feb 15 00:22:21 2019] RDX: 0000000000000000 RSI: 0000000000000096 RDI: 0000000000000247
[Fri Feb 15 00:22:21 2019] RBP: ffff9c0c4482fe98 R08: 0000000000000016 R09: 0000000000000619
[Fri Feb 15 00:22:21 2019] R10: 0000000000000000 R11: 0000000000000004 R12: 0000000000000000
[Fri Feb 15 00:22:21 2019] R13: ffff9c0c4482fef8 R14: 00007ffeec3fea30 R15: ffff90d48e391b00
[Fri Feb 15 00:22:21 2019] FS:  00007fa7183ec4c0(0000) GS:ffff90d5c1d00000(0000) knlGS:0000000000000000
[Fri Feb 15 00:22:21 2019] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[Fri Feb 15 00:22:21 2019] CR2: 00007ffeec3fea50 CR3: 000000038f270006 CR4: 00000000003606e0
[Fri Feb 15 00:22:21 2019] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[Fri Feb 15 00:22:21 2019] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[Fri Feb 15 00:22:21 2019] Call Trace:
[Fri Feb 15 00:22:21 2019]  ? handle_pte_fault+0x503/0xd30
[Fri Feb 15 00:22:21 2019]  ? __handle_mm_fault+0x478/0x5c0
[Fri Feb 15 00:22:21 2019]  ? common_file_perm+0x58/0x160
[Fri Feb 15 00:22:21 2019]  ? apparmor_file_permission+0x1a/0x20
[Fri Feb 15 00:22:21 2019]  __vfs_write+0x1b/0x40
[Fri Feb 15 00:22:21 2019]  vfs_write+0xb1/0x1a0
[Fri Feb 15 00:22:21 2019]  SyS_write+0x55/0xc0
[Fri Feb 15 00:22:21 2019]  do_syscall_64+0x73/0x130
[Fri Feb 15 00:22:21 2019]  entry_SYSCALL_64_after_hwframe+0x3d/0xa2
[Fri Feb 15 00:22:21 2019] RIP: 0033:0x7fa717f02154
[Fri Feb 15 00:22:21 2019] RSP: 002b:00007ffeec3fe9e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[Fri Feb 15 00:22:21 2019] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fa717f02154
[Fri Feb 15 00:22:21 2019] RDX: 0000000000000064 RSI: 00007ffeec3fea30 RDI: 0000000000000003
[Fri Feb 15 00:22:21 2019] RBP: 00007ffeec401310 R08: 0000000000000000 R09: 0000000000000000
[Fri Feb 15 00:22:21 2019] R10: 0000000000000002 R11: 0000000000000246 R12: 0000555cdcea0af0
[Fri Feb 15 00:22:21 2019] R13: 00007ffeec4013f0 R14: 0000000000000000 R15: 0000000000000000
[Fri Feb 15 00:22:21 2019] Code: a9 de c0 e8 66 65 b0 fb 48 c7 c7 a0 ac de c0 e8 5a 65 b0 fb e9 53 fb ff ff 8b b5 28 ff ff ff 48 c7 c7 68 ac de c0 e8 43 65 b0 fb <8b> 53 20 8b 33 48 c7 c7 a2 ac de c0 e8 32 65 b0 fb 48 c7 c7 a0 
[Fri Feb 15 00:22:21 2019] RIP: can_write+0x73d/0x840 [can4linux] RSP: ffff9c0c4482fd58
[Fri Feb 15 00:22:21 2019] CR2: 00007ffeec3fea50
[Fri Feb 15 00:22:21 2019] ---[ end trace 54684b1d3db271d0 ]---
[Fri Feb 15 00:22:21 2019] Can[1]: - : in  can_close()
[Fri Feb 15 00:22:21 2019] Can[1]: - : out can_close()
Edited by ashtum