================================================================== 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 ffff88808d8f67b8 by task syz-executor.1/970 CPU: 1 PID: 970 Comm: syz-executor.1 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 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_plug+0xfe/0x240 kernel/trace/blktrace.c:1000 trace_block_plug include/trace/events/block.h:456 [inline] blk_mq_make_request+0x14b7/0x1c00 block/blk-mq.c:1902 generic_make_request+0x613/0xdf0 block/blk-core.c:2467 submit_bio+0xb1/0x430 block/blk-core.c:2576 dio_bio_submit fs/direct-io.c:481 [inline] dio_send_cur_page fs/direct-io.c:815 [inline] submit_page_section fs/direct-io.c:883 [inline] do_direct_IO fs/direct-io.c:1097 [inline] do_blockdev_direct_IO fs/direct-io.c:1333 [inline] __blockdev_direct_IO+0x81ba/0xef40 fs/direct-io.c:1419 ext4_direct_IO_write fs/ext4/inode.c:3777 [inline] ext4_direct_IO+0xae4/0x1c50 fs/ext4/inode.c:3915 generic_file_direct_write+0x208/0x4a0 mm/filemap.c:3073 __generic_file_write_iter+0x2d0/0x610 mm/filemap.c:3252 ext4_file_write_iter+0x2fe/0xf20 fs/ext4/file.c:272 call_write_iter include/linux/fs.h:1821 [inline] aio_write+0x37f/0x5c0 fs/aio.c:1574 __io_submit_one fs/aio.c:1858 [inline] io_submit_one+0xecd/0x20c0 fs/aio.c:1909 __do_sys_io_submit fs/aio.c:1953 [inline] __se_sys_io_submit+0x11b/0x4a0 fs/aio.c:1924 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7fc0d9708059 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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:00007fc0d807d168 EFLAGS: 00000246 ORIG_RAX: 00000000000000d1 RAX: ffffffffffffffda RBX: 00007fc0d981af60 RCX: 00007fc0d9708059 RDX: 0000000020000540 RSI: 000000000000003b RDI: 00007fc0d97f6000 RBP: 00007fc0d976208d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc0916d56f R14: 00007fc0d807d300 R15: 0000000000022000 Allocated by task 8098: kmem_cache_alloc+0x122/0x370 mm/slab.c:3559 __d_alloc+0x2b/0xa10 fs/dcache.c:1612 d_alloc_pseudo+0x19/0x70 fs/dcache.c:1743 alloc_file_pseudo+0xc6/0x250 fs/file_table.c:224 sock_alloc_file+0x48/0x180 net/socket.c:406 sock_map_fd net/socket.c:429 [inline] __sys_socket+0x13d/0x200 net/socket.c:1462 __do_sys_socket net/socket.c:1467 [inline] __se_sys_socket net/socket.c:1465 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1465 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 8098: __cache_free mm/slab.c:3503 [inline] kmem_cache_free+0x7f/0x260 mm/slab.c:3765 __d_free fs/dcache.c:257 [inline] dentry_free+0xda/0x150 fs/dcache.c:348 __dentry_kill+0x4c6/0x640 fs/dcache.c:580 dentry_kill+0xc4/0x510 fs/dcache.c:685 dput+0x55f/0x640 fs/dcache.c:846 __fput+0x415/0x890 fs/file_table.c:291 task_work_run+0x148/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x251/0x2a0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88808d8f6760 which belongs to the cache dentry of size 288 The buggy address is located 88 bytes inside of 288-byte region [ffff88808d8f6760, ffff88808d8f6880) The buggy address belongs to the page: page:ffffea0002363d80 count:1 mapcount:0 mapping:ffff88813be45200 index:0x0 flags: 0xfff00000000100(slab) raw: 00fff00000000100 ffffea00023fe988 ffffea0002361fc8 ffff88813be45200 raw: 0000000000000000 ffff88808d8f6080 000000010000000b 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808d8f6680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88808d8f6700: 00 00 00 00 fc fc fc fc fc fc fc fc fb fb fb fb >ffff88808d8f6780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808d8f6800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808d8f6880: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ==================================================================