================================================================== BUG: KASAN: use-after-free in relay_switch_subbuf+0x8be/0x920 kernel/relay.c:755 Read of size 8 at addr ffff888094c7fb58 by task syz-executor.4/10324 CPU: 1 PID: 10324 Comm: syz-executor.4 Not tainted 5.3.0-rc6+ #147 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_complete+0x17a/0x1e0 kernel/trace/blktrace.c:842 trace_block_rq_complete include/trace/events/block.h:116 [inline] blk_update_request+0x851/0xc10 block/blk-core.c:1403 blk_mq_end_request+0x5b/0x560 block/blk-mq.c:557 blk_flush_complete_seq+0x558/0x1030 block/blk-flush.c:196 flush_end_io+0x3d1/0x6d0 block/blk-flush.c:237 __blk_mq_end_request+0x28a/0x500 block/blk-mq.c:548 scsi_end_request+0x367/0x840 drivers/scsi/scsi_lib.c:613 scsi_io_completion+0x360/0x1420 drivers/scsi/scsi_lib.c:963 scsi_finish_command+0x3b7/0x670 drivers/scsi/scsi.c:228 scsi_softirq_done+0x326/0x3b0 drivers/scsi/scsi_lib.c:1465 blk_done_softirq+0x2fe/0x4d0 block/blk-softirq.c:37 __do_softirq+0x262/0x98c kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x19b/0x1e0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:537 [inline] do_IRQ+0x12c/0x200 arch/x86/kernel/irq.c:259 common_interrupt+0xf/0xf arch/x86/entry/entry_64.S:607 RIP: 0010:count_memcg_event_mm+0x0/0x3f0 include/linux/memcontrol.h:736 Code: ff ff e8 a3 b9 0f 00 e9 66 fe ff ff e8 b9 b9 0f 00 e9 f7 fd ff ff 4c 89 ef e8 ac b9 0f 00 e9 10 fe ff ff 0f 1f 80 00 00 00 00 <55> 48 89 e5 41 55 41 89 f5 41 54 53 48 89 fb e8 dc ac d5 ff 0f 1f RSP: 0018:ffff88804756fb70 EFLAGS: 00000246 ORIG_RAX: ffffffffffffffdd RAX: dffffc0000000000 RBX: ffff88802ee22140 RCX: ffffc9000e799000 RDX: 1ffff1100f2d4739 RSI: 0000000000000014 RDI: ffff888099086b40 RBP: ffff88804756fbb8 R08: ffff88802ee22140 R09: ffffed100f1beea6 R10: ffffed100f1beea5 R11: ffff888078df752b R12: ffff8880796a3988 R13: 0000000000000004 R14: 00000000202f2000 R15: ffff8880796a39c8 faultin_page mm/gup.c:651 [inline] __get_user_pages+0x7d4/0x1b30 mm/gup.c:854 populate_vma_page_range+0x20d/0x2a0 mm/gup.c:1230 __mm_populate+0x204/0x380 mm/gup.c:1278 mm_populate include/linux/mm.h:2383 [inline] __do_sys_remap_file_pages mm/mmap.c:2975 [inline] __se_sys_remap_file_pages mm/mmap.c:2885 [inline] __x64_sys_remap_file_pages+0x8cf/0x8e0 mm/mmap.c:2885 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459879 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:00007f16d3d3ec78 EFLAGS: 00000246 ORIG_RAX: 00000000000000d8 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000459879 RDX: 0000000000000000 RSI: 0000000000200000 RDI: 00000000202ec000 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000000001ff R11: 0000000000000246 R12: 00007f16d3d3f6d4 R13: 00000000004c6dfd R14: 00000000004dc280 R15: 00000000ffffffff Allocated by task 9759: 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+0x4d/0x280 fs/dcache.c:1767 d_alloc_parallel+0xf4/0x1c30 fs/dcache.c:2519 lookup_open+0x525/0x1a50 fs/namei.c:3145 do_last fs/namei.c:3322 [inline] path_openat+0x1e94/0x4630 fs/namei.c:3533 do_filp_open+0x1a1/0x280 fs/namei.c:3563 do_sys_open+0x3fe/0x5d0 fs/open.c:1089 __do_sys_open fs/open.c:1107 [inline] __se_sys_open fs/open.c:1102 [inline] __x64_sys_open+0x7e/0xc0 fs/open.c:1102 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 9: 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+0x20/0x30 fs/dcache.c:271 __rcu_reclaim kernel/rcu/rcu.h:222 [inline] rcu_do_batch kernel/rcu/tree.c:2114 [inline] rcu_core+0x67f/0x1580 kernel/rcu/tree.c:2314 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2323 __do_softirq+0x262/0x98c kernel/softirq.c:292 The buggy address belongs to the object at ffff888094c7fb00 which belongs to the cache dentry(65:syz1) of size 288 The buggy address is located 88 bytes inside of 288-byte region [ffff888094c7fb00, ffff888094c7fc20) The buggy address belongs to the page: page:ffffea0002531fc0 refcount:1 mapcount:0 mapping:ffff88809c5711c0 index:0xffff888094c7fc60 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0000ccd988 ffffea0002537008 ffff88809c5711c0 raw: ffff888094c7fc60 ffff888094c7f000 0000000100000009 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888094c7fa00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888094c7fa80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff888094c7fb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888094c7fb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888094c7fc00: fb fb fb fb fc fc fc fc fc fc fc fc fb fb fb fb ==================================================================