bisecting fixing commit since d18b78abc0c6e7d3119367c931c583e02d466495 building syzkaller on cef5ae6814696260ff58c538a1b6044af90c5979 testing commit d18b78abc0c6e7d3119367c931c583e02d466495 with gcc (GCC) 8.4.1 20210217 kernel signature: e4124f5f1fc6a9e62cfcca5a09b1d89ac93d0bf386d37c8868c7c1f0f4973e51 run #0: crashed: KASAN: use-after-free Read in __nf_tables_abort run #1: crashed: KASAN: use-after-free Read in __nf_tables_abort run #2: crashed: KASAN: use-after-free Read in corrupted run #3: crashed: KASAN: use-after-free Read in __nf_tables_abort run #4: crashed: KASAN: use-after-free Read in __nf_tables_abort run #5: crashed: KASAN: use-after-free Read in __nf_tables_abort run #6: crashed: KASAN: use-after-free Read in __nf_tables_abort run #7: crashed: KASAN: use-after-free Read in __nf_tables_abort run #8: crashed: KASAN: use-after-free Read in __nf_tables_abort run #9: crashed: KASAN: use-after-free Read in corrupted run #10: crashed: KASAN: use-after-free Read in __nf_tables_abort run #11: crashed: KASAN: use-after-free Read in __nf_tables_abort run #12: crashed: KASAN: use-after-free Read in __nf_tables_abort run #13: crashed: KASAN: use-after-free Read in __nf_tables_abort run #14: crashed: KASAN: use-after-free Read in __nf_tables_abort run #15: crashed: KASAN: use-after-free Read in __nf_tables_abort run #16: crashed: KASAN: use-after-free Read in __nf_tables_abort run #17: crashed: KASAN: use-after-free Read in __nf_tables_abort run #18: crashed: KASAN: use-after-free Read in __nf_tables_abort run #19: crashed: KASAN: use-after-free Read in __nf_tables_abort testing current HEAD 2034d6f0838e465dd8f120c4e946d8444b4bb5df testing commit 2034d6f0838e465dd8f120c4e946d8444b4bb5df with gcc (GCC) 8.4.1 20210217 kernel signature: 7180ef5fc93b42b72e4580128cb0f3fc0e505ef85468c26714bb17889296832d all runs: crashed: KASAN: use-after-free Read in __nf_tables_abort revisions tested: 2, total time: 23m36.583567979s (build: 16m39.436103908s, test: 6m26.03087533s) the crash still happens on HEAD commit msg: Linux 4.19.184 crash: KASAN: use-after-free Read in __nf_tables_abort IPv6: ADDRCONF(NETDEV_UP): batadv_slave_1: link is not ready batman_adv: batadv0: Interface activated: batadv_slave_1 IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready ================================================================== BUG: KASAN: use-after-free in __list_del_entry_valid+0xd0/0x100 lib/list_debug.c:42 Read of size 8 at addr ffff8881d650ad08 by task syz-executor.4/7244 CPU: 1 PID: 7244 Comm: syz-executor.4 Not tainted 4.19.184-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x17c/0x226 lib/dump_stack.c:118 print_address_description.cold.6+0x9/0x211 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report mm/kasan/report.c:412 [inline] kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:396 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 __list_del_entry_valid+0xd0/0x100 lib/list_debug.c:42 __list_del_entry include/linux/list.h:117 [inline] list_del_rcu include/linux/rculist.h:130 [inline] __nf_tables_abort+0x1556/0x1eb0 net/netfilter/nf_tables_api.c:6660 nf_tables_abort+0xf/0x30 net/netfilter/nf_tables_api.c:6770 nfnetlink_rcv_batch+0x4e3/0x1520 net/netfilter/nfnetlink.c:496 nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:545 [inline] nfnetlink_rcv+0x2f1/0x3b0 net/netfilter/nfnetlink.c:563 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x443/0x660 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x667/0xc60 net/netlink/af_netlink.c:1909 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:632 ___sys_sendmsg+0x647/0x950 net/socket.c:2115 __sys_sendmsg+0xd9/0x180 net/socket.c:2153 __do_sys_sendmsg net/socket.c:2162 [inline] __se_sys_sendmsg net/socket.c:2160 [inline] __x64_sys_sendmsg+0x73/0xb0 net/socket.c:2160 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4650c9 Code: ff ff 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 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f124621c188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000055cf00 RCX: 00000000004650c9 RDX: 0000000000000000 RSI: 0000000020000280 RDI: 0000000000000003 RBP: 00000000004af711 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000055cf00 R13: 00007ffefbf675bf R14: 00007f124621c300 R15: 0000000000022000 Allocated by task 7244: save_stack mm/kasan/kasan.c:448 [inline] set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc.part.1+0x62/0xf0 mm/kasan/kasan.c:553 kasan_kmalloc+0xaf/0xc0 mm/kasan/kasan.c:538 kmem_cache_alloc_trace+0x152/0x3a0 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:709 [inline] nf_tables_newtable+0x617/0x1400 net/netfilter/nf_tables_api.c:883 nfnetlink_rcv_batch+0x8cd/0x1520 net/netfilter/nfnetlink.c:435 nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:545 [inline] nfnetlink_rcv+0x2f1/0x3b0 net/netfilter/nfnetlink.c:563 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x443/0x660 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x667/0xc60 net/netlink/af_netlink.c:1909 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:632 ___sys_sendmsg+0x647/0x950 net/socket.c:2115 __sys_sendmsg+0xd9/0x180 net/socket.c:2153 __do_sys_sendmsg net/socket.c:2162 [inline] __se_sys_sendmsg net/socket.c:2160 [inline] __x64_sys_sendmsg+0x73/0xb0 net/socket.c:2160 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 7251: save_stack mm/kasan/kasan.c:448 [inline] set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x13c/0x220 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3503 [inline] kfree+0xcf/0x220 mm/slab.c:3822 nf_tables_table_destroy.isra.9+0xd4/0x110 net/netfilter/nf_tables_api.c:1062 nft_commit_release net/netfilter/nf_tables_api.c:6277 [inline] nf_tables_commit_release net/netfilter/nf_tables_api.c:6317 [inline] nf_tables_commit+0x12c5/0x4e60 net/netfilter/nf_tables_api.c:6607 nfnetlink_rcv_batch+0xb75/0x1520 net/netfilter/nfnetlink.c:487 nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:545 [inline] nfnetlink_rcv+0x2f1/0x3b0 net/netfilter/nfnetlink.c:563 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x443/0x660 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x667/0xc60 net/netlink/af_netlink.c:1909 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:632 ___sys_sendmsg+0x647/0x950 net/socket.c:2115 __sys_sendmsg+0xd9/0x180 net/socket.c:2153 __do_sys_sendmsg net/socket.c:2162 [inline] __se_sys_sendmsg net/socket.c:2160 [inline] __x64_sys_sendmsg+0x73/0xb0 net/socket.c:2160 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8881d650ad00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of 512-byte region [ffff8881d650ad00, ffff8881d650af00) The buggy address belongs to the page: page:ffffea0007594280 count:1 mapcount:0 mapping:ffff8881f6400940 index:0x0 flags: 0x17ffe0000000100(slab) raw: 017ffe0000000100 ffffea00075c9f48 ffffea00075c0208 ffff8881f6400940 raw: 0000000000000000 ffff8881d650a080 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881d650ac00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881d650ac80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881d650ad00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881d650ad80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881d650ae00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== list_del corruption, ffff8881d650ad00->prev is LIST_POISON2 (dead000000000200) ------------[ cut here ]------------ kernel BUG at lib/list_debug.c:50! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 1 PID: 7244 Comm: syz-executor.4 Tainted: G B 4.19.184-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:__list_del_entry_valid.cold.1+0x12/0x4a lib/list_debug.c:48 Code: f9 ff 0f 0b 48 89 f1 48 c7 c7 00 9f 67 87 48 89 de e8 fb 67 f9 ff 0f 0b 4c 89 e2 48 89 de 48 c7 c7 40 a0 67 87 e8 e7 67 f9 ff <0f> 0b 4c 89 ea 48 89 de 48 c7 c7 e0 9f 67 87 e8 d3 67 f9 ff 0f 0b RSP: 0018:ffff8881d8d1f4f8 EFLAGS: 00010282 RAX: 000000000000004e RBX: ffff8881d650ad00 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffffff87679d40 RDI: ffffffff8a1a0aa0 RBP: ffff8881d8d1f510 R08: ffffed103ed25081 R09: ffffed103ed25080 R10: ffffed103ed25080 R11: ffff8881f6928407 R12: dead000000000200 R13: ffff8881d7298100 R14: ffff8881d650ad08 R15: ffff8881db7d0b00 FS: 00007f124621c700(0000) GS:ffff8881f6900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f0f1cb63000 CR3: 00000001dadb2006 CR4: 00000000001606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __list_del_entry include/linux/list.h:117 [inline] list_del_rcu include/linux/rculist.h:130 [inline] __nf_tables_abort+0x1556/0x1eb0 net/netfilter/nf_tables_api.c:6660 nf_tables_abort+0xf/0x30 net/netfilter/nf_tables_api.c:6770 nfnetlink_rcv_batch+0x4e3/0x1520 net/netfilter/nfnetlink.c:496 nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:545 [inline] nfnetlink_rcv+0x2f1/0x3b0 net/netfilter/nfnetlink.c:563 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x443/0x660 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x667/0xc60 net/netlink/af_netlink.c:1909 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:632 ___sys_sendmsg+0x647/0x950 net/socket.c:2115 __sys_sendmsg+0xd9/0x180 net/socket.c:2153 __do_sys_sendmsg net/socket.c:2162 [inline] __se_sys_sendmsg net/socket.c:2160 [inline] __x64_sys_sendmsg+0x73/0xb0 net/socket.c:2160 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4650c9 Code: ff ff 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 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f124621c188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000055cf00 RCX: 00000000004650c9 RDX: 0000000000000000 RSI: 0000000020000280 RDI: 0000000000000003 RBP: 00000000004af711 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000055cf00 R13: 00007ffefbf675bf R14: 00007f124621c300 R15: 0000000000022000 Modules linked in: ---[ end trace f1d1aaa8c932e42e ]--- RIP: 0010:__list_del_entry_valid.cold.1+0x12/0x4a lib/list_debug.c:48 Code: f9 ff 0f 0b 48 89 f1 48 c7 c7 00 9f 67 87 48 89 de e8 fb 67 f9 ff 0f 0b 4c 89 e2 48 89 de 48 c7 c7 40 a0 67 87 e8 e7 67 f9 ff <0f> 0b 4c 89 ea 48 89 de 48 c7 c7 e0 9f 67 87 e8 d3 67 f9 ff 0f 0b RSP: 0018:ffff8881d8d1f4f8 EFLAGS: 00010282 RAX: 000000000000004e RBX: ffff8881d650ad00 RCX: 0000000000000000 list_del corruption, ffff8881d4b6d540->prev is LIST_POISON2 (dead000000000200) RDX: 0000000000000000 RSI: ffffffff87679d40 RDI: ffffffff8a1a0aa0 RBP: ffff8881d8d1f510 R08: ffffed103ed25081 R09: ffffed103ed25080 R10: ffffed103ed25080 R11: ffff8881f6928407 R12: dead000000000200 R13: ffff8881d7298100 R14: ffff8881d650ad08 R15: ffff8881db7d0b00 FS: 00007f124621c700(0000) GS:ffff8881f6900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffc27380ff0 CR3: 00000001dadb2006 CR4: 00000000001606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400