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

zero-copy AF_XDP: call trace when creating a stack on down'ed interface #177

Open
ol-sergeyn opened this issue Oct 2, 2023 · 0 comments

Comments

@ol-sergeyn
Copy link
Contributor

I see a call trace when creating a zerocopy AF_XDP stack after putting interface down:

[66120.916580] BUG: kernel NULL pointer dereference, address: 00000000000002a0
[66120.925276] #PF: supervisor write access in kernel mode
[66120.932024] #PF: error_code(0x0002) - not-present page
[66120.938681] PGD 800000023b1b6067 P4D 800000023b1b6067 PUD 0
[66120.945931] Oops: 0002 [#1] SMP PTI
[66120.950756] CPU: 3 PID: 103598 Comm: nc Tainted: G           OE     5.15.0-79-generic #86-Ubuntu
[66120.961517] Hardware name: Dell Inc. PowerEdge R230/0FRVY0, BIOS 2.3.2 11/16/2017
[66120.970832] RIP: 0010:efx_xdp+0x96/0x1c0 [sfc]
[66120.976782] Code: b2 d0 00 00 00 31 d2 e8 48 ff f5 eb 41 89 c4 85 c0 75 26 4c 89 ef 44 89 f6 e8 a6 11 fd ff 83 bb f8 00 00 00 04 49 89 c5 74 7f <c6> 80 a0 02 00 00 01 eb 06 41 bc ea ff ff ff 5b 44 89 e0 41 5c 41
[66120.999708] RSP: 0018:ffffb1e180ad3a80 EFLAGS: 00010293
[66121.006501] RAX: 0000000000000000 RBX: ffff9c04a1c8f000 RCX: ffff9c04a1c8f120
[66121.015417] RDX: 000000000001fff8 RSI: 0000000000000000 RDI: ffff9c04a1c8f040
[66121.024328] RBP: ffffb1e180ad3aa8 R08: 0000000000000006 R09: 0000000000000020
[66121.033250] R10: ffffe2d909026808 R11: 0000000000000000 R12: 0000000000000000
[66121.042165] R13: 0000000000000000 R14: 0000000000000000 R15: ffff9c04ff280000
[66121.051082] FS:  00007f24bcc3e340(0000) GS:ffff9c0527d80000(0000) knlGS:0000000000000000
[66121.061071] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[66121.068429] CR2: 00000000000002a0 CR3: 000000023e940005 CR4: 00000000003706e0
[66121.077323] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[66121.086184] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[66121.095041] Call Trace:
[66121.098659]  <TASK>
[66121.101881]  xp_assign_dev+0xfe/0x200
[66121.106842]  xsk_bind+0x159/0x4a0
[66121.111402]  ? fput+0x13/0x20
[66121.115562]  kernel_bind+0x13/0x20
[66121.120193]  af_xdp_init+0x592/0x800 [sfc_resource]
[66121.126471]  efrm_vi_resource_deferred+0x4a/0x70 [sfc_resource]
[66121.133897]  deferred_vis+0xaa/0x470 [onload]
[66121.139585]  tcp_helper_rm_alloc+0x1e8c/0x33b0 [onload]
[66121.146221]  ? oo_version_check_impl+0xb2/0x2c0 [onload]
[66121.152936]  tcp_helper_rm_alloc_proxy+0x122/0x270 [onload]
[66121.159941]  tcp_helper_alloc_ul+0x65/0x90 [onload]
[66121.166162]  tcp_helper_alloc_rsop+0x44/0x130 [onload]
[66121.172668]  oo_fop_unlocked_ioctl+0x144/0x370 [onload]
[66121.179261]  ? __do_sys_memfd_create+0x178/0x260
[66121.185148]  __x64_sys_ioctl+0x92/0xd0
[66121.190041]  do_syscall_64+0x59/0xc0
[66121.194731]  ? do_syscall_64+0x69/0xc0
[66121.199607]  ? do_syscall_64+0x69/0xc0
[66121.204479]  ? irqentry_exit+0x1d/0x30
[66121.209344]  ? exc_page_fault+0x89/0x170
[66121.214398]  entry_SYSCALL_64_after_hwframe+0x61/0xcb
[66121.220700] RIP: 0033:0x7f24bcd69aff
[66121.225337] Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <41> 89 c0 3d 00 f0 ff ff 77 1f 48 8b 44 24 18 64 48 2b 04 25 28 00
[66121.247679] RSP: 002b:00007fffac3ceec0 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[66121.256811] RAX: ffffffffffffffda RBX: 00007f24bcc3d6c0 RCX: 00007f24bcd69aff
[66121.265460] RDX: 00007fffac3cef30 RSI: 00000000c0b85a1c RDI: 0000000000000004
[66121.274111] RBP: 0000000000000004 R08: 00007fffac3cedb0 R09: 0000000000000000
[66121.282758] R10: 0000000000000000 R11: 0000000000000246 R12: 00005586b1e504c0
[66121.291403] R13: 00000000c0b85a1c R14: 00007fffac3cef30 R15: 0000000000000000
[66121.300043]  </TASK>
[66121.303132] Modules linked in: onload(OE) sfc_char(OE) sfc_resource(OE) sfc(OE) sfc_driverlink(OE) cmdlinepart nf_flow_table nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 vdpa mtdblock mtd_blkdevs hwmon_vid crc32_generic mii tls nf_tables rpcsec_gss_krb5 nfsv4 nfs lockd grace fscache netfs nfnetlink overlay 8021q garp mrp stp llc binfmt_misc irdma ice ib_uverbs ib_core ipmi_ssif dell_wmi ledtrig_audio intel_rapl_msr mei_me ee1004 dell_smbios intel_rapl_common dell_wmi_descriptor mei ie31200_edac sparse_keymap intel_tcc_cooling x86_pkg_temp_thermal intel_powerclamp intel_pch_thermal dcdbas mac_hid coretemp acpi_power_meter kvm_intel kvm ipmi_si intel_wmi_thunderbolt rapl intel_cstate sch_fq_codel dm_multipath scsi_dh_rdac scsi_dh_emc scsi_dh_alua ipmi_watchdog ipmi_devintf ipmi_msghandler efi_pstore auth_rpcgss sunrpc ip_tables x_tables autofs4 btrfs blake2b_generic zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0
[66121.303186]  multipath linear mgag200 i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt crct10dif_pclmul crc32_pclmul fb_sys_fops ghash_clmulni_intel cec rc_core ahci aesni_intel crypto_simd i2c_i801 libahci cryptd i2c_smbus xhci_pci drm tg3 xhci_pci_renesas mtd i40e mdio wmi video [last unloaded: sfc_driverlink]
[66121.440790] CR2: 00000000000002a0
[66121.445310] ---[ end trace 342137a00cac4ab7 ]---
[66121.489293] RIP: 0010:efx_xdp+0x96/0x1c0 [sfc]
[66121.495123] Code: b2 d0 00 00 00 31 d2 e8 48 ff f5 eb 41 89 c4 85 c0 75 26 4c 89 ef 44 89 f6 e8 a6 11 fd ff 83 bb f8 00 00 00 04 49 89 c5 74 7f <c6> 80 a0 02 00 00 01 eb 06 41 bc ea ff ff ff 5b 44 89 e0 41 5c 41
[66121.517824] RSP: 0018:ffffb1e180ad3a80 EFLAGS: 00010293
[66121.524540] RAX: 0000000000000000 RBX: ffff9c04a1c8f000 RCX: ffff9c04a1c8f120
[66121.533404] RDX: 000000000001fff8 RSI: 0000000000000000 RDI: ffff9c04a1c8f040
[66121.542267] RBP: ffffb1e180ad3aa8 R08: 0000000000000006 R09: 0000000000000020
[66121.551137] R10: ffffe2d909026808 R11: 0000000000000000 R12: 0000000000000000
[66121.560002] R13: 0000000000000000 R14: 0000000000000000 R15: ffff9c04ff280000
[66121.568863] FS:  00007f24bcc3e340(0000) GS:ffff9c0527d80000(0000) knlGS:0000000000000000
[66121.578801] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[66121.586119] CR2: 00000000000002a0 CR3: 000000023e940005 CR4: 00000000003706e0
[66121.594995] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[66121.603865] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

SFC NIC.
Onload master 76e6c7d

How to reproduce:

# Load and register
$ RESOURCE_OPT="enable_driverlink=0" sudo ./build/x86_64_linux-5.15.0-79-generic/driver/linux/load.sh onload
$ echo enp2s0f0 | sudo tee /sys/module/sfc_resource/afxdp/register

# Set interface down
$ sudo ip li set enp2s0f0 down

# Run netcat
$ EF_AF_XDP_ZEROCOPY=1 sudo onload nc -l 6666
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