================================================================== BUG: KASAN: use-after-free in relay_switch_subbuf+0x8be/0x920 kernel/relay.c:755 Read of size 8 at addr ffff8880950859f8 by task syz-executor.4/8810 CPU: 1 PID: 8810 Comm: syz-executor.4 Not tainted 5.4.0-rc3+ #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.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374 __kasan_report.cold+0x1b/0x41 mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:634 __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+0x9e7/0xdc0 block/blk-core.c:1435 scsi_end_request+0x7f/0x840 drivers/scsi/scsi_lib.c:579 scsi_io_completion+0x20a/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:1477 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:536 [inline] do_IRQ+0xe3/0x280 arch/x86/kernel/irq.c:263 common_interrupt+0xf/0xf arch/x86/entry/entry_64.S:607 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:756 [inline] RIP: 0010:lock_release+0x4c0/0x960 kernel/locking/lockdep.c:4509 Code: 00 00 00 00 00 48 c1 e8 03 80 3c 10 00 0f 85 8c 03 00 00 48 83 3d df d7 99 07 00 0f 84 7f 01 00 00 48 8b bd 48 ff ff ff 57 9d <0f> 1f 44 00 00 48 b8 00 00 00 00 00 fc ff df 48 01 c3 48 c7 03 00 RSP: 0018:ffff8880624e7608 EFLAGS: 00000286 ORIG_RAX: ffffffffffffffdd RAX: 1ffffffff11e63cc RBX: 1ffff1100c49cec6 RCX: 1ffff1100c49bd79 RDX: dffffc0000000000 RSI: 1ffff1100c49bd7b RDI: 0000000000000286 RBP: ffff8880624e76d8 R08: 0000000000000001 R09: ffff8880624debd0 R10: fffffbfff138ce70 R11: ffffffff89c67387 R12: ffff8880624de340 R13: ffffffff81be04cf R14: ffff8880624e76b0 R15: ffff8880624de340 __raw_spin_unlock include/linux/spinlock_api_smp.h:150 [inline] _raw_spin_unlock+0x1b/0x50 kernel/locking/spinlock.c:183 spin_unlock include/linux/spinlock.h:378 [inline] __dentry_kill+0x44f/0x600 fs/dcache.c:591 shrink_dentry_list+0x152/0x4a0 fs/dcache.c:1120 shrink_dcache_parent+0x23d/0x400 fs/dcache.c:1547 d_invalidate fs/dcache.c:1656 [inline] d_invalidate+0xfb/0x230 fs/dcache.c:1641 proc_flush_task_mnt fs/proc/base.c:3147 [inline] proc_flush_task+0x285/0x4c0 fs/proc/base.c:3217 release_task+0x18c/0x15b0 kernel/exit.c:202 wait_task_zombie kernel/exit.c:1106 [inline] wait_consider_task+0x2c22/0x38a0 kernel/exit.c:1333 do_wait_thread kernel/exit.c:1396 [inline] do_wait+0x452/0xa10 kernel/exit.c:1467 kernel_wait4+0x171/0x290 kernel/exit.c:1639 __do_sys_wait4+0x147/0x160 kernel/exit.c:1651 __se_sys_wait4 kernel/exit.c:1647 [inline] __x64_sys_wait4+0x97/0xf0 kernel/exit.c:1647 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4139ea Code: 0f 83 6a 18 00 00 c3 66 0f 1f 84 00 00 00 00 00 8b 05 ae 28 66 00 85 c0 75 36 45 31 d2 48 63 d2 48 63 ff b8 3d 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 06 c3 0f 1f 44 00 00 48 c7 c2 d4 ff ff ff f7 RSP: 002b:0000000000a6fda8 EFLAGS: 00000246 ORIG_RAX: 000000000000003d RAX: ffffffffffffffda RBX: 000000000013bc2a RCX: 00000000004139ea RDX: 0000000040000001 RSI: 0000000000a6fde0 RDI: ffffffffffffffff RBP: 0000000000001369 R08: 0000000000000001 R09: 0000000001def940 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000000e R13: 0000000000a6fde0 R14: 000000000013ba88 R15: 0000000000a6fdf0 Allocated by task 18172: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:510 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:483 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:518 slab_post_alloc_hook mm/slab.h:584 [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_slow+0x1ab/0x500 fs/namei.c:1646 lookup_slow+0x58/0x80 fs/namei.c:1680 walk_component+0x747/0x2000 fs/namei.c:1800 link_path_walk.part.0+0x9a4/0x1340 fs/namei.c:2131 link_path_walk fs/namei.c:2062 [inline] path_openat+0x202/0x46d0 fs/namei.c:3524 do_filp_open+0x1a1/0x280 fs/namei.c:3555 do_sys_open+0x3fe/0x5d0 fs/open.c:1097 __do_sys_open fs/open.c:1115 [inline] __se_sys_open fs/open.c:1110 [inline] __x64_sys_open+0x7e/0xc0 fs/open.c:1110 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 18178: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] kasan_set_free_info mm/kasan/common.c:332 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:471 kasan_slab_free+0xe/0x10 mm/kasan/common.c:480 __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:2157 [inline] rcu_core+0x581/0x1560 kernel/rcu/tree.c:2377 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2386 __do_softirq+0x262/0x98c kernel/softirq.c:292 The buggy address belongs to the object at ffff8880950859a0 which belongs to the cache dentry(33:syz1) of size 288 The buggy address is located 88 bytes inside of 288-byte region [ffff8880950859a0, ffff888095085ac0) The buggy address belongs to the page: page:ffffea0002542140 refcount:1 mapcount:0 mapping:ffff8880a0927540 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea00024e0288 ffffea0000600008 ffff8880a0927540 raw: 0000000000000000 ffff888095085000 000000010000000b 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888095085880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888095085900: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc >ffff888095085980: fc fc fc fc fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888095085a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888095085a80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================