loop4: detected capacity change from 0 to 4 ================================================================== 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 ffff888075e16f18 by task syz-executor.4/18161 CPU: 0 PID: 18161 Comm: syz-executor.4 Not tainted 5.19.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022 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+0x326/0x4f0 kernel/trace/blktrace.c:905 trace_block_bio_queue include/trace/events/block.h:355 [inline] submit_bio_noacct+0x1404/0x1b30 block/blk-core.c:843 submit_bio block/blk-core.c:901 [inline] submit_bio+0xd7/0x300 block/blk-core.c:873 submit_bh_wbc+0x4bc/0x670 fs/buffer.c:3039 submit_bh fs/buffer.c:3045 [inline] block_read_full_folio+0x724/0xa60 fs/buffer.c:2337 do_read_cache_folio+0x281/0x760 mm/filemap.c:3524 do_read_cache_page mm/filemap.c:3602 [inline] read_cache_page+0x59/0x2a0 mm/filemap.c:3611 read_mapping_page include/linux/pagemap.h:759 [inline] read_part_sector+0xf6/0x920 block/partitions/core.c:715 adfspart_check_ICS+0x9a/0x690 block/partitions/acorn.c:360 check_partition block/partitions/core.c:147 [inline] blk_add_partitions block/partitions/core.c:600 [inline] bdev_disk_changed block/partitions/core.c:686 [inline] bdev_disk_changed+0x629/0xf60 block/partitions/core.c:653 blkdev_get_whole+0x18a/0x2d0 block/bdev.c:686 blkdev_get_by_dev.part.0+0x5ec/0xb90 block/bdev.c:823 blkdev_get_by_dev block/bdev.c:891 [inline] blkdev_get_by_path+0x1b3/0x2e0 block/bdev.c:888 get_tree_bdev+0xd5/0x760 fs/super.c:1242 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+0x46/0xb0 RIP: 0033:0x7f7343a8a63a 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:00007f7344b3bf88 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000200 RCX: 00007f7343a8a63a RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007f7344b3bfe0 RBP: 00007f7344b3c020 R08: 00007f7344b3c020 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000206 R12: 0000000020000000 R13: 0000000020000100 R14: 00007f7344b3bfe0 R15: 0000000020000040 Allocated by task 4270: 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:750 [inline] slab_alloc_node mm/slub.c:3243 [inline] slab_alloc mm/slub.c:3251 [inline] __kmem_cache_alloc_lru mm/slub.c:3258 [inline] kmem_cache_alloc_lru+0x31a/0x720 mm/slub.c:3275 __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:1686 lookup_one_len+0x16a/0x1a0 fs/namei.c:2730 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: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+0x46/0xb0 Freed by task 2976: 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:366 [inline] ____kasan_slab_free+0x166/0x1a0 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1754 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1780 slab_free mm/slub.c:3536 [inline] kmem_cache_free+0xdd/0x5a0 mm/slub.c:3553 rcu_do_batch kernel/rcu/tree.c:2578 [inline] rcu_core+0x7b1/0x1880 kernel/rcu/tree.c:2838 __do_softirq+0x29b/0x9c2 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:3126 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+0x202/0x350 block/blk-sysfs.c:946 del_gendisk+0x31f/0x900 block/genhd.c:638 loop_remove+0x3a/0x140 drivers/block/loop.c:2059 loop_control_remove drivers/block/loop.c:2115 [inline] loop_control_ioctl+0x42b/0x540 drivers/block/loop.c:2153 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+0x46/0xb0 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:3126 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+0x239/0x610 fs/proc/inode.c:157 proc_sys_invalidate_dcache fs/proc/proc_sysctl.c:294 [inline] start_unregistering fs/proc/proc_sysctl.c:319 [inline] drop_sysctl_table+0x169/0x4e0 fs/proc/proc_sysctl.c:1712 unregister_sysctl_table fs/proc/proc_sysctl.c:1754 [inline] unregister_sysctl_table+0xc0/0x190 fs/proc/proc_sysctl.c:1729 __addrconf_sysctl_unregister net/ipv6/addrconf.c:7104 [inline] addrconf_sysctl_unregister+0xee/0x1c0 net/ipv6/addrconf.c:7132 addrconf_ifdown.isra.0+0x128c/0x1830 net/ipv6/addrconf.c:3899 addrconf_notify+0xeb/0x1ba0 net/ipv6/addrconf.c:3669 notifier_call_chain+0xb5/0x200 kernel/notifier.c:87 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1945 call_netdevice_notifiers_extack net/core/dev.c:1983 [inline] call_netdevice_notifiers net/core/dev.c:1997 [inline] unregister_netdevice_many+0x948/0x18b0 net/core/dev.c:10839 unregister_netdevice_queue net/core/dev.c:10770 [inline] unregister_netdevice_queue+0x2dd/0x3c0 net/core/dev.c:10760 unregister_netdevice include/linux/netdevice.h:3018 [inline] unregister_netdev+0x18/0x20 net/core/dev.c:10898 usbnet_disconnect+0xd8/0x270 drivers/net/usb/usbnet.c:1620 usb_unbind_interface+0x1d8/0x8e0 drivers/usb/core/driver.c:458 device_remove drivers/base/dd.c:545 [inline] device_remove+0x11f/0x170 drivers/base/dd.c:537 __device_release_driver drivers/base/dd.c:1222 [inline] device_release_driver_internal+0x4a1/0x700 drivers/base/dd.c:1248 bus_remove_device+0x2eb/0x5a0 drivers/base/bus.c:529 device_del+0x4f3/0xc80 drivers/base/core.c:3604 usb_disable_device+0x35b/0x7b0 drivers/usb/core/message.c:1419 usb_disconnect.cold+0x278/0x6ec drivers/usb/core/hub.c:2228 hub_port_connect drivers/usb/core/hub.c:5207 [inline] hub_port_connect_change drivers/usb/core/hub.c:5507 [inline] port_event drivers/usb/core/hub.c:5663 [inline] hub_event+0x1e83/0x4690 drivers/usb/core/hub.c:5745 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:302 The buggy address belongs to the object at ffff888075e16eb0 which belongs to the cache dentry of size 312 The buggy address is located 104 bytes inside of 312-byte region [ffff888075e16eb0, ffff888075e16fe8) The buggy address belongs to the physical page: page:ffffea0001d78580 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x75e16 head:ffffea0001d78580 order:1 compound_mapcount:0 compound_pincount:0 memcg:ffff88806e0fa801 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888140007640 raw: 0000000000000000 0000000000150015 00000001ffffffff ffff88806e0fa801 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 2979, tgid 2979 (udevd), ts 18389874796, free_ts 10036384994 prep_new_page mm/page_alloc.c:2456 [inline] get_page_from_freelist+0x1290/0x3b70 mm/page_alloc.c:4198 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5426 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2272 alloc_slab_page mm/slub.c:1824 [inline] allocate_slab+0x26c/0x3c0 mm/slub.c:1969 new_slab mm/slub.c:2029 [inline] ___slab_alloc+0x9c4/0xe20 mm/slub.c:3031 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3118 slab_alloc_node mm/slub.c:3209 [inline] slab_alloc mm/slub.c:3251 [inline] __kmem_cache_alloc_lru mm/slub.c:3258 [inline] kmem_cache_alloc_lru+0x504/0x720 mm/slub.c:3275 __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:1686 lookup_slow fs/namei.c:1718 [inline] walk_component+0x40f/0x6a0 fs/namei.c:2014 lookup_last fs/namei.c:2469 [inline] path_lookupat+0x1bb/0x860 fs/namei.c:2493 filename_lookup+0x1c6/0x590 fs/namei.c:2522 vfs_statx+0x148/0x390 fs/stat.c:228 vfs_fstatat+0x8c/0xb0 fs/stat.c:255 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1371 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1421 free_unref_page_prepare mm/page_alloc.c:3343 [inline] free_unref_page+0x19/0x6a0 mm/page_alloc.c:3438 free_contig_range+0xb1/0x180 mm/page_alloc.c:9314 destroy_args+0xa8/0x646 mm/debug_vm_pgtable.c:1031 debug_vm_pgtable+0x2a03/0x2a94 mm/debug_vm_pgtable.c:1354 do_one_initcall+0x103/0x650 init/main.c:1295 do_initcall_level init/main.c:1368 [inline] do_initcalls init/main.c:1384 [inline] do_basic_setup init/main.c:1403 [inline] kernel_init_freeable+0x6b1/0x73a init/main.c:1610 kernel_init+0x1a/0x1d0 init/main.c:1499 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302 Memory state around the buggy address: ffff888075e16e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc ffff888075e16e80: fc fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb >ffff888075e16f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888075e16f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc ffff888075e17000: fc fc fc fc fc 00 00 00 00 00 00 00 00 00 00 00 ==================================================================