Bug 202905

Summary: nf_tables: kernel Oops
Product: Networking Reporter: Maxime de Roucy (maxime.deroucy)
Component: Netfilter/IptablesAssignee: networking_netfilter-iptables (networking_netfilter-iptables)
Status: RESOLVED CODE_FIX    
Severity: normal CC: aros, maxime.deroucy
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: 5.0.0-arch1-1-ARCH Subsystem:
Regression: No Bisected commit-id:

Description Maxime de Roucy 2019-03-13 13:14:17 UTC
Sometimes (I think it's a race condition) I get a kernel oops at boot :

```
% journalctl --no-hostname -b -1 _TRANSPORT=kernel + _SYSTEMD_UNIT=nftables.service + UNIT=nftables.service
…
mars 13 13:48:53 kernel: snd_hda_intel 0000:00:1f.3: enabling device (0000 -> 0002)
mars 13 13:48:53 kernel: usbcore: registered new interface driver brcmfmac
mars 13 13:48:53 kernel: brcmfmac 0000:3a:00.0: enabling device (0000 -> 0002)
mars 13 13:48:53 kernel: input: Dell WMI hotkeys as /devices/platform/PNP0C14:01/wmi_bus/wmi_bus-PNP0C14:01/9DBB5994-A997-11DA-B012-B622A1EF5492/input/input30
mars 13 13:48:53 systemd[1]: Starting Netfilter Tables...
mars 13 13:48:53 kernel: brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4350-pcie for chip BCM4350/8
mars 13 13:48:53 kernel: brcmfmac 0000:3a:00.0: Direct firmware load for brcm/brcmfmac4350-pcie.Dell Inc.-XPS 13 9350.txt failed with error -2
mars 13 13:48:53 kernel: brcmfmac 0000:3a:00.0: Direct firmware load for brcm/brcmfmac4350-pcie.txt failed with error -2
mars 13 13:48:53 kernel: intel_rapl: Found RAPL domain package
mars 13 13:48:53 kernel: intel_rapl: Found RAPL domain core
mars 13 13:48:53 kernel: intel_rapl: Found RAPL domain uncore
mars 13 13:48:53 kernel: intel_rapl: Found RAPL domain dram
mars 13 13:48:53 kernel: BUG: unable to handle kernel paging request at 00000e8000000bf0
mars 13 13:48:53 kernel: #PF error: [normal kernel read fault]
mars 13 13:48:53 kernel: PGD 0 P4D 0
mars 13 13:48:53 kernel: Oops: 0000 [#1] PREEMPT SMP PTI
mars 13 13:48:53 kernel: CPU: 2 PID: 517 Comm: nft Not tainted 5.0.0-arch1-1-ARCH #1
mars 13 13:48:53 kernel: Hardware name: Dell Inc. XPS 13 9350/09JHRY, BIOS 1.6.1 12/14/2017
mars 13 13:48:53 kernel: RIP: 0010:nft_set_elem_destroy+0x42/0x110 [nf_tables]
mars 13 13:48:53 kernel: Code: 00 48 89 44 24 30 31 c0 48 8b 87 80 00 00 00 48 c7 44 24 28 00 00 00 00 48 c7 44 24 08 00 00 00 00 48 c7 44 24 10 00 00 00 00 <8b> 58 70 48 c7 44>
mars 13 13:48:53 kernel: RSP: 0000:ffffa1a4421ff828 EFLAGS: 00010246
mars 13 13:48:53 kernel: RAX: 00000e8000000b80 RBX: ffff8db0a06d3e40 RCX: 00000000002a0011
mars 13 13:48:53 kernel: RDX: 0000000000000001 RSI: ffff8db0a0f50680 RDI: ffff8db09ee12000
mars 13 13:48:53 kernel: RBP: ffff8db0a0f50680 R08: 0000000000000001 R09: ffffffffc0f1d240
mars 13 13:48:53 kernel: R10: ffffd12b91869500 R11: 0000000000000000 R12: ffff8db0a06d3b40
mars 13 13:48:53 kernel: R13: dead000000000200 R14: dead000000000100 R15: ffff8db0a06d3b40
mars 13 13:48:53 kernel: FS:  00007f97480dc740(0000) GS:ffff8db0aeb00000(0000) knlGS:0000000000000000
mars 13 13:48:53 kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
mars 13 13:48:53 kernel: CR2: 00000e8000000bf0 CR3: 000000045df52001 CR4: 00000000003606e0
mars 13 13:48:53 kernel: Call Trace:
mars 13 13:48:53 kernel:  __nf_tables_abort+0x172/0x630 [nf_tables]
mars 13 13:48:53 kernel:  nft_request_module+0x45/0xe0 [nf_tables]
mars 13 13:48:53 kernel:  ? __nla_parse+0xed/0x120
mars 13 13:48:53 kernel:  nf_tables_expr_parse+0x16a/0x1c0 [nf_tables]
mars 13 13:48:53 kernel:  nf_tables_newrule+0x668/0x870 [nf_tables]
mars 13 13:48:53 kernel:  nfnetlink_rcv_batch+0x417/0x5a0 [nfnetlink]
mars 13 13:48:53 kernel:  ? preempt_count_add+0x79/0xb0
mars 13 13:48:53 kernel:  ? __insert_vmap_area+0x71/0xc0
mars 13 13:48:53 kernel:  ? _raw_spin_unlock+0x16/0x30
mars 13 13:48:53 kernel:  ? alloc_vmap_area+0x268/0x350
mars 13 13:48:53 kernel:  ? vmap_page_range_noflush+0x23f/0x350
mars 13 13:48:53 kernel:  ? __nla_parse+0x34/0x120
mars 13 13:48:53 kernel:  nfnetlink_rcv+0x106/0x140 [nfnetlink]
mars 13 13:48:53 kernel:  netlink_unicast+0x193/0x240
mars 13 13:48:53 kernel:  netlink_sendmsg+0x1fd/0x3c0
mars 13 13:48:53 kernel:  sock_sendmsg+0x33/0x40
mars 13 13:48:53 kernel:  ___sys_sendmsg+0x295/0x2f0
mars 13 13:48:53 kernel:  ? mem_cgroup_commit_charge+0x7a/0x4d0
mars 13 13:48:53 kernel:  ? __mod_node_page_state+0x69/0xa0
mars 13 13:48:53 kernel:  ? __lru_cache_add+0x75/0xa0
mars 13 13:48:53 kernel:  ? preempt_count_add+0x79/0xb0
mars 13 13:48:53 kernel:  ? __local_bh_enable_ip+0x3a/0x80
mars 13 13:48:53 kernel:  __sys_sendmsg+0x57/0xa0
mars 13 13:48:53 kernel:  do_syscall_64+0x5b/0x170
mars 13 13:48:53 kernel:  entry_SYSCALL_64_after_hwframe+0x44/0xa9
mars 13 13:48:53 kernel: RIP: 0033:0x7f9748525fd8
mars 13 13:48:53 kernel: Code: 89 02 48 c7 c0 ff ff ff ff eb b5 0f 1f 80 00 00 00 00 f3 0f 1e fa 48 8d 05 65 65 0c 00 8b 00 85 c0 75 17 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff>
mars 13 13:48:53 kernel: RSP: 002b:00007ffc40e7f628 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
mars 13 13:48:53 kernel: RAX: ffffffffffffffda RBX: 00007ffc40e7f640 RCX: 00007f9748525fd8
mars 13 13:48:53 kernel: RDX: 0000000000000000 RSI: 00007ffc40e806a0 RDI: 0000000000000003
mars 13 13:48:53 kernel: RBP: 00007ffc40e807a0 R08: 0000000000000004 R09: 0000000000000007
mars 13 13:48:53 kernel: R10: 00007ffc40e8068c R11: 0000000000000246 R12: 00007ffc40e80810
mars 13 13:48:53 kernel: R13: 00007ffc40e7f640 R14: 00007ffc40e7f640 R15: 000055dad9983710
mars 13 13:48:53 kernel: Modules linked in: snd_soc_sst_ipc intel_rapl nf_tables_set snd_soc_sst_dsp snd_soc_acpi_intel_match dell_laptop ledtrig_audio nf_tables x86_pkg_temp_t>
mars 13 13:48:53 kernel:  tpm_tis intel_gtt intel_lpss_pci mei intel_lpss intel_pch_thermal tpm_tis_core agpgart tpm processor_thermal_device syscopyarea sysfillrect intel_soc_>
mars 13 13:48:53 kernel: CR2: 00000e8000000bf0
mars 13 13:48:53 kernel: ---[ end trace 77021bf2915154db ]---
mars 13 13:48:53 kernel: RIP: 0010:nft_set_elem_destroy+0x42/0x110 [nf_tables]
mars 13 13:48:53 kernel: Code: 00 48 89 44 24 30 31 c0 48 8b 87 80 00 00 00 48 c7 44 24 28 00 00 00 00 48 c7 44 24 08 00 00 00 00 48 c7 44 24 10 00 00 00 00 <8b> 58 70 48 c7 44>
mars 13 13:48:53 kernel: RSP: 0000:ffffa1a4421ff828 EFLAGS: 00010246
mars 13 13:48:53 kernel: RAX: 00000e8000000b80 RBX: ffff8db0a06d3e40 RCX: 00000000002a0011
mars 13 13:48:53 kernel: RDX: 0000000000000001 RSI: ffff8db0a0f50680 RDI: ffff8db09ee12000
mars 13 13:48:53 kernel: RBP: ffff8db0a0f50680 R08: 0000000000000001 R09: ffffffffc0f1d240
mars 13 13:48:53 kernel: R10: ffffd12b91869500 R11: 0000000000000000 R12: ffff8db0a06d3b40
mars 13 13:48:53 kernel: R13: dead000000000200 R14: dead000000000100 R15: ffff8db0a06d3b40
mars 13 13:48:53 kernel: FS:  00007f97480dc740(0000) GS:ffff8db0aeb00000(0000) knlGS:0000000000000000
mars 13 13:48:53 kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
mars 13 13:48:53 kernel: CR2: 00000e8000000bf0 CR3: 000000045df52001 CR4: 00000000003606e0
mars 13 13:48:53 kernel: [drm] Found 64MB of eDRAM
mars 13 13:48:53 kernel: checking generic (90000000 15f9000) vs hw (90000000 10000000)
mars 13 13:48:53 kernel: fb0: switching to inteldrmfb from EFI VGA
mars 13 13:48:53 systemd[1]: nftables.service: Main process exited, code=killed, status=9/KILL
mars 13 13:48:53 systemd[1]: nftables.service: Failed with result 'signal'.
mars 13 13:48:53 systemd[1]: Failed to start Netfilter Tables.
mars 13 13:48:53 kernel: Console: switching to colour dummy device 80x25
…
```

I hop there is enough information for you to understand what append.
-- 
Regards
Comment 1 Artem S. Tashkinov 2019-03-25 18:24:30 UTC
Also see bug 203039.
Comment 2 Maxime de Roucy 2019-04-06 18:27:48 UTC
I confirm that the fix for bug 203039 also fix this one.
The problem is fixed on kernel 5.0.6.

Thanks