bisecting fixing commit since d09b80172c22df7a5e2ec58aa1a0fbe8914752e7 building syzkaller on 54289b0835634ca07a8117613c48b73e9e647d13 testing commit d09b80172c22df7a5e2ec58aa1a0fbe8914752e7 with gcc (GCC) 8.1.0 kernel signature: 7be68e09f6466c967ef76fa7fdb3d445a5d03642db31ec12a9ba426222647340 all runs: crashed: KASAN: use-after-free Read in tcf_action_destroy testing current HEAD ad326970d25cc85128cd22d62398751ad072efff testing commit ad326970d25cc85128cd22d62398751ad072efff with gcc (GCC) 8.1.0 kernel signature: b3796ecfd101a371f7c9309cecbe73b717fd2b9b96add479ce05a8023ef9b616 all runs: crashed: KASAN: use-after-free Read in tcf_action_destroy revisions tested: 2, total time: 24m36.99026437s (build: 18m0.059219549s, test: 6m6.572754287s) the crash still happens on HEAD commit msg: Linux 4.19.152 crash: KASAN: use-after-free Read in tcf_action_destroy IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready netlink: 32 bytes leftover after parsing attributes in process `syz-executor.2'. wlan0: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan0: 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 ffff88809eeb1200 by task syz-executor.2/8072 CPU: 1 PID: 8072 Comm: syz-executor.2 Not tainted 4.19.152-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:00007f215c7efc78 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: 00007ffc5330ebff R14: 00007f215c7f09c0 R15: 000000000118cf4c Allocated by task 8072: 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 8083: 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 ffff88809eeb1200 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 0 bytes inside of 256-byte region [ffff88809eeb1200, ffff88809eeb1300) The buggy address belongs to the page: page:ffffea00027bac40 count:1 mapcount:0 mapping:ffff88813bff67c0 index:0x0 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffffea000280dec8 ffffea00027bc948 ffff88813bff67c0 raw: 0000000000000000 ffff88809eeb10c0 000000010000000c 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809eeb1100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88809eeb1180: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88809eeb1200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809eeb1280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809eeb1300: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ==================================================================