================================================================== BUG: KASAN: use-after-free in relay_switch_subbuf+0x8be/0x920 kernel/relay.c:755 Read of size 8 at addr ffff88808abdd058 by task blkid/1750 CPU: 1 PID: 1750 Comm: blkid Not tainted 5.3.0 #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_plug+0x5d/0x80 kernel/trace/blktrace.c:941 trace_block_plug include/trace/events/block.h:456 [inline] blk_mq_make_request+0x17bc/0x2200 block/blk-mq.c:1988 generic_make_request block/blk-core.c:1052 [inline] generic_make_request+0x23c/0xb50 block/blk-core.c:994 submit_bio+0x104/0x4d0 block/blk-core.c:1163 mpage_bio_submit fs/mpage.c:66 [inline] mpage_readpages+0x466/0x630 fs/mpage.c:410 blkdev_readpages+0x2d/0x40 fs/block_dev.c:620 read_pages+0x108/0x540 mm/readahead.c:126 __do_page_cache_readahead+0x4e0/0x5d0 mm/readahead.c:212 ra_submit mm/internal.h:62 [inline] ondemand_readahead+0x561/0xd40 mm/readahead.c:492 page_cache_async_readahead mm/readahead.c:574 [inline] page_cache_async_readahead+0x43c/0x7c0 mm/readahead.c:547 generic_file_buffered_read mm/filemap.c:2079 [inline] generic_file_read_iter+0x1239/0x1ce0 mm/filemap.c:2344 blkdev_read_iter+0x120/0x190 fs/block_dev.c:2007 call_read_iter include/linux/fs.h:1864 [inline] new_sync_read+0x4d7/0x800 fs/read_write.c:414 __vfs_read+0xe1/0x110 fs/read_write.c:427 vfs_read+0x1f0/0x440 fs/read_write.c:461 ksys_read+0x14f/0x290 fs/read_write.c:587 __do_sys_read fs/read_write.c:597 [inline] __se_sys_read fs/read_write.c:595 [inline] __x64_sys_read+0x73/0xb0 fs/read_write.c:595 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f0029e47310 Code: 73 01 c3 48 8b 0d 28 4b 2b 00 31 d2 48 29 c2 64 89 11 48 83 c8 ff eb ea 90 90 83 3d e5 a2 2b 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 6e 8a 01 00 48 89 04 24 RSP: 002b:00007fff8caa3708 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 0000000000010000 RCX: 00007f0029e47310 RDX: 0000000000000561 RSI: 0000000001693b48 RDI: 0000000000000003 RBP: 0000000001693b20 R08: 0000000000000018 R09: 0000000001680000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000001690030 R13: 0000000000000561 R14: 0000000001690080 R15: 0000000001693b38 Allocated by task 759: 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 750: 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 ffff88808abdd000 which belongs to the cache dentry(81:syz3) of size 288 The buggy address is located 88 bytes inside of 288-byte region [ffff88808abdd000, ffff88808abdd120) The buggy address belongs to the page: page:ffffea00022af740 refcount:1 mapcount:0 mapping:ffff8880a8e76000 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0002540948 ffffea000254a9c8 ffff8880a8e76000 raw: 0000000000000000 ffff88808abdd000 000000010000000b 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808abdcf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88808abdcf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88808abdd000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808abdd080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808abdd100: fb fb fb fb fc fc fc fc fc fc fc fc 00 00 00 00 ==================================================================