IPVS: ftp: loaded support on port[0] = 21 ================================================================== BUG: KASAN: use-after-free in dev_put include/linux/netdevice.h:3662 [inline] BUG: KASAN: use-after-free in netdevice_event_work_handler+0x15b/0x1b0 drivers/infiniband/core/roce_gid_mgmt.c:626 Read of size 8 at addr ffff88803ee08600 by task kworker/u4:5/9513 CPU: 0 PID: 9513 Comm: kworker/u4:5 Not tainted 4.19.163-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: gid-cache-wq netdevice_event_work_handler Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2fe lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1c7 mm/kasan/report.c:354 kasan_report mm/kasan/report.c:412 [inline] __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433 dev_put include/linux/netdevice.h:3662 [inline] netdevice_event_work_handler+0x15b/0x1b0 drivers/infiniband/core/roce_gid_mgmt.c:626 process_one_work+0x864/0x1570 kernel/workqueue.c:2155 worker_thread+0x64c/0x1130 kernel/workqueue.c:2298 kthread+0x33f/0x460 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Allocated by task 29287: __do_kmalloc_node mm/slab.c:3689 [inline] __kmalloc_node+0x4c/0x70 mm/slab.c:3696 kmalloc_node include/linux/slab.h:557 [inline] kvmalloc_node+0x61/0xf0 mm/util.c:423 IPVS: ftp: loaded support on port[0] = 21 kvmalloc include/linux/mm.h:577 [inline] kvzalloc include/linux/mm.h:585 [inline] alloc_netdev_mqs+0x97/0xd50 net/core/dev.c:9139 __ip_tunnel_create+0x201/0x580 net/ipv4/ip_tunnel.c:267 ip_tunnel_init_net+0x330/0x990 net/ipv4/ip_tunnel.c:1025 ops_init+0xb3/0x410 net/core/net_namespace.c:129 setup_net+0x2c2/0x720 net/core/net_namespace.c:315 copy_net_ns+0x1f7/0x335 net/core/net_namespace.c:438 create_new_namespaces+0x3f6/0x7b0 kernel/nsproxy.c:107 copy_namespaces+0x325/0x3c0 kernel/nsproxy.c:165 copy_process.part.0+0x3a59/0x8200 kernel/fork.c:1919 copy_process kernel/fork.c:1713 [inline] _do_fork+0x22f/0xf30 kernel/fork.c:2228 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 29287: __cache_free mm/slab.c:3503 [inline] kfree+0xcc/0x210 mm/slab.c:3822 kvfree+0x59/0x60 mm/util.c:452 device_release+0x76/0x210 drivers/base/core.c:1061 kobject_cleanup lib/kobject.c:662 [inline] kobject_release lib/kobject.c:691 [inline] kref_put include/linux/kref.h:70 [inline] kobject_put+0x28b/0x5d0 lib/kobject.c:708 put_device+0x1c/0x30 drivers/base/core.c:2251 free_netdev+0x309/0x410 net/core/dev.c:9252 __ip_tunnel_create+0x48f/0x580 net/ipv4/ip_tunnel.c:287 ip_tunnel_init_net+0x330/0x990 net/ipv4/ip_tunnel.c:1025 ops_init+0xb3/0x410 net/core/net_namespace.c:129 setup_net+0x2c2/0x720 net/core/net_namespace.c:315 copy_net_ns+0x1f7/0x335 net/core/net_namespace.c:438 create_new_namespaces+0x3f6/0x7b0 kernel/nsproxy.c:107 copy_namespaces+0x325/0x3c0 kernel/nsproxy.c:165 copy_process.part.0+0x3a59/0x8200 kernel/fork.c:1919 copy_process kernel/fork.c:1713 [inline] _do_fork+0x22f/0xf30 kernel/fork.c:2228 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88803ee080c0 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 1344 bytes inside of 4096-byte region [ffff88803ee080c0, ffff88803ee090c0) The buggy address belongs to the page: page:ffffea0000fb8200 count:1 mapcount:0 mapping:ffff88813bff0dc0 index:0x0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea000171f408 ffffea000273a188 ffff88813bff0dc0 raw: 0000000000000000 ffff88803ee080c0 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88803ee08500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803ee08580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88803ee08600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803ee08680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803ee08700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================