Kernel error accessing user memory
Jonathan Gips
jon at gips.com
Wed Jul 21 17:05:23 UTC 2021
Hello WireGuard Maintainers,
I am seeing the following kernel error when running WireGuard as a kernel module on my Ubuntu 18.04 armv8 device:
"Internal error: Accessing user space memory outside uaccess.h routines: 96000005 [#1] PREEMPT SMP”
Has anyone come across this? I have seen mention on the Nvidia forums that this issue can arise on newer armv8 CPUs when a kernel module directly accesses userspace memory, with the recommended fix being to use copy_from_user() and copy_to_user().
My device's configuration:
--------------------------
- Nvidia Jetson Nano
- CPU: Armv8, 64-bit
- OS: Ubuntu 18.04 / Bionic
- uname -a: Linux jetson-nano 4.9.201-tegra #1 SMP PREEMPT Fri Feb 19 08:40:32 PST 2021 aarch64 aarch64 aarch64 GNU/Linux
Apt package configuration:
--------------------------
- wireguard/bionic-updates,now 1.0.20200513-1~18.04.2 all [installed]
- wireguard-dkms/bionic-updates,now 1.0.20201112-1~18.04.1 all [installed,automatic]
- wireguard-tools/bionic-updates,now 1.0.20200513-1~18.04.2 arm64 [installed]
Full syslog entry for kernel error:
-----------------------------------
May 4 18:45:22 jetson-nano kernel: [628210.837536] Internal error: Accessing user space memory outside uaccess.h routines: 96000005 [#1] PREEMPT SMP
May 4 18:45:22 jetson-nano kernel: [628210.847539] Modules linked in: wireguard ipt_MASQUERADE nf_nat_masquerade_ipv4 nf_conntrack_netlink nfnetlink br_netfilter overlay iwlmvm mac80211 bnep btusb btrtl btbcm btintel iwlwifi zram spidev cfg80211 ipt_REJECT nf_reject_ipv4 xt_limit xt_tcpudp xt_addrtype xt_conntrack iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 ip6table_mangle userspace_alert nvgpu iptable_mangle ip6table_filter ip6_tables nf_conntrack_netbios_ns nf_conntrack_broadcast nf_nat_ftp nf_nat bluedroid_pm nf_conntrack_ftp nf_conntrack iptable_filter ip_tables x_tables
May 4 18:45:22 jetson-nano kernel: [628210.896578] CPU: 1 PID: 3832 Comm: exe Not tainted 4.9.201-tegra #1
May 4 18:45:22 jetson-nano kernel: [628210.902921] Hardware name: custom-jetson-carrier (DT)
May 4 18:45:22 jetson-nano kernel: [628210.908137] task: ffffffc0d02c0e00 task.stack: ffffffc00d7ac000
May 4 18:45:22 jetson-nano kernel: [628210.914140] PC is at do_last+0x54/0xfd0
May 4 18:45:22 jetson-nano kernel: [628210.918057] LR is at path_openat+0x90/0x378
May 4 18:45:22 jetson-nano kernel: [628210.922320] pc : [] lr : [] pstate: 20400145
May 4 18:45:22 jetson-nano kernel: [628210.929792] sp : ffffffc00d7afbc0
May 4 18:45:22 jetson-nano kernel: [628210.933188] x29: ffffffc00d7afbc0 x28: ffffffc0d02c0e00
May 4 18:45:22 jetson-nano kernel: [628210.938595] x27: ffffffc00d7afd48 x26: ffffffc087b23e40
May 4 18:45:22 jetson-nano kernel: [628210.944000] x25: ffffffc00d7afe7c x24: 0000000000000000
May 4 18:45:22 jetson-nano kernel: [628210.949403] x23: 0000000000000041 x22: 0000000000000002
May 4 18:45:22 jetson-nano kernel: [628210.954805] x21: ffffffc037fb9100 x20: ffffffc00d7afcfc
May 4 18:45:22 jetson-nano kernel: [628210.960208] x19: 0000000000020041 x18: 00000000000002c8
May 4 18:45:22 jetson-nano kernel: [628210.965611] x17: 000000000000006e x16: 0000000000000000
May 4 18:45:22 jetson-nano kernel: [628210.971013] x15: 00000000000000f9 x14: 0000000000000000
May 4 18:45:22 jetson-nano kernel: [628210.976416] x13: 0000000000000080 x12: 732f74752f626772
May 4 18:45:22 jetson-nano kernel: [628210.981818] x11: 5f63652f7070612f x10: d0d0d0d0d0d0d0d0
May 4 18:45:22 jetson-nano kernel: [628210.987221] x9 : 96a4abb42eef25a3 x8 : 70d6b989bf66a5a8
May 4 18:45:22 jetson-nano kernel: [628210.992625] x7 : 30017cce4247b231 x6 : e672123d9189800b
May 4 18:45:22 jetson-nano kernel: [628210.998027] x5 : 0000000000000018 x4 : fefefefefefefeff
May 4 18:45:22 jetson-nano kernel: [628211.003430] x3 : ffffffc00d7afcfc x2 : 0000000000000000
May 4 18:45:22 jetson-nano kernel: [628211.008834] x1 : 0000000000000000 x0 : 0000000000000041
May 4 18:45:22 jetson-nano kernel: [628211.014237]
May 4 18:45:22 jetson-nano kernel: [628211.015811] Process exe (pid: 3832, stack limit = 0xffffffc00d7ac000)
May 4 18:45:22 jetson-nano kernel: [628211.022327] Call trace:
May 4 18:45:22 jetson-nano kernel: [628211.024860] [] do_last+0x54/0xfd0
May 4 18:45:22 jetson-nano kernel: [628211.029818] [] path_openat+0x90/0x378
May 4 18:45:22 jetson-nano kernel: [628211.035122] [] do_filp_open+0x70/0xe8
May 4 18:45:22 jetson-nano kernel: [628211.040425] [] do_sys_open+0x174/0x258
May 4 18:45:22 jetson-nano kernel: [628211.045816] [] SyS_openat+0x3c/0x50
May 4 18:45:22 jetson-nano kernel: [628211.050947] [] el0_svc_naked+0x34/0x38
May 4 18:45:22 jetson-nano kernel: [628211.056341] ---[ end trace c646984c02898d73 ]---
May 4 18:45:43 jetson-nano kernel: [628231.843814] INFO: rcu_preempt detected stalls on CPUs/tasks:
May 4 18:45:43 jetson-nano kernel: [628231.849575] Tasks blocked on level-0 rcu_node (CPUs 0-3): P3832
May 4 18:45:43 jetson-nano kernel: [628231.855674] (detected by 1, t=5255 jiffies, g=39064575, c=39064574, q=28414)
May 4 18:45:43 jetson-nano kernel: [628231.862901] exe D 0 3832 6362 0x00000008
May 4 18:45:43 jetson-nano kernel: [628231.868476] Call trace:
May 4 18:45:43 jetson-nano kernel: [628231.871012] [] __switch_to+0x9c/0xc0
May 4 18:45:43 jetson-nano kernel: [628231.876233] [] __schedule+0x270/0x780
May 4 18:45:43 jetson-nano kernel: [628231.881539] [] schedule+0x40/0xa8
May 4 18:45:43 jetson-nano kernel: [628231.886497] [] schedule_timeout+0x1ec/0x420
May 4 18:45:43 jetson-nano kernel: [628231.892322] [] wait_for_common+0xa0/0x140
May 4 18:45:43 jetson-nano kernel: [628231.897975] [] wait_for_completion+0x28/0x38
May 4 18:45:43 jetson-nano kernel: [628231.903887] [] __wait_rcu_gp+0x104/0x138
May 4 18:45:43 jetson-nano kernel: [628231.909452] [] synchronize_rcu+0x80/0x90
May 4 18:45:43 jetson-nano kernel: [628231.915017] [] namespace_unlock+0x58/0x68
May 4 18:45:43 jetson-nano kernel: [628231.920668] [] drop_collected_mounts+0x78/0x88
May 4 18:45:43 jetson-nano kernel: [628231.926751] [] put_mnt_ns+0x3c/0x50
May 4 18:45:43 jetson-nano kernel: [628231.931880] [] free_nsproxy+0x24/0xe8
May 4 18:45:43 jetson-nano kernel: [628231.937182] [] switch_task_namespaces+0x70/0x80
May 4 18:45:43 jetson-nano kernel: [628231.943351] [] exit_task_namespaces+0x24/0x30
May 4 18:45:43 jetson-nano kernel: [628231.949349] [] do_exit+0x2b8/0xa50
May 4 18:45:43 jetson-nano kernel: [628231.954392] [] die+0x194/0x198
May 4 18:45:43 jetson-nano kernel: [628231.959089] [] do_page_fault+0x1ec/0x480
May 4 18:45:43 jetson-nano kernel: [628231.964651] [] do_translation_fault+0x6c/0x80
May 4 18:45:43 jetson-nano kernel: [628231.970648] [] do_mem_abort+0x54/0xb0
May 4 18:45:43 jetson-nano kernel: [628231.975950] [] el1_da+0x24/0xbc
May 4 18:45:43 jetson-nano kernel: [628231.980735] [] path_openat+0x90/0x378
May 4 18:45:43 jetson-nano kernel: [628231.986037] [] do_filp_open+0x70/0xe8
May 4 18:45:43 jetson-nano kernel: [628231.991340] [] do_sys_open+0x174/0x258
May 4 18:45:43 jetson-nano kernel: [628231.996729] [] SyS_openat+0x3c/0x50
May 4 18:45:43 jetson-nano kernel: [628232.001859] [] el0_svc_naked+0x34/0x38
May 4 18:45:43 jetson-nano kernel: [628232.007249] exe D 0 3832 6362 0x00000008
May 4 18:45:43 jetson-nano kernel: [628232.012826] Call trace:
May 4 18:45:43 jetson-nano kernel: [628232.015361] [] __switch_to+0x9c/0xc0
May 4 18:45:43 jetson-nano kernel: [628232.020581] [] __schedule+0x270/0x780
May 4 18:45:43 jetson-nano kernel: [628232.025885] [] schedule+0x40/0xa8
May 4 18:45:43 jetson-nano kernel: [628232.030842] [] schedule_timeout+0x1ec/0x420
May 4 18:45:43 jetson-nano kernel: [628232.036668] [] wait_for_common+0xa0/0x140
May 4 18:45:43 jetson-nano kernel: [628232.042319] [] wait_for_completion+0x28/0x38
May 4 18:45:43 jetson-nano kernel: [628232.048231] [] __wait_rcu_gp+0x104/0x138
May 4 18:45:43 jetson-nano kernel: [628232.053797] [] synchronize_rcu+0x80/0x90
May 4 18:45:43 jetson-nano kernel: [628232.059362] [] namespace_unlock+0x58/0x68
May 4 18:45:43 jetson-nano kernel: [628232.065013] [] drop_collected_mounts+0x78/0x88
May 4 18:45:43 jetson-nano kernel: [628232.071097] [] put_mnt_ns+0x3c/0x50
May 4 18:45:43 jetson-nano kernel: [628232.076228] [] free_nsproxy+0x24/0xe8
May 4 18:45:43 jetson-nano kernel: [628232.081531] [] switch_task_namespaces+0x70/0x80
May 4 18:45:43 jetson-nano kernel: [628232.087702] [] exit_task_namespaces+0x24/0x30
May 4 18:45:43 jetson-nano kernel: [628232.093700] [] do_exit+0x2b8/0xa50
Thanks,
Jon
More information about the WireGuard
mailing list