================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:112 [inline] BUG: KASAN: slab-use-after-free in atomic_fetch_sub_release include/linux/atomic/atomic-instrumented.h:400 [inline] BUG: KASAN: slab-use-after-free in __refcount_sub_and_test include/linux/refcount.h:389 [inline] BUG: KASAN: slab-use-after-free in __refcount_dec_and_test include/linux/refcount.h:432 [inline] BUG: KASAN: slab-use-after-free in refcount_dec_and_test include/linux/refcount.h:450 [inline] BUG: KASAN: slab-use-after-free in put_dev+0x2c/0xf8 drivers/usb/gadget/legacy/inode.c:165 Write of size 4 at addr ffff0000d9409840 by task syz.0.732/7516 CPU: 1 UID: 0 PID: 7516 Comm: syz.0.732 Not tainted syzkaller #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/07/2026 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:499 (C) __dump_stack+0x30/0x40 lib/dump_stack.c:94 dump_stack_lvl+0xd8/0x12c lib/dump_stack.c:120 print_address_description+0xb0/0x238 mm/kasan/report.c:378 print_report+0x68/0x84 mm/kasan/report.c:482 kasan_report+0x8c/0xc4 mm/kasan/report.c:595 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x17c/0x1ac mm/kasan/generic.c:200 __kasan_check_write+0x20/0x30 mm/kasan/shadow.c:37 instrument_atomic_read_write include/linux/instrumented.h:112 [inline] atomic_fetch_sub_release include/linux/atomic/atomic-instrumented.h:400 [inline] __refcount_sub_and_test include/linux/refcount.h:389 [inline] __refcount_dec_and_test include/linux/refcount.h:432 [inline] refcount_dec_and_test include/linux/refcount.h:450 [inline] put_dev+0x2c/0xf8 drivers/usb/gadget/legacy/inode.c:165 gadgetfs_kill_sb+0x48/0x80 drivers/usb/gadget/legacy/inode.c:2104 deactivate_locked_super+0xcc/0x148 fs/super.c:477 deactivate_super+0xd8/0xf8 fs/super.c:510 cleanup_mnt+0x318/0x3a8 fs/namespace.c:1317 __cleanup_mnt+0x20/0x30 fs/namespace.c:1324 task_work_run+0x1cc/0x25c kernel/task_work.c:233 exit_task_work include/linux/task_work.h:40 [inline] do_exit+0x58c/0x1a74 kernel/exit.c:1009 do_group_exit+0x198/0x238 kernel/exit.c:1152 get_signal+0xfb0/0x1094 kernel/signal.c:3046 arch_do_signal_or_restart+0x288/0x444c arch/arm64/kernel/signal.c:1665 __exit_to_user_mode_loop kernel/entry/common.c:66 [inline] exit_to_user_mode_loop+0x70/0x17c kernel/entry/common.c:101 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline] arm64_syscall_exit_to_user_mode arch/arm64/kernel/entry-common.c:108 [inline] el0_svc+0x18c/0x260 arch/arm64/kernel/entry-common.c:759 el0t_64_sync_handler+0x44/0x104 arch/arm64/kernel/entry-common.c:777 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:590 Allocated by task 4710: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:78 kasan_save_alloc_info+0x40/0x50 mm/kasan/generic.c:570 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0x9c/0xb4 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __kmalloc_cache_noprof+0x2e8/0x5ec mm/slub.c:5489 _kmalloc_noprof include/linux/slab.h:988 [inline] _kzalloc_noprof include/linux/slab.h:1309 [inline] dev_new drivers/usb/gadget/legacy/inode.c:176 [inline] gadgetfs_fill_super+0x19c/0x370 drivers/usb/gadget/legacy/inode.c:2054 vfs_get_super+0xb8/0x148 fs/super.c:1273 get_tree_single+0x30/0x40 fs/super.c:1300 gadgetfs_get_tree+0x28/0x38 drivers/usb/gadget/legacy/inode.c:2085 vfs_get_tree+0x90/0x28c fs/super.c:1700 fc_mount+0x24/0xac fs/namespace.c:1198 do_new_mount_fc fs/namespace.c:3765 [inline] do_new_mount+0x2a4/0x538 fs/namespace.c:3841 path_mount+0x5f0/0xa88 fs/namespace.c:4161 do_mount+0xe8/0x148 fs/namespace.c:4174 __do_sys_mount fs/namespace.c:4390 [inline] __se_sys_mount fs/namespace.c:4367 [inline] __arm64_sys_mount+0x33c/0x388 fs/namespace.c:4367 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x244 arch/arm64/kernel/syscall.c:49 el0_svc_common+0xec/0x23c arch/arm64/kernel/syscall.c:121 do_el0_svc+0x4c/0x5c arch/arm64/kernel/syscall.c:140 el0_svc+0x64/0x260 arch/arm64/kernel/entry-common.c:758 el0t_64_sync_handler+0x44/0x104 arch/arm64/kernel/entry-common.c:777 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:590 Freed by task 7737: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:78 kasan_save_free_info+0x54/0x6c mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x74/0xa4 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2677 [inline] slab_free mm/slub.c:6377 [inline] kfree+0x188/0x690 mm/slub.c:6692 put_dev+0x8c/0xf8 drivers/usb/gadget/legacy/inode.c:169 dev_release+0x100/0x15c drivers/usb/gadget/legacy/inode.c:1215 __fput+0x338/0x74c fs/file_table.c:512 ____fput+0x20/0x30 fs/file_table.c:540 task_work_run+0x1cc/0x25c kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:70 [inline] exit_to_user_mode_loop+0x10c/0x17c kernel/entry/common.c:101 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline] arm64_syscall_exit_to_user_mode arch/arm64/kernel/entry-common.c:108 [inline] el0_svc+0x18c/0x260 arch/arm64/kernel/entry-common.c:759 el0t_64_sync_handler+0x44/0x104 arch/arm64/kernel/entry-common.c:777 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:590 The buggy address belongs to the object at ffff0000d9409800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 64 bytes inside of freed 1024-byte region [ffff0000d9409800, ffff0000d9409c00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x119408 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x5ffc00000000040(head|node=0|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 05ffc00000000040 ffff0000c0001dc0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000 head: 05ffc00000000040 ffff0000c0001dc0 dead000000000100 dead000000000122 head: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000 head: 05ffc00000000003 fffffdffc3650201 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000d9409700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000d9409780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000d9409800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000d9409880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000d9409900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ------------[ cut here ]------------ refcount_t: underflow; use-after-free. WARNING: lib/refcount.c:28 at refcount_warn_saturate+0x154/0x1f8 lib/refcount.c:28, CPU#0: syz.0.732/7516 Modules linked in: CPU: 0 UID: 0 PID: 7516 Comm: syz.0.732 Tainted: G B syzkaller #0 PREEMPT Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/07/2026 pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--) pc : refcount_warn_saturate+0x154/0x1f8 lib/refcount.c:28 lr : refcount_warn_saturate+0x154/0x1f8 lib/refcount.c:28 sp : ffff800095ff76c0 x29: ffff800095ff76c0 x28: 00007dfea236c130 x27: 0000000000000001 x26: ffff800088b3b6a0 x25: 1fffe0001b280ee3 x24: 0000000000000003 x23: ffff0000d9407718 x22: dfff800000000000 x21: 0000000000000000 x20: ffff0000d9409840 x19: ffff80008a19d000 x18: 1fffe00034bb7428 x17: 0000000000000003 x16: ffff800088b37000 x15: ffff800088bed220 x14: ffff0001a5dba14c x13: 0000000000000001 x12: 0000000000000000 x11: 0000000000000000 x10: 0000000000000002 x9 : de3960fef51c7800 x8 : de3960fef51c7800 x7 : 0000000000000000 x6 : ffff80008048c60c x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000802f6830 x2 : 0000000100000000 x1 : ffff0000ddf63a80 x0 : 0000000000000000 Call trace: refcount_warn_saturate+0x154/0x1f8 lib/refcount.c:28 (P) __refcount_sub_and_test include/linux/refcount.h:400 [inline] __refcount_dec_and_test include/linux/refcount.h:432 [inline] refcount_dec_and_test include/linux/refcount.h:450 [inline] put_dev+0xcc/0xf8 drivers/usb/gadget/legacy/inode.c:165 gadgetfs_kill_sb+0x48/0x80 drivers/usb/gadget/legacy/inode.c:2104 deactivate_locked_super+0xcc/0x148 fs/super.c:477 deactivate_super+0xd8/0xf8 fs/super.c:510 cleanup_mnt+0x318/0x3a8 fs/namespace.c:1317 __cleanup_mnt+0x20/0x30 fs/namespace.c:1324 task_work_run+0x1cc/0x25c kernel/task_work.c:233 exit_task_work include/linux/task_work.h:40 [inline] do_exit+0x58c/0x1a74 kernel/exit.c:1009 do_group_exit+0x198/0x238 kernel/exit.c:1152 get_signal+0xfb0/0x1094 kernel/signal.c:3046 arch_do_signal_or_restart+0x288/0x444c arch/arm64/kernel/signal.c:1665 __exit_to_user_mode_loop kernel/entry/common.c:66 [inline] exit_to_user_mode_loop+0x70/0x17c kernel/entry/common.c:101 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline] arm64_syscall_exit_to_user_mode arch/arm64/kernel/entry-common.c:108 [inline] el0_svc+0x18c/0x260 arch/arm64/kernel/entry-common.c:759 el0t_64_sync_handler+0x44/0x104 arch/arm64/kernel/entry-common.c:777 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:590 irq event stamp: 1659 hardirqs last enabled at (1659): [] raw_spin_rq_unlock_irq kernel/sched/sched.h:1673 [inline] hardirqs last enabled at (1659): [] finish_lock_switch kernel/sched/core.c:5241 [inline] hardirqs last enabled at (1659): [] finish_task_switch+0x234/0x858 kernel/sched/core.c:5359 hardirqs last disabled at (1658): [] __schedule+0x2f8/0x2d80 kernel/sched/core.c:7087 softirqs last enabled at (1482): [] softirq_handle_end kernel/softirq.c:468 [inline] softirqs last enabled at (1482): [] handle_softirqs+0xc28/0xd98 kernel/softirq.c:650 softirqs last disabled at (1447): [] __do_softirq+0x14/0x20 kernel/softirq.c:656 ---[ end trace 0000000000000000 ]---