================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline] BUG: KASAN: use-after-free in atomic64_dec_if_positive include/asm-generic/atomic-instrumented.h:1176 [inline] BUG: KASAN: use-after-free in atomic_long_dec_if_positive include/asm-generic/atomic-long.h:515 [inline] BUG: KASAN: use-after-free in dec_ucount+0x54/0x130 kernel/ucount.c:249 Write of size 8 at addr ffff888026cf4540 by task kworker/u4:8/32546 CPU: 1 PID: 32546 Comm: kworker/u4:8 Not tainted 5.14.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: netns cleanup_net Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:105 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:436 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 instrument_atomic_read_write include/linux/instrumented.h:101 [inline] atomic64_dec_if_positive include/asm-generic/atomic-instrumented.h:1176 [inline] atomic_long_dec_if_positive include/asm-generic/atomic-long.h:515 [inline] dec_ucount+0x54/0x130 kernel/ucount.c:249 dec_net_namespaces net/core/net_namespace.c:394 [inline] cleanup_net+0x6f3/0xb10 net/core/net_namespace.c:611 process_one_work+0x98d/0x1630 kernel/workqueue.c:2276 worker_thread+0x658/0x11f0 kernel/workqueue.c:2422 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 32546: kasan_save_stack+0x1b/0x40 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+0x9b/0xd0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:591 [inline] netdevice_queue_work drivers/infiniband/core/roce_gid_mgmt.c:643 [inline] netdevice_event+0x1ab/0x830 drivers/infiniband/core/roce_gid_mgmt.c:802 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2123 __netdev_upper_dev_unlink+0x138/0x400 net/core/dev.c:8264 netdev_upper_dev_unlink+0x7c/0xb0 net/core/dev.c:8291 bond_upper_dev_unlink drivers/net/bonding/bond_main.c:1605 [inline] __bond_release_one+0x2d4/0x4d0 drivers/net/bonding/bond_main.c:2255 bond_slave_netdev_event drivers/net/bonding/bond_main.c:3494 [inline] bond_netdev_event+0x9b4/0xae0 drivers/net/bonding/bond_main.c:3605 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2123 call_netdevice_notifiers_extack net/core/dev.c:2135 [inline] call_netdevice_notifiers net/core/dev.c:2149 [inline] unregister_netdevice_many+0x951/0x1790 net/core/dev.c:11093 default_device_exit_batch+0x2fa/0x3c0 net/core/dev.c:11623 ops_exit_list+0x10d/0x160 net/core/net_namespace.c:178 cleanup_net+0x4ea/0xb10 net/core/net_namespace.c:595 process_one_work+0x98d/0x1630 kernel/workqueue.c:2276 worker_thread+0x658/0x11f0 kernel/workqueue.c:2422 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Freed by task 7440: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:360 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xfb/0x130 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1625 [inline] slab_free_freelist_hook+0xdf/0x240 mm/slub.c:1650 slab_free mm/slub.c:3210 [inline] kfree+0xe4/0x530 mm/slub.c:4264 process_one_work+0x98d/0x1630 kernel/workqueue.c:2276 worker_thread+0x658/0x11f0 kernel/workqueue.c:2422 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xe5/0x110 mm/kasan/generic.c:348 insert_work+0x48/0x370 kernel/workqueue.c:1332 __queue_work+0x5c1/0xed0 kernel/workqueue.c:1498 queue_work_on+0xee/0x110 kernel/workqueue.c:1525 queue_work include/linux/workqueue.h:507 [inline] netdevice_queue_work drivers/infiniband/core/roce_gid_mgmt.c:659 [inline] netdevice_event+0x47b/0x830 drivers/infiniband/core/roce_gid_mgmt.c:802 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2123 __netdev_upper_dev_unlink+0x138/0x400 net/core/dev.c:8264 netdev_upper_dev_unlink+0x7c/0xb0 net/core/dev.c:8291 bond_upper_dev_unlink drivers/net/bonding/bond_main.c:1605 [inline] __bond_release_one+0x2d4/0x4d0 drivers/net/bonding/bond_main.c:2255 bond_slave_netdev_event drivers/net/bonding/bond_main.c:3494 [inline] bond_netdev_event+0x9b4/0xae0 drivers/net/bonding/bond_main.c:3605 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2123 call_netdevice_notifiers_extack net/core/dev.c:2135 [inline] call_netdevice_notifiers net/core/dev.c:2149 [inline] unregister_netdevice_many+0x951/0x1790 net/core/dev.c:11093 default_device_exit_batch+0x2fa/0x3c0 net/core/dev.c:11623 ops_exit_list+0x10d/0x160 net/core/net_namespace.c:178 cleanup_net+0x4ea/0xb10 net/core/net_namespace.c:595 process_one_work+0x98d/0x1630 kernel/workqueue.c:2276 worker_thread+0x658/0x11f0 kernel/workqueue.c:2422 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Second to last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xe5/0x110 mm/kasan/generic.c:348 insert_work+0x48/0x370 kernel/workqueue.c:1332 __queue_work+0x5c1/0xed0 kernel/workqueue.c:1498 queue_work_on+0xee/0x110 kernel/workqueue.c:1525 queue_work include/linux/workqueue.h:507 [inline] call_usermodehelper_exec+0x1f0/0x4c0 kernel/umh.c:435 kobject_uevent_env+0xf8f/0x1650 lib/kobject_uevent.c:618 device_del+0x7eb/0xd40 drivers/base/core.c:3552 device_unregister+0x1f/0xc0 drivers/base/core.c:3575 device_destroy+0x96/0xd0 drivers/base/core.c:4121 vcs_remove_sysfs+0x1d/0x50 drivers/tty/vt/vc_screen.c:796 vc_deallocate+0x154/0x460 drivers/tty/vt/vt.c:1382 vt_disallocate drivers/tty/vt/vt_ioctl.c:637 [inline] vt_ioctl+0x25dc/0x2ac0 drivers/tty/vt/vt_ioctl.c:901 tty_ioctl+0xe4d/0x1600 drivers/tty/tty_io.c:2805 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:1069 [inline] __se_sys_ioctl fs/ioctl.c:1055 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:1055 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 ffff888026cf4500 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 64 bytes inside of 192-byte region [ffff888026cf4500, ffff888026cf45c0) The buggy address belongs to the page: page:ffffea00009b3d00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x26cf4 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0000811700 0000000900000006 ffff888010841a00 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 11526558067, free_ts 0 prep_new_page mm/page_alloc.c:2436 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4169 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5391 alloc_page_interleave+0x1e/0x200 mm/mempolicy.c:2119 alloc_pages+0x238/0x2a0 mm/mempolicy.c:2242 alloc_slab_page mm/slub.c:1688 [inline] allocate_slab+0x32e/0x4b0 mm/slub.c:1828 new_slab mm/slub.c:1891 [inline] new_slab_objects mm/slub.c:2637 [inline] ___slab_alloc+0x4ba/0x820 mm/slub.c:2800 __slab_alloc.constprop.0+0xa7/0xf0 mm/slub.c:2840 slab_alloc_node mm/slub.c:2922 [inline] slab_alloc mm/slub.c:2964 [inline] kmem_cache_alloc_trace+0x30f/0x3c0 mm/slub.c:2981 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] call_usermodehelper_setup+0x97/0x340 kernel/umh.c:365 kobject_uevent_env+0xf73/0x1650 lib/kobject_uevent.c:614 driver_register+0x2db/0x3a0 drivers/base/driver.c:179 __hid_register_driver+0x142/0x1d0 drivers/hid/hid-core.c:2555 do_one_initcall+0x103/0x650 init/main.c:1282 do_initcall_level init/main.c:1355 [inline] do_initcalls init/main.c:1371 [inline] do_basic_setup init/main.c:1391 [inline] kernel_init_freeable+0x6b8/0x741 init/main.c:1593 kernel_init+0x1a/0x1d0 init/main.c:1485 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 page_owner free stack trace missing Memory state around the buggy address: ffff888026cf4400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888026cf4480: 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888026cf4500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888026cf4580: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888026cf4600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================