================================================================== BUG: KASAN: use-after-free in fuse_copy_one+0x1e7/0x3f0 fs/fuse/dev.c:1017 Read of size 256 at addr ffff88811f8ca010 by task syz-executor302/4941 CPU: 0 PID: 4941 Comm: syz-executor302 Not tainted 5.15.74-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description+0x87/0x3d0 mm/kasan/report.c:256 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x1a6/0x1f0 mm/kasan/report.c:452 kasan_check_range+0x2aa/0x2e0 mm/kasan/generic.c:189 memcpy+0x2d/0x70 mm/kasan/shadow.c:65 fuse_copy_one+0x1e7/0x3f0 fs/fuse/dev.c:1017 fuse_copy_args+0x309/0x400 fs/fuse/dev.c:1035 fuse_dev_do_read+0xc9b/0x1190 fs/fuse/dev.c:1310 fuse_dev_read+0x180/0x210 fs/fuse/dev.c:1377 call_read_iter include/linux/fs.h:2123 [inline] new_sync_read fs/read_write.c:404 [inline] vfs_read+0xabc/0xd80 fs/read_write.c:485 ksys_read+0x198/0x2c0 fs/read_write.c:623 __do_sys_read fs/read_write.c:633 [inline] __se_sys_read fs/read_write.c:631 [inline] __x64_sys_read+0x7b/0x90 fs/read_write.c:631 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f589d294bc9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 41 15 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f589d1e22f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 00007f589d3264f0 RCX: 00007f589d294bc9 RDX: 0000000000002020 RSI: 0000000020002140 RDI: 0000000000000003 RBP: 00007f589d2f3284 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f589d2ed160 R13: 00007f589d2ef278 R14: 00007f589d2f1280 R15: 00007f589d3264f8 Allocated by task 4923: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:433 [inline] ____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:512 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:521 kasan_kmalloc include/linux/kasan.h:254 [inline] __kmalloc+0x203/0x350 mm/slub.c:4423 kmalloc include/linux/slab.h:596 [inline] __d_alloc+0xab/0x6b0 fs/dcache.c:1760 d_alloc fs/dcache.c:1823 [inline] d_alloc_parallel+0xe0/0x12b0 fs/dcache.c:2575 __lookup_slow+0x14e/0x400 fs/namei.c:1644 lookup_slow+0x5a/0x80 fs/namei.c:1676 walk_component+0x425/0x5a0 fs/namei.c:1972 lookup_last fs/namei.c:2427 [inline] path_lookupat+0x18d/0x460 fs/namei.c:2451 filename_lookup+0x277/0x640 fs/namei.c:2480 user_path_at_empty+0x44/0x1b0 fs/namei.c:2853 user_path_at include/linux/namei.h:57 [inline] do_mount fs/namespace.c:3334 [inline] __do_sys_mount fs/namespace.c:3545 [inline] __se_sys_mount+0x293/0x3c0 fs/namespace.c:3522 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3522 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 20: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x126/0x160 mm/kasan/common.c:365 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373 kasan_slab_free include/linux/kasan.h:220 [inline] slab_free_hook mm/slub.c:1721 [inline] slab_free_freelist_hook+0xc9/0x1a0 mm/slub.c:1747 slab_free mm/slub.c:3515 [inline] kmem_cache_free_bulk+0x3dc/0x720 mm/slub.c:3656 kfree_bulk include/linux/slab.h:448 [inline] kfree_rcu_work+0x2cb/0x6c0 kernel/rcu/tree.c:3281 process_one_work+0x6db/0xc00 kernel/workqueue.c:2313 worker_thread+0xb3e/0x1340 kernel/workqueue.c:2460 kthread+0x41c/0x500 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 kvfree_call_rcu+0xb2/0x7f0 kernel/rcu/tree.c:3558 copy_name fs/dcache.c:2844 [inline] __d_move+0xb3e/0x16d0 fs/dcache.c:2907 __d_unalias+0x1cc/0x220 fs/dcache.c:3021 d_splice_alias+0x22f/0x3b0 fs/dcache.c:3084 fuse_lookup+0x2b4/0x5f0 fs/fuse/dir.c:478 __lookup_slow+0x2b3/0x400 fs/namei.c:1659 lookup_slow+0x5a/0x80 fs/namei.c:1676 walk_component+0x425/0x5a0 fs/namei.c:1972 link_path_walk+0x682/0xde0 path_parentat fs/namei.c:2498 [inline] filename_parentat+0x27e/0x6b0 fs/namei.c:2521 filename_create+0xef/0x4f0 fs/namei.c:3689 do_mkdirat+0xc2/0x420 fs/namei.c:3952 __do_sys_mkdir fs/namei.c:3983 [inline] __se_sys_mkdir fs/namei.c:3981 [inline] __x64_sys_mkdir+0x6e/0x80 fs/namei.c:3981 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 kvfree_call_rcu+0xb2/0x7f0 kernel/rcu/tree.c:3558 copy_name fs/dcache.c:2844 [inline] __d_move+0xb3e/0x16d0 fs/dcache.c:2907 __d_unalias+0x1cc/0x220 fs/dcache.c:3021 d_splice_alias+0x22f/0x3b0 fs/dcache.c:3084 fuse_lookup+0x2b4/0x5f0 fs/fuse/dir.c:478 __lookup_slow+0x2b3/0x400 fs/namei.c:1659 lookup_slow+0x5a/0x80 fs/namei.c:1676 walk_component+0x425/0x5a0 fs/namei.c:1972 link_path_walk+0x682/0xde0 path_parentat fs/namei.c:2498 [inline] filename_parentat+0x27e/0x6b0 fs/namei.c:2521 filename_create+0xef/0x4f0 fs/namei.c:3689 do_mkdirat+0xc2/0x420 fs/namei.c:3952 __do_sys_mkdir fs/namei.c:3983 [inline] __se_sys_mkdir fs/namei.c:3981 [inline] __x64_sys_mkdir+0x6e/0x80 fs/namei.c:3981 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff88811f8ca000 which belongs to the cache kmalloc-rcl-512 of size 512 The buggy address is located 16 bytes inside of 512-byte region [ffff88811f8ca000, ffff88811f8ca200) The buggy address belongs to the page: page:ffffea00047e3200 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88811f8c9000 pfn:0x11f8c8 head:ffffea00047e3200 order:2 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head|zone=1) raw: 4000000000010200 ffffea00047e8700 0000000400000004 ffff88810004c300 raw: ffff88811f8c9000 000000008010000b 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Reclaimable, gfp_mask 0xd20d0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_RECLAIMABLE), pid 1972, ts 1087064259248, free_ts 0 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1ab/0x1b0 mm/page_alloc.c:2495 prep_new_page mm/page_alloc.c:2501 [inline] get_page_from_freelist+0x38b/0x400 mm/page_alloc.c:4281 __alloc_pages+0x3a8/0x7c0 mm/page_alloc.c:5548 allocate_slab+0x62/0x580 mm/slub.c:1928 new_slab mm/slub.c:1991 [inline] ___slab_alloc+0x2e2/0x6f0 mm/slub.c:3024 __slab_alloc+0x4a/0x90 mm/slub.c:3111 slab_alloc_node mm/slub.c:3202 [inline] slab_alloc mm/slub.c:3244 [inline] __kmalloc+0x25b/0x350 mm/slub.c:4419 kmalloc include/linux/slab.h:596 [inline] __d_alloc+0xab/0x6b0 fs/dcache.c:1760 d_alloc fs/dcache.c:1823 [inline] d_alloc_parallel+0xe0/0x12b0 fs/dcache.c:2575 __lookup_slow+0x14e/0x400 fs/namei.c:1644 lookup_slow+0x5a/0x80 fs/namei.c:1676 walk_component+0x425/0x5a0 fs/namei.c:1972 lookup_last fs/namei.c:2427 [inline] path_lookupat+0x18d/0x460 fs/namei.c:2451 filename_lookup+0x277/0x640 fs/namei.c:2480 user_path_at_empty+0x44/0x1b0 fs/namei.c:2853 user_path_at include/linux/namei.h:57 [inline] vfs_statx+0x104/0x6a0 fs/stat.c:221 page_owner free stack trace missing Memory state around the buggy address: ffff88811f8c9f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88811f8c9f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88811f8ca000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88811f8ca080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88811f8ca100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================