================================================================== BUG: KASAN: use-after-free in d_inode include/linux/dcache.h:516 [inline] BUG: KASAN: use-after-free in relay_switch_subbuf+0x8cc/0x940 kernel/relay.c:761 Read of size 8 at addr ffff88808e288a78 by task systemd-udevd/29339 CPU: 0 PID: 29339 Comm: systemd-udevd Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354 kasan_report mm/kasan/report.c:412 [inline] __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433 d_inode include/linux/dcache.h:516 [inline] relay_switch_subbuf+0x8cc/0x940 kernel/relay.c:761 relay_reserve include/linux/relay.h:261 [inline] trace_note+0x5eb/0x750 kernel/trace/blktrace.c:96 trace_note_tsk kernel/trace/blktrace.c:127 [inline] __blk_add_trace+0xb86/0xe20 kernel/trace/blktrace.c:267 blk_add_trace_bio+0x3a6/0x4d0 kernel/trace/blktrace.c:915 trace_block_bio_queue include/trace/events/block.h:357 [inline] generic_make_request_checks+0x1637/0x22e0 block/blk-core.c:2346 generic_make_request+0x23f/0xdf0 block/blk-core.c:2412 submit_bio+0xb1/0x430 block/blk-core.c:2576 mpage_bio_submit fs/mpage.c:66 [inline] mpage_readpages+0x4ca/0x630 fs/mpage.c:410 read_pages.isra.0+0xf6/0x5d0 mm/readahead.c:123 __do_page_cache_readahead+0x5c6/0x6c0 mm/readahead.c:211 force_page_cache_readahead+0x1d8/0x310 mm/readahead.c:242 page_cache_sync_readahead mm/readahead.c:523 [inline] page_cache_sync_readahead+0x3af/0x520 mm/readahead.c:510 generic_file_buffered_read mm/filemap.c:2115 [inline] generic_file_read_iter+0x1497/0x2b60 mm/filemap.c:2385 blkdev_read_iter+0x127/0x1c0 fs/block_dev.c:1971 call_read_iter include/linux/fs.h:1815 [inline] new_sync_read fs/read_write.c:406 [inline] __vfs_read+0x518/0x750 fs/read_write.c:418 vfs_read+0x194/0x3c0 fs/read_write.c:452 ksys_read+0x12b/0x2a0 fs/read_write.c:579 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f4af6d45210 Code: 73 01 c3 48 8b 0d 98 7d 20 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d b9 c1 20 00 00 75 10 b8 00 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 4e fc ff ff 48 89 04 24 RSP: 002b:00007ffe6c798558 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 00005589eb0ad120 RCX: 00007f4af6d45210 RDX: 0000000000000400 RSI: 00005589eb0ad148 RDI: 000000000000000f RBP: 00005589eb0be2e0 R08: 00007f4af6d2ff78 R09: 0000000000000430 R10: 000000000000006d R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000400 R14: 00005589eb0be330 R15: 0000000000000400 Allocated by task 11901: kmem_cache_alloc+0x122/0x370 mm/slab.c:3559 __d_alloc+0x2b/0xa10 fs/dcache.c:1612 d_alloc+0x4a/0x230 fs/dcache.c:1696 d_alloc_parallel+0xeb/0x19e0 fs/dcache.c:2443 __lookup_slow+0x18d/0x4a0 fs/namei.c:1655 lookup_one_len+0x163/0x190 fs/namei.c:2544 start_creating+0xc9/0x220 fs/debugfs/inode.c:313 __debugfs_create_file+0x5e/0x480 fs/debugfs/inode.c:352 relay_create_buf_file+0xf0/0x170 kernel/relay.c:429 relay_open_buf.part.0+0x781/0xb80 kernel/relay.c:458 relay_open_buf kernel/relay.c:450 [inline] relay_open kernel/relay.c:605 [inline] relay_open+0x537/0x9f0 kernel/relay.c:564 do_blk_trace_setup+0x4f6/0xb40 kernel/trace/blktrace.c:566 __blk_trace_setup+0xca/0x180 kernel/trace/blktrace.c:609 blk_trace_ioctl+0x155/0x290 kernel/trace/blktrace.c:750 blkdev_ioctl+0x112/0x1a80 block/ioctl.c:587 block_ioctl+0xe9/0x130 fs/block_dev.c:1906 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688 ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 9: __cache_free mm/slab.c:3503 [inline] kmem_cache_free+0x7f/0x260 mm/slab.c:3765 __rcu_reclaim kernel/rcu/rcu.h:236 [inline] rcu_do_batch kernel/rcu/tree.c:2584 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2897 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2864 [inline] rcu_process_callbacks+0x8ff/0x18b0 kernel/rcu/tree.c:2881 __do_softirq+0x265/0x980 kernel/softirq.c:292 The buggy address belongs to the object at ffff88808e288a20 which belongs to the cache dentry of size 288 The buggy address is located 88 bytes inside of 288-byte region [ffff88808e288a20, ffff88808e288b40) The buggy address belongs to the page: page:ffffea000238a200 count:1 mapcount:0 mapping:ffff88813be45200 index:0xffff88808e288ce0 flags: 0xfff00000000100(slab) raw: 00fff00000000100 ffffea00023ff748 ffffea000287b908 ffff88813be45200 raw: ffff88808e288ce0 ffff88808e288080 000000010000000a 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808e288900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88808e288980: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc >ffff88808e288a00: fc fc fc fc fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808e288a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808e288b00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================