fuse: Bad value for 'fd' ================================================================== 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 ffff0000d3404840 by task syz.8.663/8443 CPU: 0 UID: 0 PID: 8443 Comm: syz.8.663 Tainted: G L syzkaller #0 PREEMPT Tainted: [L]=SOFTLOCKUP Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/23/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:2114 deactivate_locked_super+0xcc/0x128 fs/super.c:586 deactivate_super+0xd4/0xf4 fs/super.c:614 cleanup_mnt+0x190/0x220 fs/namespace.c:1392 __cleanup_mnt+0x20/0x30 fs/namespace.c:1399 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:146 [inline] el0_svc+0x12c/0x1d8 arch/arm64/kernel/entry-common.c:797 el0t_64_sync_handler+0x44/0x104 arch/arm64/kernel/entry-common.c:815 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:606 Allocated by task 8184: 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:409 [inline] __kasan_kmalloc+0x9c/0xb4 mm/kasan/common.c:426 kasan_kmalloc include/linux/kasan.h:263 [inline] __kmalloc_cache_noprof+0x2f4/0x5fc mm/slub.c:5563 _kmalloc_noprof include/linux/slab.h:991 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] dev_new drivers/usb/gadget/legacy/inode.c:176 [inline] gadgetfs_fill_super+0x19c/0x370 drivers/usb/gadget/legacy/inode.c:2064 vfs_get_super+0xb8/0x148 fs/super.c:1390 get_tree_single+0x30/0x40 fs/super.c:1417 gadgetfs_get_tree+0x28/0x38 drivers/usb/gadget/legacy/inode.c:2095 vfs_get_tree+0x90/0x28c fs/super.c:1932 fc_mount+0x24/0xac fs/namespace.c:1278 do_new_mount_fc fs/namespace.c:3885 [inline] do_new_mount+0x2a4/0x538 fs/namespace.c:3961 path_mount+0x5f0/0xa88 fs/namespace.c:4312 do_mount+0xe8/0x148 fs/namespace.c:4325 __do_sys_mount fs/namespace.c:4543 [inline] __se_sys_mount fs/namespace.c:4520 [inline] __arm64_sys_mount+0x33c/0x388 fs/namespace.c:4520 __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+0x60/0x1d8 arch/arm64/kernel/entry-common.c:796 el0t_64_sync_handler+0x44/0x104 arch/arm64/kernel/entry-common.c:815 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:606 Freed by task 8339: 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:264 [inline] __kasan_slab_free+0x74/0xa4 mm/kasan/common.c:296 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2748 [inline] slab_free mm/slub.c:6509 [inline] kfree+0x188/0x658 mm/slub.c:6802 put_dev+0x8c/0xf8 drivers/usb/gadget/legacy/inode.c:169 dev_release+0x100/0x15c drivers/usb/gadget/legacy/inode.c:1224 __fput+0x338/0x74c fs/file_table.c:512 ____fput+0x20/0x30 fs/file_table.c:541 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:146 [inline] el0_svc+0x12c/0x1d8 arch/arm64/kernel/entry-common.c:797 el0t_64_sync_handler+0x44/0x104 arch/arm64/kernel/entry-common.c:815 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:606 The buggy address belongs to the object at ffff0000d3404800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 64 bytes inside of freed 1024-byte region [ffff0000d3404800, ffff0000d3404c00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x113400 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 0000000000100010 00000000f5000000 0000000000000000 head: 05ffc00000000040 ffff0000c0001dc0 dead000000000100 dead000000000122 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 05ffc00000000003 fffffdffc34d0001 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000d3404700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000d3404780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000d3404800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000d3404880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000d3404900: 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.8.663/8443 Modules linked in: CPU: 0 UID: 0 PID: 8443 Comm: syz.8.663 Tainted: G B L syzkaller #0 PREEMPT Tainted: [B]=BAD_PAGE, [L]=SOFTLOCKUP Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/23/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 : ffff8000921a7bc0 x29: ffff8000921a7bc0 x28: 00007dfe9bfd7828 x27: 0000000000000001 x26: ffff8000897fa960 x25: 1fffe0001a1448b3 x24: 0000000000000003 x23: ffff0000d0a24598 x22: ffff80008a46f220 x21: 0000000000000000 x20: ffff0000d3404840 x19: ffff80008ae88000 x18: 00000000ffffffff x17: 3d3d3d3d3d3d3d3d x16: 3d3d3d3d3d3d3d3d x15: 3d3d3d3d3d3d3d3d x14: 0000000000001263 x13: 0000000000000001 x12: 0000000000000003 x11: 0000000000000000 x10: 0000000000080000 x9 : 5a67f049cce26400 x8 : 5a67f049cce26400 x7 : 0000000000000000 x6 : ffff800080484084 x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000802f4d68 x2 : 0000000100000000 x1 : ffff0000c379d880 x0 : 0000000000000001 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:2114 deactivate_locked_super+0xcc/0x128 fs/super.c:586 deactivate_super+0xd4/0xf4 fs/super.c:614 cleanup_mnt+0x190/0x220 fs/namespace.c:1392 __cleanup_mnt+0x20/0x30 fs/namespace.c:1399 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:146 [inline] el0_svc+0x12c/0x1d8 arch/arm64/kernel/entry-common.c:797 el0t_64_sync_handler+0x44/0x104 arch/arm64/kernel/entry-common.c:815 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:606 irq event stamp: 12191 hardirqs last enabled at (12191): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:210 [inline] hardirqs last enabled at (12191): [] _raw_spin_unlock_irqrestore+0x38/0x98 kernel/locking/spinlock.c:221 hardirqs last disabled at (12190): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:153 [inline] hardirqs last disabled at (12190): [] _raw_spin_lock_irqsave+0x2c/0x7c kernel/locking/spinlock.c:181 softirqs last enabled at (12018): [] softirq_handle_end kernel/softirq.c:491 [inline] softirqs last enabled at (12018): [] handle_softirqs+0xb2c/0xcbc kernel/softirq.c:673 softirqs last disabled at (11917): [] __do_softirq+0x14/0x20 kernel/softirq.c:679 ---[ end trace 0000000000000000 ]---