loop2: detected capacity change from 0 to 264192 ================================================================== BUG: KASAN: use-after-free in d_inode include/linux/dcache.h:515 [inline] BUG: KASAN: use-after-free in relay_switch_subbuf+0x837/0x900 kernel/relay.c:676 Read of size 8 at addr ffff888075c0bad8 by task syz-executor.2/32514 CPU: 1 PID: 32514 Comm: syz-executor.2 Not tainted 6.0.0-rc3-next-20220901-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x719 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 d_inode include/linux/dcache.h:515 [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+0xbf8/0xde0 kernel/trace/blktrace.c:268 blk_add_trace_bio+0x322/0x4d0 kernel/trace/blktrace.c:905 trace_block_bio_queue include/trace/events/block.h:355 [inline] submit_bio_noacct+0x15d4/0x1d10 block/blk-core.c:790 submit_bio block/blk-core.c:848 [inline] submit_bio+0xd7/0x300 block/blk-core.c:820 submit_bh_wbc+0x4cc/0x650 fs/buffer.c:2715 submit_bh fs/buffer.c:2721 [inline] block_read_full_folio+0x63e/0x980 fs/buffer.c:2336 filemap_read_folio+0x3c/0x1d0 mm/filemap.c:2401 do_read_cache_folio+0x1df/0x510 mm/filemap.c:3526 read_mapping_folio include/linux/pagemap.h:762 [inline] read_part_sector+0xf6/0x440 block/partitions/core.c:714 adfspart_check_ICS+0x9a/0x890 block/partitions/acorn.c:360 check_partition block/partitions/core.c:146 [inline] blk_add_partitions block/partitions/core.c:599 [inline] bdev_disk_changed block/partitions/core.c:685 [inline] bdev_disk_changed+0x629/0xf60 block/partitions/core.c:652 blkdev_get_whole+0x18a/0x2d0 block/bdev.c:684 blkdev_get_by_dev.part.0+0x5ec/0xb90 block/bdev.c:821 blkdev_get_by_dev block/bdev.c:889 [inline] blkdev_get_by_path+0x1b3/0x2e0 block/bdev.c:886 get_tree_bdev+0xd5/0x760 fs/super.c:1271 vfs_get_tree+0x89/0x2f0 fs/super.c:1530 do_new_mount fs/namespace.c:3040 [inline] path_mount+0x1326/0x1e20 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+0x63/0xcd RIP: 0033:0x7fae6c68a8fa 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:00007fae6d7e7f88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000200 RCX: 00007fae6c68a8fa RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007fae6d7e7fe0 RBP: 00007fae6d7e8020 R08: 00007fae6d7e8020 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000020000000 R13: 0000000020000100 R14: 00007fae6d7e7fe0 R15: 0000000020000380 Allocated by task 1340: 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:437 [inline] __kasan_slab_alloc+0x90/0xc0 mm/kasan/common.c:470 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:737 [inline] slab_alloc_node mm/slub.c:3317 [inline] slab_alloc mm/slub.c:3325 [inline] __kmem_cache_alloc_lru mm/slub.c:3332 [inline] kmem_cache_alloc_lru+0x357/0x730 mm/slub.c:3348 __d_alloc+0x32/0x960 fs/dcache.c:1769 d_alloc+0x4a/0x230 fs/dcache.c:1849 d_alloc_parallel+0xe4/0x1400 fs/dcache.c:2647 __lookup_slow+0x193/0x460 fs/namei.c:1670 lookup_one_len+0x16a/0x1a0 fs/namei.c:2711 start_creating.part.0+0x135/0x280 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+0x58a/0xb40 kernel/relay.c:477 do_blk_trace_setup+0x4bc/0xb60 kernel/trace/blktrace.c:560 __blk_trace_setup+0xca/0x180 kernel/trace/blktrace.c:600 blk_trace_ioctl+0x147/0x290 kernel/trace/blktrace.c:741 blkdev_ioctl+0x181/0x800 block/ioctl.c:603 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+0x63/0xcd Freed by task 15: 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:367 [inline] ____kasan_slab_free+0x166/0x1c0 mm/kasan/common.c:329 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1651 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1677 slab_free mm/slub.c:3580 [inline] kmem_cache_free+0xe7/0x5b0 mm/slub.c:3602 rcu_do_batch kernel/rcu/tree.c:2248 [inline] rcu_core+0x7b5/0x1890 kernel/rcu/tree.c:2508 __do_softirq+0x1d3/0x9c6 kernel/softirq.c:571 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:2796 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_unregister_queue+0x1a6/0x2a0 block/blk-sysfs.c:932 del_gendisk+0x390/0xb30 block/genhd.c:617 loop_remove drivers/block/loop.c:2064 [inline] loop_control_remove drivers/block/loop.c:2119 [inline] loop_control_ioctl+0x44d/0x620 drivers/block/loop.c:2157 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+0x63/0xcd 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:2796 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 do_renameat2+0xb6e/0xc80 fs/namei.c:4909 __do_sys_rename fs/namei.c:4953 [inline] __se_sys_rename fs/namei.c:4951 [inline] __x64_sys_rename+0x7d/0xa0 fs/namei.c:4951 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+0x63/0xcd The buggy address belongs to the object at ffff888075c0ba70 which belongs to the cache dentry of size 312 The buggy address is located 104 bytes inside of 312-byte region [ffff888075c0ba70, ffff888075c0bba8) The buggy address belongs to the physical page: page:ffffea0001d70280 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888075c0aeb0 pfn:0x75c0a head:ffffea0001d70280 order:1 compound_mapcount:0 compound_pincount:0 memcg:ffff888072f76701 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0001de6b08 ffffea0000a46808 ffff8880119d4780 raw: ffff888075c0aeb0 000000000015000d 00000001ffffffff ffff888072f76701 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Reclaimable, gfp_mask 0xd20d0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_RECLAIMABLE), pid 2985, tgid 2985 (udevadm), ts 15197548735, free_ts 12102548382 prep_new_page mm/page_alloc.c:2534 [inline] get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4284 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5542 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2280 alloc_slab_page mm/slub.c:1721 [inline] allocate_slab+0x228/0x370 mm/slub.c:1866 new_slab mm/slub.c:1919 [inline] ___slab_alloc+0xad0/0x1440 mm/slub.c:3100 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3198 slab_alloc_node mm/slub.c:3283 [inline] slab_alloc mm/slub.c:3325 [inline] __kmem_cache_alloc_lru mm/slub.c:3332 [inline] kmem_cache_alloc_lru+0x4aa/0x730 mm/slub.c:3348 __d_alloc+0x32/0x960 fs/dcache.c:1769 d_alloc+0x4a/0x230 fs/dcache.c:1849 d_alloc_parallel+0xe4/0x1400 fs/dcache.c:2647 __lookup_slow+0x193/0x460 fs/namei.c:1670 lookup_slow fs/namei.c:1702 [inline] walk_component+0x33f/0x5a0 fs/namei.c:1993 link_path_walk.part.0+0x74e/0xe20 fs/namei.c:2320 link_path_walk fs/namei.c:2244 [inline] path_lookupat+0xb7/0x840 fs/namei.c:2473 filename_lookup+0x1ce/0x590 fs/namei.c:2503 vfs_statx+0x148/0x390 fs/stat.c:228 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1451 [inline] free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1501 free_unref_page_prepare mm/page_alloc.c:3382 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3478 free_contig_range+0xb1/0x180 mm/page_alloc.c:9458 destroy_args+0xa8/0x64c mm/debug_vm_pgtable.c:1031 debug_vm_pgtable+0x2954/0x29e5 mm/debug_vm_pgtable.c:1354 do_one_initcall+0xfe/0x650 init/main.c:1304 do_initcall_level init/main.c:1379 [inline] do_initcalls init/main.c:1395 [inline] do_basic_setup init/main.c:1414 [inline] kernel_init_freeable+0x6ff/0x788 init/main.c:1634 kernel_init+0x1a/0x1d0 init/main.c:1522 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Memory state around the buggy address: ffff888075c0b980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888075c0ba00: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fa fb >ffff888075c0ba80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888075c0bb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888075c0bb80: fb fb fb fb fb fc fc fc fc fc fc fc fc 00 00 00 ==================================================================