loop5: detected capacity change from 0 to 270 ================================================================== BUG: KASAN: use-after-free in d_inode include/linux/dcache.h:516 [inline] BUG: KASAN: use-after-free in relay_switch_subbuf+0x837/0x900 kernel/relay.c:676 Read of size 8 at addr ffff8880548894f8 by task syz-executor.5/21727 CPU: 0 PID: 21727 Comm: syz-executor.5 Not tainted 5.18.0-rc7-syzkaller-00048-gf993aed406ea #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+0xeb/0x495 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 d_inode include/linux/dcache.h:516 [inline] relay_switch_subbuf+0x837/0x900 kernel/relay.c:676 relay_reserve include/linux/relay.h:248 [inline] trace_note+0x5af/0x720 kernel/trace/blktrace.c:95 trace_note_tsk kernel/trace/blktrace.c:126 [inline] __blk_add_trace+0xbfb/0xdf0 kernel/trace/blktrace.c:267 blk_add_trace_bio+0x408/0x550 kernel/trace/blktrace.c:906 trace_block_bio_queue include/trace/events/block.h:355 [inline] submit_bio_noacct+0x13af/0x1ad0 block/blk-core.c:857 submit_bio block/blk-core.c:923 [inline] submit_bio+0x1a0/0x350 block/blk-core.c:887 submit_bh_wbc+0x4bc/0x670 fs/buffer.c:3045 submit_bh fs/buffer.c:3051 [inline] __sync_dirty_buffer+0x168/0x3f0 fs/buffer.c:3146 fat_set_state+0x22b/0x310 fs/fat/inode.c:710 fat_fill_super+0x239a/0x36e0 fs/fat/inode.c:1883 mount_bdev+0x34d/0x410 fs/super.c:1367 legacy_get_tree+0x105/0x220 fs/fs_context.c:610 vfs_get_tree+0x89/0x2f0 fs/super.c:1497 do_new_mount fs/namespace.c:3040 [inline] path_mount+0x1320/0x1fa0 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3568 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:0x7fc54d68a61a Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 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:00007fc54e7d5f88 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00000000200007c0 RCX: 00007fc54d68a61a RDX: 00000000200000c0 RSI: 0000000020000a80 RDI: 00007fc54e7d5fe0 RBP: 00007fc54e7d6020 R08: 00007fc54e7d6020 R09: 00000000200000c0 R10: 0000000000000000 R11: 0000000000000206 R12: 00000000200000c0 R13: 0000000020000a80 R14: 00007fc54e7d5fe0 R15: 0000000020000ac0 Allocated by task 16228: 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_slab_alloc+0x90/0xc0 mm/kasan/common.c:469 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:749 [inline] slab_alloc_node mm/slub.c:3217 [inline] slab_alloc mm/slub.c:3225 [inline] __kmem_cache_alloc_lru mm/slub.c:3232 [inline] kmem_cache_alloc_lru+0x31a/0x720 mm/slub.c:3249 __d_alloc+0x32/0x960 fs/dcache.c:1769 d_alloc+0x4a/0x230 fs/dcache.c:1849 d_alloc_parallel+0xe7/0x1af0 fs/dcache.c:2601 __lookup_slow+0x193/0x480 fs/namei.c:1692 lookup_one_len+0x16a/0x1a0 fs/namei.c:2736 start_creating.part.0+0x13a/0x290 fs/debugfs/inode.c:352 start_creating fs/debugfs/inode.c:325 [inline] __debugfs_create_file+0xa9/0x540 fs/debugfs/inode.c:397 relay_create_buf_file+0xf0/0x170 kernel/relay.c:363 relay_open_buf.part.0+0x7bb/0xc00 kernel/relay.c:392 relay_open_buf kernel/relay.c:384 [inline] relay_open kernel/relay.c:520 [inline] relay_open+0x4fb/0xa00 kernel/relay.c:477 do_blk_trace_setup+0x4bc/0xb60 kernel/trace/blktrace.c:559 __blk_trace_setup+0xca/0x180 kernel/trace/blktrace.c:599 blk_trace_ioctl+0x13b/0x270 kernel/trace/blktrace.c:740 blkdev_ioctl+0x181/0x800 block/ioctl.c:577 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856 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/0x790 kernel/rcu/tree.c:3074 dentry_free+0xc3/0x160 fs/dcache.c:377 __dentry_kill+0x4cb/0x640 fs/dcache.c:621 dentry_kill fs/dcache.c:745 [inline] dput+0x64d/0xdb0 fs/dcache.c:913 find_next_child fs/libfs.c:264 [inline] simple_recursive_removal+0x136/0x830 fs/libfs.c:279 debugfs_remove fs/debugfs/inode.c:742 [inline] debugfs_remove+0x59/0x80 fs/debugfs/inode.c:736 blk_release_queue+0x1a7/0x320 block/blk-sysfs.c:784 kobject_cleanup lib/kobject.c:673 [inline] kobject_release lib/kobject.c:704 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1c8/0x540 lib/kobject.c:721 blkg_free_workfn+0x128/0x210 block/blk-cgroup.c:79 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 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 call_rcu+0x99/0x790 kernel/rcu/tree.c:3074 dentry_free+0xc3/0x160 fs/dcache.c:377 __dentry_kill+0x4cb/0x640 fs/dcache.c:621 dentry_kill fs/dcache.c:745 [inline] dput+0x64d/0xdb0 fs/dcache.c:913 proc_invalidate_siblings_dcache+0x3df/0x610 fs/proc/inode.c:151 release_task+0xcb8/0x17e0 kernel/exit.c:226 wait_task_zombie kernel/exit.c:1111 [inline] wait_consider_task+0x3023/0x3c50 kernel/exit.c:1338 do_wait_thread kernel/exit.c:1401 [inline] do_wait+0x6ca/0xce0 kernel/exit.c:1518 kernel_wait4+0x14c/0x260 kernel/exit.c:1681 __do_sys_wait4+0x13f/0x150 kernel/exit.c:1709 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 ffff888054889490 which belongs to the cache dentry of size 312 The buggy address is located 104 bytes inside of 312-byte region [ffff888054889490, ffff8880548895c8) The buggy address belongs to the physical page: page:ffffea0001522200 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888054889608 pfn:0x54888 head:ffffea0001522200 order:1 compound_mapcount:0 compound_pincount:0 memcg:ffff88807d05b701 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0001d6ac08 ffffea0001dd4288 ffff888010dcd640 raw: ffff888054889608 0000000000150011 00000001ffffffff ffff88807d05b701 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Reclaimable, gfp_mask 0x1d20d0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 12187, tgid 12186 (syz-executor.5), ts 453703433144, free_ts 450741754905 prep_new_page mm/page_alloc.c:2441 [inline] get_page_from_freelist+0xba2/0x3e00 mm/page_alloc.c:4182 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5408 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2272 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab+0x26c/0x3c0 mm/slub.c:1944 new_slab mm/slub.c:2004 [inline] ___slab_alloc+0x8df/0xf20 mm/slub.c:3005 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3092 slab_alloc_node mm/slub.c:3183 [inline] slab_alloc mm/slub.c:3225 [inline] __kmem_cache_alloc_lru mm/slub.c:3232 [inline] kmem_cache_alloc_lru+0x504/0x720 mm/slub.c:3249 __d_alloc+0x32/0x960 fs/dcache.c:1769 d_alloc_pseudo+0x19/0x70 fs/dcache.c:1899 alloc_file_pseudo+0xc6/0x250 fs/file_table.c:262 sock_alloc_file+0x4f/0x190 net/socket.c:463 do_accept+0x28b/0x510 net/socket.c:1769 io_accept fs/io_uring.c:5625 [inline] io_issue_sqe+0x20fc/0x8a00 fs/io_uring.c:7184 __io_queue_sqe fs/io_uring.c:7515 [inline] io_queue_sqe fs/io_uring.c:7557 [inline] io_submit_sqe fs/io_uring.c:7762 [inline] io_submit_sqes+0x22be/0x98b0 fs/io_uring.c:7868 __do_sys_io_uring_enter+0x119b/0x21d0 fs/io_uring.c:10813 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1356 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1406 free_unref_page_prepare mm/page_alloc.c:3328 [inline] free_unref_page+0x19/0x6a0 mm/page_alloc.c:3423 qlink_free mm/kasan/quarantine.c:157 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0xa2/0xc0 mm/kasan/common.c:446 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:749 [inline] slab_alloc_node mm/slub.c:3217 [inline] slab_alloc mm/slub.c:3225 [inline] kmem_cache_alloc_trace+0x26d/0x3f0 mm/slub.c:3256 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:714 [inline] kernfs_fop_open+0x317/0xe00 fs/kernfs/file.c:623 do_dentry_open+0x4a1/0x11e0 fs/open.c:824 do_open fs/namei.c:3476 [inline] path_openat+0x1c71/0x2910 fs/namei.c:3609 do_filp_open+0x1aa/0x400 fs/namei.c:3636 do_sys_openat2+0x16d/0x4c0 fs/open.c:1213 do_sys_open fs/open.c:1229 [inline] __do_sys_openat fs/open.c:1245 [inline] __se_sys_openat fs/open.c:1240 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1240 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 Memory state around the buggy address: ffff888054889380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888054889400: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc >ffff888054889480: fc fc fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888054889500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888054889580: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc ==================================================================