================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline] BUG: KASAN: use-after-free in atomic64_add_return include/asm-generic/atomic-instrumented.h:640 [inline] BUG: KASAN: use-after-free in atomic_long_add_return include/asm-generic/atomic-long.h:59 [inline] BUG: KASAN: use-after-free in dec_rlimit_ucounts+0x74/0x130 kernel/ucount.c:272 Write of size 8 at addr ffff888033f5aa80 by task syz-executor.0/8492 CPU: 1 PID: 8492 Comm: syz-executor.0 Tainted: G W 5.13.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:96 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_add_return include/asm-generic/atomic-instrumented.h:640 [inline] atomic_long_add_return include/asm-generic/atomic-long.h:59 [inline] dec_rlimit_ucounts+0x74/0x130 kernel/ucount.c:272 release_task+0x22b/0x17c0 kernel/exit.c:191 wait_task_zombie kernel/exit.c:1107 [inline] wait_consider_task+0x2fc1/0x3b40 kernel/exit.c:1334 do_wait_thread kernel/exit.c:1397 [inline] do_wait+0x6ca/0xce0 kernel/exit.c:1514 kernel_wait4+0x14c/0x260 kernel/exit.c:1677 __do_sys_wait4+0x13f/0x150 kernel/exit.c:1705 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 RIP: 0033:0x464a77 Code: 89 7c 24 10 48 89 4c 24 18 e8 d5 44 02 00 4c 8b 54 24 18 8b 54 24 14 41 89 c0 48 8b 74 24 08 8b 7c 24 10 b8 3d 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 89 44 24 10 e8 05 45 02 00 8b 44 RSP: 002b:00007ffda8f52bf0 EFLAGS: 00000293 ORIG_RAX: 000000000000003d RAX: ffffffffffffffda RBX: 0000000000006df0 RCX: 0000000000464a77 RDX: 0000000040000001 RSI: 00007ffda8f52c8c RDI: 00000000ffffffff RBP: 00007ffda8f52c8c R08: 0000000000000000 R09: 00007ffda8fdf080 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000001 R13: 00000000002daa87 R14: 0000000000000000 R15: 00007ffda8f52cf0 Allocated by task 18252: 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] kzalloc include/linux/slab.h:721 [inline] alloc_ucounts+0x23d/0x5b0 kernel/ucount.c:169 set_cred_ucounts+0x171/0x3a0 kernel/cred.c:684 copy_creds+0x853/0xb20 kernel/cred.c:375 copy_process+0x1413/0x74c0 kernel/fork.c:1992 kernel_clone+0xe7/0xab0 kernel/fork.c:2509 __do_sys_clone3+0x1ca/0x2e0 kernel/fork.c:2784 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 Freed by task 16810: 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:229 [inline] slab_free_hook mm/slub.c:1639 [inline] slab_free_freelist_hook+0xdf/0x240 mm/slub.c:1664 slab_free mm/slub.c:3224 [inline] kfree+0xeb/0x670 mm/slub.c:4268 put_ucounts kernel/ucount.c:200 [inline] put_ucounts+0x117/0x150 kernel/ucount.c:192 put_cred_rcu+0x27a/0x520 kernel/cred.c:124 rcu_do_batch kernel/rcu/tree.c:2558 [inline] rcu_core+0x7ab/0x1380 kernel/rcu/tree.c:2793 __do_softirq+0x29b/0x9bd kernel/softirq.c:558 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:2370 dev_attr_store+0x50/0x80 drivers/base/core.c:2071 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+0x796/0xa30 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 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 rx_queue_add_kobject net/core/net-sysfs.c:1020 [inline] net_rx_queue_update_kobjects+0xea/0x4e0 net/core/net-sysfs.c:1060 register_queue_kobjects net/core/net-sysfs.c:1711 [inline] netdev_register_kobject+0x275/0x430 net/core/net-sysfs.c:1959 register_netdevice+0xd33/0x1500 net/core/dev.c:10315 register_netdev+0x2d/0x50 net/core/dev.c:10439 sit_init_net+0x3a4/0xa80 net/ipv6/sit.c:1921 ops_init+0xaf/0x470 net/core/net_namespace.c:140 setup_net+0x40f/0xa30 net/core/net_namespace.c:333 copy_net_ns+0x31e/0x760 net/core/net_namespace.c:474 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 copy_namespaces+0x385/0x440 kernel/nsproxy.c:178 copy_process+0x2d4a/0x74c0 kernel/fork.c:2122 kernel_clone+0xe7/0xab0 kernel/fork.c:2509 __do_sys_clone3+0x1ca/0x2e0 kernel/fork.c:2784 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 ffff888033f5aa00 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 128 bytes inside of 192-byte region [ffff888033f5aa00, ffff888033f5aac0) The buggy address belongs to the page: page:ffffea0000cfd680 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x33f5a flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0002603d00 0000000700000007 ffff888011041a00 raw: 0000000000000000 0000000080100010 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 0x12a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY), pid 8496, ts 86307388487, free_ts 86170075356 prep_new_page mm/page_alloc.c:2445 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4178 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5386 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2272 alloc_slab_page mm/slub.c:1702 [inline] allocate_slab+0x32b/0x4c0 mm/slub.c:1842 new_slab mm/slub.c:1905 [inline] new_slab_objects mm/slub.c:2651 [inline] ___slab_alloc+0x4ba/0x820 mm/slub.c:2814 __slab_alloc.constprop.0+0xa7/0xf0 mm/slub.c:2854 slab_alloc_node mm/slub.c:2936 [inline] slab_alloc mm/slub.c:2978 [inline] kmem_cache_alloc_trace+0x325/0x3c0 mm/slub.c:2995 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+0x8d/0x170 kernel/notifier.c:217 ipv6_add_addr+0x1750/0x1ef0 net/ipv6/addrconf.c:1152 inet6_addr_add+0x410/0xae0 net/ipv6/addrconf.c:2945 inet6_rtm_newaddr+0xf00/0x1970 net/ipv6/addrconf.c:4871 rtnetlink_rcv_msg+0x44e/0xb70 net/core/rtnetlink.c:5574 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1355 [inline] free_pcp_prepare+0x2c5/0x780 mm/page_alloc.c:1406 free_unref_page_prepare mm/page_alloc.c:3341 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3420 unfreeze_partials+0x17c/0x1d0 mm/slub.c:2432 put_cpu_partial+0x13d/0x230 mm/slub.c:2468 qlink_free mm/kasan/quarantine.c:146 [inline] qlist_free_all+0x5a/0xc0 mm/kasan/quarantine.c:165 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x8e/0xa0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slab.h:512 [inline] slab_alloc_node mm/slub.c:2970 [inline] slab_alloc mm/slub.c:2978 [inline] kmem_cache_alloc_trace+0x283/0x3c0 mm/slub.c:2995 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] nsim_fib4_rt_create drivers/net/netdevsim/fib.c:277 [inline] nsim_fib4_rt_insert drivers/net/netdevsim/fib.c:423 [inline] nsim_fib4_event drivers/net/netdevsim/fib.c:461 [inline] nsim_fib_event drivers/net/netdevsim/fib.c:881 [inline] nsim_fib_event_work+0x70c/0x2490 drivers/net/netdevsim/fib.c:1477 process_one_work+0x98d/0x1630 kernel/workqueue.c:2276 process_scheduled_works kernel/workqueue.c:2338 [inline] worker_thread+0x85c/0x11f0 kernel/workqueue.c:2424 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff888033f5a980: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc ffff888033f5aa00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888033f5aa80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff888033f5ab00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888033f5ab80: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================