================================================================== 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:245 Write of size 8 at addr ffff888026314440 by task kworker/u4:5/266 CPU: 0 PID: 266 Comm: kworker/u4:5 Not tainted 5.14.0-rc4-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:245 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 9553: 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] addr_event.part.0+0x7b/0x4d0 drivers/infiniband/core/roce_gid_mgmt.c:840 addr_event drivers/infiniband/core/roce_gid_mgmt.c:824 [inline] inet6addr_event+0x13e/0x1b0 drivers/infiniband/core/roce_gid_mgmt.c:883 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 atomic_notifier_call_chain+0x70/0x180 kernel/notifier.c:217 ipv6_add_addr+0x1705/0x1f00 net/ipv6/addrconf.c:1152 addrconf_add_linklocal+0x1ca/0x590 net/ipv6/addrconf.c:3182 addrconf_addr_gen+0x3a4/0x3e0 net/ipv6/addrconf.c:3313 addrconf_dev_config+0x253/0x420 net/ipv6/addrconf.c:3360 addrconf_notify+0x366/0x2400 net/ipv6/addrconf.c:3593 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2123 netdev_state_change net/core/dev.c:1514 [inline] netdev_state_change+0x100/0x130 net/core/dev.c:1507 linkwatch_do_dev+0x151/0x1b0 net/core/link_watch.c:167 __linkwatch_run_queue+0x1ea/0x630 net/core/link_watch.c:212 linkwatch_event+0x4a/0x60 net/core/link_watch.c:251 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 25347: 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] addr_event.part.0+0x31c/0x4d0 drivers/infiniband/core/roce_gid_mgmt.c:853 addr_event drivers/infiniband/core/roce_gid_mgmt.c:824 [inline] inet6addr_event+0x13e/0x1b0 drivers/infiniband/core/roce_gid_mgmt.c:883 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 atomic_notifier_call_chain+0x70/0x180 kernel/notifier.c:217 ipv6_add_addr+0x1705/0x1f00 net/ipv6/addrconf.c:1152 addrconf_add_linklocal+0x1ca/0x590 net/ipv6/addrconf.c:3182 addrconf_addr_gen+0x3a4/0x3e0 net/ipv6/addrconf.c:3313 addrconf_dev_config+0x253/0x420 net/ipv6/addrconf.c:3360 addrconf_notify+0x366/0x2400 net/ipv6/addrconf.c:3593 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2123 netdev_state_change net/core/dev.c:1514 [inline] netdev_state_change+0x100/0x130 net/core/dev.c:1507 linkwatch_do_dev+0x151/0x1b0 net/core/link_watch.c:167 __linkwatch_run_queue+0x1ea/0x630 net/core/link_watch.c:212 linkwatch_event+0x4a/0x60 net/core/link_watch.c:251 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 kobject_synth_uevent+0x701/0x850 lib/kobject_uevent.c:208 uevent_store+0x20/0x50 drivers/base/core.c:2372 dev_attr_store+0x50/0x80 drivers/base/core.c:2073 sysfs_kf_write+0x110/0x160 fs/sysfs/file.c:139 kernfs_fop_write_iter+0x342/0x500 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2114 [inline] new_sync_write+0x426/0x650 fs/read_write.c:518 vfs_write+0x75a/0xa40 fs/read_write.c:605 ksys_write+0x12d/0x250 fs/read_write.c:658 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 ffff888026314400 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 64 bytes inside of 192-byte region [ffff888026314400, ffff8880263144c0) The buggy address belongs to the page: page:ffffea000098c500 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x26314 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0000a63000 0000000200000002 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 11421431425, free_ts 11416116707 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 device_add+0xbc0/0x2180 drivers/base/core.c:3335 __video_register_device+0x2235/0x4ce0 drivers/media/v4l2-core/v4l2-dev.c:1036 video_register_device include/media/v4l2-dev.h:384 [inline] vivid_create_devnodes drivers/media/test-drivers/vivid/vivid-core.c:1566 [inline] vivid_create_instance drivers/media/test-drivers/vivid/vivid-core.c:1946 [inline] vivid_probe.cold+0x70de/0x86a5 drivers/media/test-drivers/vivid/vivid-core.c:2001 platform_probe+0xfc/0x1f0 drivers/base/platform.c:1427 call_driver_probe drivers/base/dd.c:517 [inline] really_probe+0x23c/0xcd0 drivers/base/dd.c:595 __driver_probe_device+0x338/0x4d0 drivers/base/dd.c:747 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1346 [inline] free_pcp_prepare+0x2c5/0x780 mm/page_alloc.c:1397 free_unref_page_prepare mm/page_alloc.c:3332 [inline] free_unref_page_list+0x1a1/0x1050 mm/page_alloc.c:3448 release_pages+0x824/0x20b0 mm/swap.c:972 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:242 [inline] tlb_flush_mmu mm/mmu_gather.c:249 [inline] tlb_finish_mmu+0x165/0x8c0 mm/mmu_gather.c:340 exit_mmap+0x1ea/0x620 mm/mmap.c:3203 __mmput+0x122/0x470 kernel/fork.c:1101 mmput+0x58/0x60 kernel/fork.c:1122 free_bprm+0x65/0x2e0 fs/exec.c:1479 kernel_execve+0x380/0x460 fs/exec.c:1976 call_usermodehelper_exec_async+0x2e3/0x580 kernel/umh.c:112 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff888026314300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888026314380: 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888026314400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888026314480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888026314500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================