bisecting fixing commit since d09b80172c22df7a5e2ec58aa1a0fbe8914752e7 building syzkaller on 54289b0835634ca07a8117613c48b73e9e647d13 testing commit d09b80172c22df7a5e2ec58aa1a0fbe8914752e7 with gcc (GCC) 8.1.0 kernel signature: ff8d762a6d03c5f5696a3bfaca94f5529e701ce01c4b737d243d70a5f910fd65 all runs: crashed: KASAN: use-after-free Read in tcf_action_destroy testing current HEAD daefdc9eb24bfa11ab77a4b2a9c3923f1051fe0b testing commit daefdc9eb24bfa11ab77a4b2a9c3923f1051fe0b with gcc (GCC) 8.1.0 kernel signature: 0753767d623ebd5be865fdb43c3a830375cd6addf382a0e1e791e0e6ad5a2c6b all runs: crashed: KASAN: use-after-free Read in tcf_action_destroy revisions tested: 2, total time: 25m59.812109324s (build: 19m40.986472825s, test: 5m42.384853342s) the crash still happens on HEAD commit msg: Linux 4.19.161 crash: KASAN: use-after-free Read in tcf_action_destroy netlink: 32 bytes leftover after parsing attributes in process `syz-executor.3'. wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 netlink: 32 bytes leftover after parsing attributes in process `syz-executor.2'. wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 ================================================================== BUG: KASAN: use-after-free in tcf_action_destroy+0xda/0xf0 net/sched/act_api.c:655 Read of size 8 at addr ffff8881f4472640 by task syz-executor.1/7406 CPU: 0 PID: 7406 Comm: syz-executor.1 Not tainted 4.19.161-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/0x22a 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.cold.7+0x242/0x307 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 tcf_action_destroy+0xda/0xf0 net/sched/act_api.c:655 tcf_action_init+0x292/0x300 net/sched/act_api.c:949 tcf_action_add+0xf2/0x320 net/sched/act_api.c:1314 tc_ctl_action+0x28d/0x3c6 net/sched/act_api.c:1369 rtnetlink_rcv_msg+0x34f/0x950 net/core/rtnetlink.c:4778 netlink_rcv_skb+0x13e/0x3d0 net/netlink/af_netlink.c:2455 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:4796 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x443/0x660 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x666/0xc50 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:0x45e179 Code: 3d b2 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 0b b2 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fd2d6bc1c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000002cf80 RCX: 000000000045e179 RDX: 0000000000000000 RSI: 0000000020002980 RDI: 0000000000000003 RBP: 000000000118cf80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c R13: 00007ffc4194553f R14: 00007fd2d6bc29c0 R15: 000000000118cf4c Allocated by task 7406: 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 __do_kmalloc mm/slab.c:3727 [inline] __kmalloc+0x15d/0x3d0 mm/slab.c:3736 kmalloc include/linux/slab.h:520 [inline] kzalloc include/linux/slab.h:709 [inline] tcf_idr_create+0x55/0x560 net/sched/act_api.c:361 tcf_connmark_init+0x3d8/0x6a0 net/sched/act_connmark.c:127 tcf_action_init_1+0x70e/0xb40 net/sched/act_api.c:870 tcf_action_init+0x178/0x300 net/sched/act_api.c:933 tcf_action_add+0xf2/0x320 net/sched/act_api.c:1314 tc_ctl_action+0x28d/0x3c6 net/sched/act_api.c:1369 rtnetlink_rcv_msg+0x34f/0x950 net/core/rtnetlink.c:4778 netlink_rcv_skb+0x13e/0x3d0 net/netlink/af_netlink.c:2455 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:4796 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x443/0x660 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x666/0xc50 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 7417: 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 free_tcf net/sched/act_api.c:90 [inline] tcf_action_cleanup+0xfd/0x130 net/sched/act_api.c:99 __tcf_action_put+0xbe/0x100 net/sched/act_api.c:112 __tcf_idr_release+0x6a/0x90 net/sched/act_api.c:142 tcf_del_walker net/sched/act_api.c:266 [inline] tcf_generic_walker+0x581/0x940 net/sched/act_api.c:292 tcf_connmark_walker+0x113/0x1d0 net/sched/act_connmark.c:194 tca_action_flush net/sched/act_api.c:1142 [inline] tca_action_gd+0x7ae/0x1440 net/sched/act_api.c:1248 tc_ctl_action+0x1fe/0x3c6 net/sched/act_api.c:1373 rtnetlink_rcv_msg+0x34f/0x950 net/core/rtnetlink.c:4778 netlink_rcv_skb+0x13e/0x3d0 net/netlink/af_netlink.c:2455 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:4796 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x443/0x660 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x666/0xc50 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 ffff8881f4472640 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 0 bytes inside of 256-byte region [ffff8881f4472640, ffff8881f4472740) The buggy address belongs to the page: page:ffffea0007d11c80 count:1 mapcount:0 mapping:ffff8881f60007c0 index:0x0 flags: 0x17ffe0000000100(slab) raw: 017ffe0000000100 ffffea0007d11708 ffffea000752fec8 ffff8881f60007c0 raw: 0000000000000000 ffff8881f4472000 000000010000000c 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881f4472500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881f4472580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881f4472600: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff8881f4472680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881f4472700: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================