bisecting fixing commit since d09b80172c22df7a5e2ec58aa1a0fbe8914752e7 building syzkaller on 54289b0835634ca07a8117613c48b73e9e647d13 testing commit d09b80172c22df7a5e2ec58aa1a0fbe8914752e7 with gcc (GCC) 8.1.0 kernel signature: 16d09f6be74f9b4d1d1d8d67efd5562021a152a6fce0d7a4497215e044f7d13e all runs: crashed: KASAN: use-after-free Read in tcf_action_destroy testing current HEAD 3207316b3beec7e38e5dbe2f463df0cec71e0b97 testing commit 3207316b3beec7e38e5dbe2f463df0cec71e0b97 with gcc (GCC) 8.1.0 kernel signature: 9031e27744350a4d32a8643be85678ff2ff5d62e2045fcbd788ce6c0ab8216de all runs: crashed: KASAN: use-after-free Read in tcf_action_destroy revisions tested: 2, total time: 29m36.813191769s (build: 18m53.883618901s, test: 10m6.208879666s) the crash still happens on HEAD commit msg: Linux 4.19.164 crash: KASAN: use-after-free Read in tcf_action_destroy netlink: 32 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 32 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 32 bytes leftover after parsing attributes in process `syz-executor.2'. netlink: 32 bytes leftover after parsing attributes in process `syz-executor.3'. ================================================================== BUG: KASAN: use-after-free in tcf_action_destroy+0xda/0xf0 net/sched/act_api.c:655 Read of size 8 at addr ffff8881e85b8900 by task syz-executor.5/28268 CPU: 1 PID: 28268 Comm: syz-executor.5 Not tainted 4.19.164-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:00007fc003fb8c78 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: 00007ffe828b508f R14: 00007fc003fb99c0 R15: 000000000118cf4c Allocated by task 28268: 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 28275: 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 ffff8881e85b8900 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 0 bytes inside of 256-byte region [ffff8881e85b8900, ffff8881e85b8a00) The buggy address belongs to the page: page:ffffea0007a16e00 count:1 mapcount:0 mapping:ffff8881f60007c0 index:0x0 flags: 0x17ffe0000000100(slab) raw: 017ffe0000000100 ffffea0007a15f88 ffffea0007839fc8 ffff8881f60007c0 raw: 0000000000000000 ffff8881e85b8040 000000010000000c 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881e85b8800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881e85b8880: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8881e85b8900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881e85b8980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881e85b8a00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ==================================================================