bisecting fixing commit since d183c8e2647a7d45202c14a33631f6c09020f8ac building syzkaller on dd56146d2611f7de0fbb7d8db6c016d3dcdc6371 testing commit d183c8e2647a7d45202c14a33631f6c09020f8ac with gcc (GCC) 8.1.0 kernel signature: 881b2b2e55c84fce7f64cc18f4ad50e86673435d55b98926a1e907d153fbc34a all runs: crashed: KASAN: use-after-free Read in __nf_tables_abort testing current HEAD 2d16cf4817bc6944a2adb5bf4db607c8258e87da testing commit 2d16cf4817bc6944a2adb5bf4db607c8258e87da with gcc (GCC) 8.1.0 kernel signature: 4d83412a3d98800fda7f1912bddbfe99348035dd7fbcb2f786da41b6f7f69149 all runs: crashed: KASAN: use-after-free Read in __nf_tables_abort revisions tested: 2, total time: 25m31.252407723s (build: 18m6.122486695s, test: 6m30.442217666s) the crash still happens on HEAD commit msg: Linux 4.19.125 crash: KASAN: use-after-free Read in __nf_tables_abort 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 ================================================================== list_del corruption, ffff8880a642d080->prev is LIST_POISON2 (dead000000000200) BUG: KASAN: use-after-free in __list_del_entry_valid+0xd0/0xf3 lib/list_debug.c:42 Read of size 8 at addr ffff8880a642d308 by task syz-executor.0/8674 CPU: 0 PID: 8674 Comm: syz-executor.0 Not tainted 4.19.125-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+0x123/0x177 lib/dump_stack.c:118 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 __list_del_entry_valid+0xd0/0xf3 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+0x1c0c/0x2d50 net/netfilter/nf_tables_api.c:6661 nf_tables_abort+0xf/0x30 net/netfilter/nf_tables_api.c:6771 nfnetlink_rcv_batch+0x4f6/0x14b0 net/netfilter/nfnetlink.c:491 nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:540 [inline] nfnetlink_rcv+0x2f1/0x3b0 net/netfilter/nfnetlink.c:558 ------------[ cut here ]------------ kernel BUG at lib/list_debug.c:50! netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x443/0x650 net/netlink/af_netlink.c:1344 invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 1 PID: 8677 Comm: syz-executor.2 Not tainted 4.19.125-syzkaller #0 netlink_sendmsg+0x765/0xc40 net/netlink/af_netlink.c:1909 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:__list_del_entry_valid.cold.1+0x12/0x58 lib/list_debug.c:48 Code: 1f fe 0f 0b 48 89 f1 48 c7 c7 c0 ad 67 87 48 89 de e8 59 21 1f fe 0f 0b 4c 89 e2 48 89 de 48 c7 c7 00 af 67 87 e8 45 21 1f fe <0f> 0b 4c 89 ea 48 89 de 48 c7 c7 a0 ae 67 87 e8 31 21 1f fe 0f 0b RSP: 0018:ffff88806f9474f8 EFLAGS: 00010282 RAX: 000000000000004e RBX: ffff8880a642d080 RCX: 0000000000000000 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:632 RDX: 0000000000000000 RSI: ffffffff8767ac00 RDI: ffffffff8a1a1aa0 ___sys_sendmsg+0x647/0x950 net/socket.c:2115 RBP: ffff88806f947510 R08: ffffed1015d65079 R09: ffffed1015d65078 R10: ffffed1015d65078 R11: ffff8880aeb283c7 R12: dead000000000200 R13: ffff88808f37c500 R14: ffff8880a642d088 R15: ffff88808f37c080 FS: 00007f98d24a9700(0000) GS:ffff8880aeb00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fff3b8f8c40 CR3: 000000008f649000 CR4: 00000000001406e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 __sys_sendmsg+0xd9/0x180 net/socket.c:2153 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+0x1c0c/0x2d50 net/netfilter/nf_tables_api.c:6661 nf_tables_abort+0xf/0x30 net/netfilter/nf_tables_api.c:6771 nfnetlink_rcv_batch+0x4f6/0x14b0 net/netfilter/nfnetlink.c:491 __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:0x45b349 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f3170754c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f31707556d4 RCX: 000000000045b349 nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:540 [inline] nfnetlink_rcv+0x2f1/0x3b0 net/netfilter/nfnetlink.c:558 RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000003 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 000000000000093b R14: 00000000004ca9f7 R15: 000000000075bf2c netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x443/0x650 net/netlink/af_netlink.c:1344 Allocated by task 8674: netlink_sendmsg+0x765/0xc40 net/netlink/af_netlink.c:1909 save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 kmem_cache_alloc_trace+0x152/0x740 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:709 [inline] nf_tables_newtable+0x617/0x1590 net/netfilter/nf_tables_api.c:882 nfnetlink_rcv_batch+0x8c8/0x14b0 net/netfilter/nfnetlink.c:430 nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:540 [inline] nfnetlink_rcv+0x2f1/0x3b0 net/netfilter/nfnetlink.c:558 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x443/0x650 net/netlink/af_netlink.c:1344 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:632 netlink_sendmsg+0x765/0xc40 net/netlink/af_netlink.c:1909 ___sys_sendmsg+0x647/0x950 net/socket.c:2115 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xb5/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 8688: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 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 __sys_sendmsg+0xd9/0x180 net/socket.c:2153 nf_tables_table_destroy.isra.55+0xd4/0x110 net/netfilter/nf_tables_api.c:1061 nft_commit_release net/netfilter/nf_tables_api.c:6278 [inline] nf_tables_commit_release net/netfilter/nf_tables_api.c:6318 [inline] nf_tables_commit+0x133f/0x3e60 net/netfilter/nf_tables_api.c:6608 nfnetlink_rcv_batch+0xb6d/0x14b0 net/netfilter/nfnetlink.c:482 nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:540 [inline] nfnetlink_rcv+0x2f1/0x3b0 net/netfilter/nfnetlink.c:558 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x443/0x650 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x765/0xc40 net/netlink/af_netlink.c:1909 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xb5/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_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 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45b349 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 The buggy address belongs to the object at ffff8880a642d300 which belongs to the cache kmalloc-512 of size 512 RSP: 002b:00007f98d24a8c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e The buggy address is located 8 bytes inside of 512-byte region [ffff8880a642d300, ffff8880a642d500) RAX: ffffffffffffffda RBX: 00007f98d24a96d4 RCX: 000000000045b349 RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000003 The buggy address belongs to the page: RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff page:ffffea0002990b40 count:1 mapcount:0 mapping:ffff88812c29c940 index:0xffff8880a642dd00 R13: 000000000000093b R14: 00000000004ca9f7 R15: 000000000075bf2c flags: 0xfffe0000000100(slab) Modules linked in: raw: 00fffe0000000100 ffffea000291cbc8 ffffea000240d448 ffff88812c29c940 ---[ end trace fb42d9747777fb57 ]--- raw: ffff8880a642dd00 ffff8880a642d080 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a642d200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a642d280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880a642d300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a642d380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a642d400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb RIP: 0010:__list_del_entry_valid.cold.1+0x12/0x58 lib/list_debug.c:48 ==================================================================