bisecting fixing commit since 961f830af0658ef5ef8a7708786d634a6115f16b building syzkaller on ff51e5229e0ee846d2fd687cb0dbca13de758c66 testing commit 961f830af0658ef5ef8a7708786d634a6115f16b compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: 78a2f075e22195ccaee7fed2b9e0cf19e71daa50f305efce00a39f3d993c713e all runs: crashed: KASAN: use-after-free Read in vlan_dev_get_iflink testing current HEAD 3f8a27f9e27bd78604c0709224cec0ec85a8b106 testing commit 3f8a27f9e27bd78604c0709224cec0ec85a8b106 compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: 31b51a4f0275ffaee70a47048cdccf5fcd5264b69baae1d1506ec23706de799b all runs: crashed: KASAN: use-after-free Read in vlan_dev_get_iflink revisions tested: 2, total time: 28m43.475543187s (build: 19m41.959222577s, test: 8m25.025766101s) the crash still happens on HEAD commit msg: Linux 4.19.211 crash: KASAN: use-after-free Read in vlan_dev_get_iflink netlink: 24 bytes leftover after parsing attributes in process `syz-executor.2'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.1'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.5'. ================================================================== BUG: KASAN: use-after-free in vlan_dev_get_iflink+0x5f/0x70 net/8021q/vlan_dev.c:771 Read of size 4 at addr ffff8881d46eafc8 by task syz-executor.0/16740 CPU: 0 PID: 16740 Comm: syz-executor.0 Not tainted 4.19.211-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_load4_noabort+0x14/0x20 mm/kasan/report.c:432 vlan_dev_get_iflink+0x5f/0x70 net/8021q/vlan_dev.c:771 dev_get_iflink+0x65/0xb0 net/core/dev.c:692 rfc2863_policy+0x185/0x240 net/core/link_watch.c:43 linkwatch_do_dev+0x12/0xc0 net/core/link_watch.c:157 linkwatch_forget_dev+0x14f/0x1f0 net/core/link_watch.c:223 netdev_wait_allrefs net/core/dev.c:8892 [inline] netdev_run_todo+0x222/0x690 net/core/dev.c:8988 rtnl_unlock net/core/rtnetlink.c:117 [inline] rtnetlink_rcv_msg+0x357/0x950 net/core/rtnetlink.c:4783 netlink_rcv_skb+0x13e/0x3d0 net/netlink/af_netlink.c:2463 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:4800 netlink_unicast_kernel net/netlink/af_netlink.c:1325 [inline] netlink_unicast+0x443/0x660 net/netlink/af_netlink.c:1351 netlink_sendmsg+0x671/0xc70 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:661 ___sys_sendmsg+0x647/0x950 net/socket.c:2227 __sys_sendmsg+0xd9/0x180 net/socket.c:2265 __do_sys_sendmsg net/socket.c:2274 [inline] __se_sys_sendmsg net/socket.c:2272 [inline] __x64_sys_sendmsg+0x73/0xb0 net/socket.c:2272 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x464909 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:00007fa3d0e94188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000055bf00 RCX: 0000000000464909 RDX: 0000000000000000 RSI: 0000000020000140 RDI: 0000000000000003 RBP: 00000000004ae620 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000055bf00 R13: 00007ffdd7778b6f R14: 00007fa3d0e94300 R15: 0000000000022000 Allocated by task 16740: 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_node mm/slab.c:3689 [inline] __kmalloc_node+0x50/0x70 mm/slab.c:3696 kmalloc_node include/linux/slab.h:557 [inline] kvmalloc_node+0x68/0x70 mm/util.c:423 kvmalloc include/linux/mm.h:577 [inline] kvzalloc include/linux/mm.h:585 [inline] alloc_netdev_mqs+0x5d/0xc80 net/core/dev.c:9152 rtnl_create_link+0x1a8/0xac0 net/core/rtnetlink.c:2869 rtnl_newlink+0xbf8/0x1360 net/core/rtnetlink.c:3131 rtnetlink_rcv_msg+0x34f/0x950 net/core/rtnetlink.c:4782 netlink_rcv_skb+0x13e/0x3d0 net/netlink/af_netlink.c:2463 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:4800 netlink_unicast_kernel net/netlink/af_netlink.c:1325 [inline] netlink_unicast+0x443/0x660 net/netlink/af_netlink.c:1351 netlink_sendmsg+0x671/0xc70 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:661 ___sys_sendmsg+0x647/0x950 net/socket.c:2227 __sys_sendmsg+0xd9/0x180 net/socket.c:2265 __do_sys_sendmsg net/socket.c:2274 [inline] __se_sys_sendmsg net/socket.c:2272 [inline] __x64_sys_sendmsg+0x73/0xb0 net/socket.c:2272 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 16780: 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 kvfree+0x2c/0x30 mm/util.c:452 netdev_freemem+0x47/0x60 net/core/dev.c:9106 netdev_release+0x6c/0x90 net/core/net-sysfs.c:1695 device_release+0x71/0x1d0 drivers/base/core.c:1076 kobject_cleanup lib/kobject.c:662 [inline] kobject_release lib/kobject.c:691 [inline] kref_put include/linux/kref.h:70 [inline] kobject_put+0x115/0x1f0 lib/kobject.c:708 netdev_run_todo+0x459/0x690 net/core/dev.c:9011 rtnl_unlock net/core/rtnetlink.c:117 [inline] rtnetlink_rcv_msg+0x357/0x950 net/core/rtnetlink.c:4783 netlink_rcv_skb+0x13e/0x3d0 net/netlink/af_netlink.c:2463 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:4800 netlink_unicast_kernel net/netlink/af_netlink.c:1325 [inline] netlink_unicast+0x443/0x660 net/netlink/af_netlink.c:1351 netlink_sendmsg+0x671/0xc70 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:661 ___sys_sendmsg+0x647/0x950 net/socket.c:2227 __sys_sendmsg+0xd9/0x180 net/socket.c:2265 __do_sys_sendmsg net/socket.c:2274 [inline] __se_sys_sendmsg net/socket.c:2272 [inline] __x64_sys_sendmsg+0x73/0xb0 net/socket.c:2272 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 ffff8881d46eaec0 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 264 bytes inside of 4096-byte region [ffff8881d46eaec0, ffff8881d46ebec0) The buggy address belongs to the page: page:ffffea000751ba80 count:1 mapcount:0 mapping:ffff8881f6400dc0 index:0x0 compound_mapcount: 0 flags: 0x17ffe0000008100(slab|head) raw: 017ffe0000008100 ffffea00073d0008 ffffea0007512208 ffff8881f6400dc0 raw: 0000000000000000 ffff8881d46eaec0 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881d46eae80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ffff8881d46eaf00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881d46eaf80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881d46eb000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881d46eb080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'. nla_parse: 132 callbacks suppressed netlink: 24 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.2'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.1'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.2'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'. nla_parse: 153 callbacks suppressed netlink: 24 bytes leftover after parsing attributes in process `syz-executor.2'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.1'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.1'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.2'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'.