bisecting fixing commit since d09b80172c22df7a5e2ec58aa1a0fbe8914752e7 building syzkaller on 54289b0835634ca07a8117613c48b73e9e647d13 testing commit d09b80172c22df7a5e2ec58aa1a0fbe8914752e7 with gcc (GCC) 8.4.1 20210217 kernel signature: a541e3575478d589824aefe5a8751be67c3dc48b4d4c813c3ecd27a34390cdac all runs: crashed: KASAN: use-after-free Read in tcf_action_destroy testing current HEAD 255b58a2b3af0baa0ee11507390349217b8b73b0 testing commit 255b58a2b3af0baa0ee11507390349217b8b73b0 with gcc (GCC) 8.4.1 20210217 kernel signature: 719b81cc27a7f75ed761d3e9e208b704808194cc9f7eed3cab0ffe33d9a4f04e all runs: crashed: KASAN: use-after-free Read in tcf_action_destroy revisions tested: 2, total time: 29m50.37595201s (build: 16m23.749959148s, test: 12m31.29781595s) the crash still happens on HEAD commit msg: Linux 4.19.176 crash: KASAN: use-after-free Read in tcf_action_destroy netlink: 32 bytes leftover after parsing attributes in process `syz-executor044'. netlink: 32 bytes leftover after parsing attributes in process `syz-executor044'. netlink: 32 bytes leftover after parsing attributes in process `syz-executor044'. netlink: 32 bytes leftover after parsing attributes in process `syz-executor044'. ================================================================== BUG: KASAN: use-after-free in tcf_action_destroy+0xda/0xf0 net/sched/act_api.c:655 Read of size 8 at addr ffff8881dc6e7280 by task syz-executor044/2257 CPU: 0 PID: 2257 Comm: syz-executor044 Not tainted 4.19.176-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 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/0x3d0 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+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:0x445c79 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fe8534c5318 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00000000004cb428 RCX: 0000000000445c79 RDX: 0000000000000000 RSI: 0000000020002980 RDI: 0000000000000003 RBP: 00000000004cb420 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 6b72616d6e6e6f63 R13: 00007fff77e6f01f R14: 00007fe8534c5400 R15: 0000000000022000 Allocated by task 2248: 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+0x837/0xaf0 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/0x3d0 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+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 2248: 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 net/sched/act_api.c:142 [inline] __tcf_idr_release+0x6a/0x90 net/sched/act_api.c:122 tcf_action_destroy+0x7d/0xf0 net/sched/act_api.c:656 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/0x3d0 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+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 ffff8881dc6e7280 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 0 bytes inside of 256-byte region [ffff8881dc6e7280, ffff8881dc6e7380) The buggy address belongs to the page: page:ffffea000771b9c0 count:1 mapcount:0 mapping:ffff8881f60007c0 index:0x0 flags: 0x17ffe0000000100(slab) raw: 017ffe0000000100 ffffea00077b8708 ffffea000771d288 ffff8881f60007c0 raw: 0000000000000000 ffff8881dc6e7000 000000010000000c 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881dc6e7180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881dc6e7200: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8881dc6e7280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881dc6e7300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881dc6e7380: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ==================================================================