bisecting fixing commit since 57f780f1c43362b86fd23d20bd940e2468237716 building syzkaller on 15cea0a381c6ef9a7b4ffb2770360ce8882274c5 testing commit 57f780f1c43362b86fd23d20bd940e2468237716 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 93ad05cc496500a9477f7a1420811f392de6bc7ecfc10bdbae08232d4b374a3d run #0: crashed: KASAN: use-after-free Read in route4_destroy run #1: crashed: WARNING: ODEBUG bug in route4_destroy run #2: crashed: WARNING: ODEBUG bug in route4_destroy run #3: crashed: WARNING: ODEBUG bug in route4_destroy run #4: crashed: KASAN: use-after-free Read in route4_get run #5: crashed: WARNING: ODEBUG bug in route4_destroy run #6: crashed: WARNING: ODEBUG bug in route4_destroy run #7: crashed: WARNING: ODEBUG bug in route4_destroy run #8: crashed: WARNING: ODEBUG bug in route4_destroy run #9: crashed: WARNING: ODEBUG bug in route4_change run #10: crashed: KASAN: use-after-free Read in route4_destroy run #11: crashed: WARNING: ODEBUG bug in route4_destroy run #12: crashed: KASAN: use-after-free Read in route4_destroy run #13: crashed: KASAN: use-after-free Read in route4_get run #14: crashed: KASAN: use-after-free Read in route4_get run #15: crashed: KASAN: use-after-free Read in route4_destroy run #16: crashed: KASAN: use-after-free Read in route4_destroy run #17: crashed: KASAN: use-after-free Read in route4_destroy run #18: crashed: KASAN: use-after-free Read in route4_destroy run #19: crashed: KASAN: use-after-free Read in route4_destroy testing current HEAD d6d86830705f173fca6087a3e67ceaf68db80523 testing commit d6d86830705f173fca6087a3e67ceaf68db80523 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: def49d9c0e3c891620ad62375c75ecfd12d5620c2b90cb3f85d9b62f3495f296 run #0: crashed: WARNING: ODEBUG bug in route4_destroy run #1: crashed: KASAN: use-after-free Read in route4_get run #2: crashed: KASAN: use-after-free Read in route4_destroy run #3: crashed: WARNING: ODEBUG bug in route4_destroy run #4: crashed: KASAN: use-after-free Read in route4_destroy run #5: crashed: WARNING: ODEBUG bug in route4_destroy run #6: crashed: KASAN: use-after-free Read in route4_destroy run #7: crashed: KASAN: use-after-free Read in route4_destroy run #8: crashed: KASAN: use-after-free Read in route4_destroy run #9: crashed: KASAN: use-after-free Read in route4_destroy revisions tested: 2, total time: 20m3.201752065s (build: 13m4.028325593s, test: 6m20.464620828s) the crash still happens on HEAD commit msg: net ticp:fix a kernel-infoleak in __tipc_sendmsg() crash: KASAN: use-after-free Read in route4_destroy ================================================================== BUG: KASAN: use-after-free in route4_destroy+0x4fc/0x7d0 net/sched/cls_route.c:295 Read of size 8 at addr ffff8880730cdb00 by task syz-executor.3/3999 CPU: 1 PID: 3999 Comm: syz-executor.3 Not tainted 5.16.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x57/0x7d lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x320 mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:433 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:450 route4_destroy+0x4fc/0x7d0 net/sched/cls_route.c:295 tcf_proto_destroy+0x63/0x2d0 net/sched/cls_api.c:297 tcf_chain_flush+0x1d7/0x2e0 net/sched/cls_api.c:615 tcf_block_flush_all_chains net/sched/cls_api.c:1017 [inline] __tcf_block_put+0x106/0x3f0 net/sched/cls_api.c:1179 tcf_block_put_ext net/sched/cls_api.c:1384 [inline] tcf_block_put_ext net/sched/cls_api.c:1376 [inline] tcf_block_put+0xcf/0x110 net/sched/cls_api.c:1394 drr_destroy_qdisc+0x3f/0x1a0 net/sched/sch_drr.c:455 qdisc_destroy+0xa5/0x390 net/sched/sch_generic.c:1020 notify_and_destroy net/sched/sch_api.c:1012 [inline] qdisc_graft+0xa5e/0x1030 net/sched/sch_api.c:1084 tc_modify_qdisc+0x969/0x1630 net/sched/sch_api.c:1671 rtnetlink_rcv_msg+0x31d/0x8d0 net/core/rtnetlink.c:5571 netlink_rcv_skb+0x118/0x370 net/netlink/af_netlink.c:2496 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x42e/0x700 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x770/0xc10 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:724 ____sys_sendmsg+0x5bf/0x7a0 net/socket.c:2409 ___sys_sendmsg+0xd3/0x150 net/socket.c:2463 __sys_sendmsg+0xb2/0x140 net/socket.c:2492 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x4665f9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f9955232188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665f9 RDX: 0000000000000000 RSI: 0000000020000040 RDI: 0000000000000004 RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffc5423211f R14: 00007f9955232300 R15: 0000000000022000 Allocated by task 3985: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:590 [inline] kzalloc include/linux/slab.h:724 [inline] route4_change+0x244/0x1f00 net/sched/cls_route.c:493 tc_new_tfilter+0x811/0x1f00 net/sched/cls_api.c:2125 rtnetlink_rcv_msg+0x600/0x8d0 net/core/rtnetlink.c:5562 netlink_rcv_skb+0x118/0x370 net/netlink/af_netlink.c:2496 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x42e/0x700 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x770/0xc10 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:724 ____sys_sendmsg+0x5bf/0x7a0 net/socket.c:2409 ___sys_sendmsg+0xd3/0x150 net/socket.c:2463 __sys_sendmsg+0xb2/0x140 net/socket.c:2492 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 1318: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xff/0x130 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:1723 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1749 slab_free mm/slub.c:3513 [inline] kfree+0xf6/0x560 mm/slub.c:4561 __route4_delete_filter net/sched/cls_route.c:257 [inline] route4_delete_filter_work+0x71/0xa0 net/sched/cls_route.c:266 process_one_work+0x87f/0x1420 kernel/workqueue.c:2298 worker_thread+0x5a6/0xf90 kernel/workqueue.c:2445 kthread+0x3ab/0x480 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Last potentially related work creation: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 __kasan_record_aux_stack+0xf5/0x120 mm/kasan/generic.c:348 insert_work+0x42/0x300 kernel/workqueue.c:1354 __queue_work+0x4a5/0xc80 kernel/workqueue.c:1520 rcu_work_rcufn+0x3d/0x60 kernel/workqueue.c:1756 rcu_do_batch kernel/rcu/tree.c:2506 [inline] rcu_core+0x7ab/0x14a0 kernel/rcu/tree.c:2741 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 Second to last potentially related work creation: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 __kasan_record_aux_stack+0xf5/0x120 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:2985 [inline] call_rcu+0xb1/0x740 kernel/rcu/tree.c:3065 queue_rcu_work+0x51/0x60 kernel/workqueue.c:1776 route4_change+0x14bd/0x1f00 net/sched/cls_route.c:550 tc_new_tfilter+0x811/0x1f00 net/sched/cls_api.c:2125 rtnetlink_rcv_msg+0x600/0x8d0 net/core/rtnetlink.c:5562 netlink_rcv_skb+0x118/0x370 net/netlink/af_netlink.c:2496 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x42e/0x700 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x770/0xc10 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:724 ____sys_sendmsg+0x5bf/0x7a0 net/socket.c:2409 ___sys_sendmsg+0xd3/0x150 net/socket.c:2463 __sys_sendmsg+0xb2/0x140 net/socket.c:2492 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff8880730cdb00 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 0 bytes inside of 192-byte region [ffff8880730cdb00, ffff8880730cdbc0) The buggy address belongs to the page: page:ffffea0001cc3340 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x730cd flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 0000000000000000 dead000000000122 ffff88800fc41a00 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 3920, ts 61935716061, free_ts 61935542533 prep_new_page mm/page_alloc.c:2418 [inline] get_page_from_freelist+0xa6f/0x2f10 mm/page_alloc.c:4149 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5369 __alloc_pages_node include/linux/gfp.h:570 [inline] alloc_slab_page mm/slub.c:1795 [inline] allocate_slab mm/slub.c:1930 [inline] new_slab+0xab/0x4a0 mm/slub.c:1993 ___slab_alloc+0x91a/0xfd0 mm/slub.c:3022 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3109 slab_alloc_node mm/slub.c:3200 [inline] __kmalloc_node+0x2cb/0x390 mm/slub.c:4467 kmalloc_array_node include/linux/slab.h:686 [inline] kcalloc_node include/linux/slab.h:691 [inline] memcg_alloc_page_obj_cgroups+0x8b/0x140 mm/memcontrol.c:2827 account_slab_page mm/slab.h:424 [inline] allocate_slab mm/slub.c:1946 [inline] new_slab+0x383/0x4a0 mm/slub.c:1993 ___slab_alloc+0x91a/0xfd0 mm/slub.c:3022 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3109 slab_alloc_node mm/slub.c:3200 [inline] slab_alloc mm/slub.c:3242 [inline] kmem_cache_alloc+0x35c/0x3a0 mm/slub.c:3247 sock_alloc_inode+0x13/0x1b0 net/socket.c:303 alloc_inode+0x56/0x1e0 fs/inode.c:235 new_inode_pseudo+0x9/0xd0 fs/inode.c:944 sock_alloc+0x37/0x250 net/socket.c:626 __sock_create+0x77/0x590 net/socket.c:1428 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1338 [inline] free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3309 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3388 __vunmap+0x5a1/0x960 mm/vmalloc.c:2632 __do_replace+0x133/0x8e0 net/ipv4/netfilter/ip_tables.c:1100 do_replace net/ipv4/netfilter/ip_tables.c:1140 [inline] do_ipt_set_ctl+0x78e/0xc00 net/ipv4/netfilter/ip_tables.c:1630 nf_setsockopt+0x6a/0xc0 net/netfilter/nf_sockopt.c:101 ip_setsockopt+0x410/0x2f40 net/ipv4/ip_sockglue.c:1444 tcp_setsockopt+0x10d/0x1f80 net/ipv4/tcp.c:3655 __sys_setsockopt+0x1fd/0x4e0 net/socket.c:2176 __do_sys_setsockopt net/socket.c:2187 [inline] __se_sys_setsockopt net/socket.c:2184 [inline] __x64_sys_setsockopt+0xb5/0x150 net/socket.c:2184 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff8880730cda00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880730cda80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8880730cdb00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880730cdb80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880730cdc00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================