================================================================== BUG: KASAN: use-after-free in relay_switch_subbuf+0x8be/0x920 kernel/relay.c:755 Read of size 8 at addr ffff8880953e3b98 by task syz-executor.5/23502 CPU: 0 PID: 23502 Comm: syz-executor.5 Not tainted 5.3.0-rc8+ #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_flush kernel/relay.c:883 [inline] relay_flush+0x1c4/0x280 kernel/relay.c:867 __blk_trace_startstop.isra.0+0x216/0x630 kernel/trace/blktrace.c:662 blk_trace_ioctl+0x1c6/0x300 kernel/trace/blktrace.c:722 blkdev_ioctl+0x126/0x1c1a block/ioctl.c:592 block_ioctl+0xee/0x130 fs/block_dev.c:1954 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:509 [inline] do_vfs_ioctl+0xdb6/0x13e0 fs/ioctl.c:696 ksys_ioctl+0xab/0xd0 fs/ioctl.c:713 __do_sys_ioctl fs/ioctl.c:720 [inline] __se_sys_ioctl fs/ioctl.c:718 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718 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:00007f8e35a25c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00000000004598e9 RDX: 0000000020000040 RSI: 0000000000001275 RDI: 0000000000000003 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f8e35a266d4 R13: 00000000004c0f72 R14: 00000000004d41d0 R15: 00000000ffffffff Allocated by task 23031: 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_slow+0x1ab/0x500 fs/namei.c:1652 lookup_one_len+0x16d/0x1a0 fs/namei.c:2541 start_creating+0xc5/0x1d0 fs/debugfs/inode.c:312 __debugfs_create_file+0x65/0x3c0 fs/debugfs/inode.c:357 debugfs_create_file+0x5a/0x70 fs/debugfs/inode.c:413 blk_create_buf_file_callback+0x33/0x40 kernel/trace/blktrace.c:444 relay_create_buf_file+0xf9/0x180 kernel/relay.c:428 relay_open_buf.part.0+0x76e/0xb60 kernel/relay.c:457 relay_open_buf kernel/relay.c:449 [inline] relay_open kernel/relay.c:599 [inline] relay_open+0x523/0x980 kernel/relay.c:563 do_blk_trace_setup+0x3f0/0xb50 kernel/trace/blktrace.c:526 __blk_trace_setup+0xe3/0x190 kernel/trace/blktrace.c:571 blk_trace_ioctl+0x170/0x300 kernel/trace/blktrace.c:710 blkdev_ioctl+0x126/0x1c1a block/ioctl.c:592 block_ioctl+0xee/0x130 fs/block_dev.c:1954 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:509 [inline] do_vfs_ioctl+0xdb6/0x13e0 fs/ioctl.c:696 ksys_ioctl+0xab/0xd0 fs/ioctl.c:713 __do_sys_ioctl fs/ioctl.c:720 [inline] __se_sys_ioctl fs/ioctl.c:718 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 16: 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 ffff8880953e3b40 which belongs to the cache dentry(81:syz4) of size 288 The buggy address is located 88 bytes inside of 288-byte region [ffff8880953e3b40, ffff8880953e3c60) The buggy address belongs to the page: page:ffffea000254f8c0 refcount:1 mapcount:0 mapping:ffff8880a58ce1c0 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0002549648 ffffea000254d808 ffff8880a58ce1c0 raw: 0000000000000000 ffff8880953e3040 000000010000000b 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880953e3a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880953e3b00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff8880953e3b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880953e3c00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff8880953e3c80: fc fc fc fc fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================