================================================================== BUG: KASAN: use-after-free in relay_switch_subbuf+0x8be/0x920 kernel/relay.c:755 Read of size 8 at addr ffff888057aeb5d8 by task syz-executor.4/21540 CPU: 0 PID: 21540 Comm: syz-executor.4 Not tainted 5.3.0-rc7+ #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+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0xd4/0x306 mm/kasan/report.c:351 __kasan_report.cold+0x1b/0x36 mm/kasan/report.c:482 kasan_report+0x12/0x17 mm/kasan/common.c:618 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 relay_switch_subbuf+0x8be/0x920 kernel/relay.c:755 relay_reserve include/linux/relay.h:261 [inline] trace_note.isra.0+0x5b8/0x6e0 kernel/trace/blktrace.c:93 trace_note_tsk kernel/trace/blktrace.c:124 [inline] __blk_add_trace+0xb70/0xe10 kernel/trace/blktrace.c:264 blk_add_trace_rq+0x185/0x1f0 kernel/trace/blktrace.c:813 blk_add_trace_rq_insert+0x180/0x1e0 kernel/trace/blktrace.c:820 trace_block_rq_insert include/trace/events/block.h:192 [inline] blk_mq_sched_request_inserted+0x1a5/0x330 block/blk-mq-sched.c:356 dd_insert_request block/mq-deadline.c:509 [inline] dd_insert_requests+0x2c4/0x980 block/mq-deadline.c:545 blk_mq_sched_insert_request+0x58c/0x720 block/blk-mq-sched.c:401 blk_execute_rq_nowait+0x139/0x180 block/blk-exec.c:62 sg_common_write.isra.0+0xfa7/0x22c0 drivers/scsi/sg.c:838 sg_write.part.0+0x855/0xf10 drivers/scsi/sg.c:709 sg_write+0x6e/0x93 drivers/scsi/sg.c:617 __vfs_write+0x8a/0x110 fs/read_write.c:494 vfs_write+0x268/0x5d0 fs/read_write.c:558 ksys_write+0x14f/0x290 fs/read_write.c:611 __do_sys_write fs/read_write.c:623 [inline] __se_sys_write fs/read_write.c:620 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:620 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4598e9 Code: fd b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f9013deac78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00000000004598e9 RDX: 000000000000fddf RSI: 0000000020000040 RDI: 0000000000000006 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f9013deb6d4 R13: 00000000004c9299 R14: 00000000004e05f0 R15: 00000000ffffffff Allocated by task 9739: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:493 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:466 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:501 slab_post_alloc_hook mm/slab.h:520 [inline] slab_alloc mm/slab.c:3319 [inline] kmem_cache_alloc+0x121/0x710 mm/slab.c:3483 __d_alloc+0x2e/0x8c0 fs/dcache.c:1688 d_alloc_pseudo+0x1e/0x70 fs/dcache.c:1817 alloc_file_pseudo+0xe2/0x280 fs/file_table.c:225 sock_alloc_file+0x50/0x180 net/socket.c:397 sock_map_fd net/socket.c:420 [inline] __sys_socket+0x150/0x220 net/socket.c:1515 __do_sys_socket net/socket.c:1520 [inline] __se_sys_socket net/socket.c:1518 [inline] __x64_sys_socket+0x73/0xb0 net/socket.c:1518 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 9739: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:455 kasan_slab_free+0xe/0x10 mm/kasan/common.c:463 __cache_free mm/slab.c:3425 [inline] kmem_cache_free+0x86/0x320 mm/slab.c:3693 __d_free fs/dcache.c:271 [inline] dentry_free+0xe9/0x160 fs/dcache.c:348 __dentry_kill+0x457/0x600 fs/dcache.c:593 dentry_kill fs/dcache.c:686 [inline] dput+0x819/0xde0 fs/dcache.c:859 __fput+0x424/0x890 fs/file_table.c:293 ____fput+0x16/0x20 fs/file_table.c:313 task_work_run+0x145/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x316/0x380 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:194 [inline] syscall_return_slowpath arch/x86/entry/common.c:274 [inline] do_syscall_64+0x5a9/0x6a0 arch/x86/entry/common.c:299 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888057aeb580 which belongs to the cache dentry(33:syz2) of size 288 The buggy address is located 88 bytes inside of 288-byte region [ffff888057aeb580, ffff888057aeb6a0) The buggy address belongs to the page: page:ffffea00015ebac0 refcount:1 mapcount:0 mapping:ffff88806920e8c0 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0002540288 ffffea0002549788 ffff88806920e8c0 raw: 0000000000000000 ffff888057aeb000 000000010000000b 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888057aeb480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888057aeb500: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc >ffff888057aeb580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888057aeb600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888057aeb680: fb fb fb fb fc fc fc fc fc fc fc fc fb fb fb fb ==================================================================