bisecting fixing commit since 961f830af0658ef5ef8a7708786d634a6115f16b building syzkaller on ff51e5229e0ee846d2fd687cb0dbca13de758c66 testing commit 961f830af0658ef5ef8a7708786d634a6115f16b with gcc (GCC) 8.4.1 20210217 kernel signature: da6d44440e9daf7f73a64c3e4903ec344307fd6758112101108e65cdbb494b85 all runs: crashed: KASAN: use-after-free Read in vlan_dev_get_iflink testing current HEAD 1e986fe9ad15b8406034c504afc5ae76f0a8e852 testing commit 1e986fe9ad15b8406034c504afc5ae76f0a8e852 with gcc (GCC) 8.4.1 20210217 kernel signature: de4d87862b915f4b8689ae0c9f3d807f658eeb07b349b860521614c34fa7e92d all runs: crashed: KASAN: use-after-free Read in vlan_dev_get_iflink revisions tested: 2, total time: 29m32.619155156s (build: 21m10.772368184s, test: 7m47.59737187s) the crash still happens on HEAD commit msg: Linux 4.19.191 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.4'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'. ================================================================== BUG: KASAN: use-after-free in vlan_dev_get_iflink+0x5f/0x70 net/8021q/vlan_dev.c:771 Read of size 4 at addr ffff8881dfd40f48 by task syz-executor.3/23373 CPU: 0 PID: 23373 Comm: syz-executor.3 Not tainted 4.19.191-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:8884 [inline] netdev_run_todo+0x222/0x690 net/core/dev.c:8980 rtnl_unlock net/core/rtnetlink.c:117 [inline] rtnetlink_rcv_msg+0x357/0x950 net/core/rtnetlink.c:4779 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: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:00007f86c1652188 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: 00007ffd3b8ebc0f R14: 00007f86c1652300 R15: 0000000000022000 Allocated by task 23373: 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:9144 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: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 23406: 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:9098 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:9003 rtnl_unlock net/core/rtnetlink.c:117 [inline] rtnetlink_rcv_msg+0x357/0x950 net/core/rtnetlink.c:4779 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 ffff8881dfd40e40 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 264 bytes inside of 4096-byte region [ffff8881dfd40e40, ffff8881dfd41e40) The buggy address belongs to the page: page:ffffea00077f5000 count:1 mapcount:0 mapping:ffff8881f6400dc0 index:0x0 compound_mapcount: 0 flags: 0x17ffe0000008100(slab|head) raw: 017ffe0000008100 ffffea0007a56588 ffffea00079cbc88 ffff8881f6400dc0 raw: 0000000000000000 ffff8881dfd40e40 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881dfd40e00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ffff8881dfd40e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881dfd40f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881dfd40f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881dfd41000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== nla_parse: 121 callbacks suppressed 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.0'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.2'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'. 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.3'. nla_parse: 150 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.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'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.0'. 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.2'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'.