================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline] BUG: KASAN: use-after-free in atomic_add_unless include/linux/atomic/atomic-instrumented.h:607 [inline] BUG: KASAN: use-after-free in _atomic_dec_and_lock_irqsave+0x27/0x150 lib/dec_and_lock.c:41 Write of size 4 at addr ffff88801a88331c by task syz-executor.2/14951 CPU: 1 PID: 14951 Comm: syz-executor.2 Not tainted 5.16.0-rc8-next-20220110-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xa5/0x3e0 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 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] atomic_add_unless include/linux/atomic/atomic-instrumented.h:607 [inline] _atomic_dec_and_lock_irqsave+0x27/0x150 lib/dec_and_lock.c:41 put_ucounts+0x73/0x1c0 kernel/ucount.c:206 put_cred_rcu+0x27a/0x520 kernel/cred.c:124 rcu_do_batch kernel/rcu/tree.c:2536 [inline] rcu_core+0x7b8/0x1540 kernel/rcu/tree.c:2787 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 do_softirq.part.0+0xde/0x130 kernel/softirq.c:459 do_softirq kernel/softirq.c:451 [inline] __local_bh_enable_ip+0x102/0x120 kernel/softirq.c:383 local_bh_enable include/linux/bottom_half.h:33 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:764 [inline] ip_finish_output2+0x7d0/0x2170 net/ipv4/ip_output.c:222 __ip_finish_output net/ipv4/ip_output.c:299 [inline] __ip_finish_output+0x396/0x640 net/ipv4/ip_output.c:281 ip_finish_output+0x32/0x200 net/ipv4/ip_output.c:309 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip_output+0x196/0x310 net/ipv4/ip_output.c:423 dst_output include/net/dst.h:451 [inline] ip_local_out net/ipv4/ip_output.c:126 [inline] ip_send_skb+0xd4/0x260 net/ipv4/ip_output.c:1554 udp_send_skb+0x6d2/0x11a0 net/ipv4/udp.c:967 udp_sendmsg+0x1bad/0x2730 net/ipv4/udp.c:1254 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:819 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 ____sys_sendmsg+0x331/0x810 net/socket.c:2413 ___sys_sendmsg+0xf3/0x170 net/socket.c:2467 __sys_sendmmsg+0x195/0x470 net/socket.c:2553 __do_sys_sendmmsg net/socket.c:2582 [inline] __se_sys_sendmmsg net/socket.c:2579 [inline] __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2579 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:0x7f8f1428be99 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:00007f8f12c01168 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007f8f1439ef60 RCX: 00007f8f1428be99 RDX: 0400000000000075 RSI: 0000000020007fc0 RDI: 0000000000000004 RBP: 00007f8f142e5ff1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffff6e7fccf R14: 00007f8f12c01300 R15: 0000000000022000 Allocated by task 14958: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:524 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:715 [inline] alloc_ucounts+0x1c3/0x590 kernel/ucount.c:175 set_cred_ucounts+0x163/0x320 kernel/cred.c:682 copy_creds+0x708/0xb50 kernel/cred.c:373 copy_process+0x1440/0x7300 kernel/fork.c:2034 kernel_clone+0xe7/0xab0 kernel/fork.c:2557 __do_sys_clone+0xc8/0x110 kernel/fork.c:2674 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 10609: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0x166/0x1a0 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:236 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754 slab_free mm/slub.c:3509 [inline] kfree+0xce/0x380 mm/slub.c:4562 put_ucounts+0x153/0x1c0 kernel/ucount.c:209 do_dec_rlimit_put_ucounts+0xfb/0x1a0 kernel/ucount.c:299 __sigqueue_free kernel/signal.c:455 [inline] __sigqueue_free kernel/signal.c:450 [inline] flush_sigqueue+0x18e/0x280 kernel/signal.c:469 __exit_signal kernel/exit.c:155 [inline] release_task+0xbd0/0x17e0 kernel/exit.c:200 wait_task_zombie kernel/exit.c:1116 [inline] wait_consider_task+0x2fa6/0x3b80 kernel/exit.c:1343 do_wait_thread kernel/exit.c:1406 [inline] do_wait+0x6ca/0xce0 kernel/exit.c:1523 kernel_wait4+0x14c/0x260 kernel/exit.c:1686 __do_sys_wait4+0x13f/0x150 kernel/exit.c:1714 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 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 call_rcu+0x99/0x730 kernel/rcu/tree.c:3072 neigh_parms_release net/core/neighbour.c:1706 [inline] neigh_parms_release+0x205/0x290 net/core/neighbour.c:1697 addrconf_ifdown.isra.0+0x1003/0x1630 net/ipv6/addrconf.c:3871 addrconf_notify+0xeb/0x1ba0 net/ipv6/addrconf.c:3651 notifier_call_chain+0xb5/0x200 kernel/notifier.c:84 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1919 call_netdevice_notifiers_extack net/core/dev.c:1931 [inline] call_netdevice_notifiers net/core/dev.c:1945 [inline] unregister_netdevice_many+0x964/0x1850 net/core/dev.c:10408 default_device_exit_batch+0x2fa/0x3c0 net/core/dev.c:10938 ops_exit_list+0x10d/0x160 net/core/net_namespace.c:171 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:595 process_one_work+0x9ac/0x1650 kernel/workqueue.c:2307 worker_thread+0x657/0x1110 kernel/workqueue.c:2454 kthread+0x2e9/0x3a0 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 insert_work+0x48/0x370 kernel/workqueue.c:1368 __queue_work+0x5ca/0xf30 kernel/workqueue.c:1534 queue_work_on+0xee/0x110 kernel/workqueue.c:1562 queue_work include/linux/workqueue.h:502 [inline] call_usermodehelper_exec+0x347/0x4c0 kernel/umh.c:435 call_modprobe kernel/kmod.c:98 [inline] __request_module+0x430/0xa60 kernel/kmod.c:170 dev_load+0x1c8/0x200 net/core/dev_ioctl.c:449 dev_ioctl+0x2a8/0xed0 net/core/dev_ioctl.c:512 sock_do_ioctl+0x15a/0x230 net/socket.c:1136 sock_ioctl+0x2f1/0x640 net/socket.c:1239 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl fs/ioctl.c:860 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860 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 ffff88801a883300 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 28 bytes inside of 192-byte region [ffff88801a883300, ffff88801a8833c0) The buggy address belongs to the page: page:ffffea00006a20c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1a883 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea00007a12c0 dead000000000003 ffff888010c41a00 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 0x12c00(GFP_NOIO|__GFP_NOWARN|__GFP_NORETRY), pid 10, ts 8225558335, free_ts 0 prep_new_page mm/page_alloc.c:2434 [inline] get_page_from_freelist+0xa72/0x2f40 mm/page_alloc.c:4165 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5381 __alloc_pages_node include/linux/gfp.h:568 [inline] alloc_slab_page mm/slub.c:1801 [inline] allocate_slab mm/slub.c:1944 [inline] new_slab+0xaf/0x380 mm/slub.c:2004 ___slab_alloc+0x6be/0xd60 mm/slub.c:3018 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3105 slab_alloc_node mm/slub.c:3196 [inline] kmem_cache_alloc_node_trace+0x116/0x300 mm/slub.c:3280 kmalloc_node include/linux/slab.h:599 [inline] kzalloc_node include/linux/slab.h:726 [inline] blk_alloc_flush_queue+0x91/0x320 block/blk-flush.c:476 blk_mq_alloc_hctx block/blk-mq.c:3539 [inline] blk_mq_alloc_and_init_hctx block/blk-mq.c:3934 [inline] blk_mq_realloc_hw_ctxs+0xd4e/0x1460 block/blk-mq.c:3986 blk_mq_init_allocated_queue+0x3ca/0x1370 block/blk-mq.c:4048 blk_mq_init_queue_data block/blk-mq.c:3882 [inline] __blk_mq_alloc_disk+0xcb/0x1c0 block/blk-mq.c:3902 floppy_alloc_disk+0x3d/0x390 drivers/block/floppy.c:4499 do_floppy_init drivers/block/floppy.c:4580 [inline] floppy_async_init+0x2ec/0x2055 drivers/block/floppy.c:4750 async_run_entry_fn+0x9d/0x550 kernel/async.c:127 process_one_work+0x9ac/0x1650 kernel/workqueue.c:2307 worker_thread+0x657/0x1110 kernel/workqueue.c:2454 kthread+0x2e9/0x3a0 kernel/kthread.c:377 page_owner free stack trace missing Memory state around the buggy address: ffff88801a883200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88801a883280: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801a883300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801a883380: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88801a883400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================