================================================================== BUG: KASAN: use-after-free in relay_switch_subbuf+0x8be/0x920 kernel/relay.c:755 Read of size 8 at addr ffff88809498b318 by task syz-executor.0/19174 CPU: 1 PID: 19174 Comm: syz-executor.0 Not tainted 4.19.89-syzkaller #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+0x197/0x210 lib/dump_stack.c:118 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report mm/kasan/report.c:412 [inline] kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:396 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 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_bio.isra.0+0x166/0x1e0 kernel/trace/blktrace.c:870 blk_add_trace_bio_queue+0x46/0x60 kernel/trace/blktrace.c:907 trace_block_bio_queue include/trace/events/block.h:357 [inline] generic_make_request_checks+0x1cc2/0x24c0 block/blk-core.c:2343 generic_make_request+0x24c/0x12d0 block/blk-core.c:2409 submit_bio+0xba/0x480 block/blk-core.c:2573 submit_bh_wbc+0x5dc/0x790 fs/buffer.c:3095 submit_bh fs/buffer.c:3101 [inline] __bread_slow fs/buffer.c:1176 [inline] __bread_gfp+0x13d/0x300 fs/buffer.c:1358 sb_bread include/linux/buffer_head.h:307 [inline] bfs_fill_super+0x128/0xef0 fs/bfs/inode.c:338 mount_bdev+0x304/0x3c0 fs/super.c:1158 bfs_mount+0x35/0x40 fs/bfs/inode.c:468 mount_fs+0xa8/0x31f fs/super.c:1261 vfs_kern_mount.part.0+0x6f/0x410 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2469 [inline] do_mount+0x53e/0x2bc0 fs/namespace.c:2799 ksys_mount+0xdb/0x150 fs/namespace.c:3015 __do_sys_mount fs/namespace.c:3029 [inline] __se_sys_mount fs/namespace.c:3026 [inline] __x64_sys_mount+0xbe/0x150 fs/namespace.c:3026 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45a909 Code: ad b6 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 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f4beb0c7c78 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 000000000045a909 RDX: 0000000020001900 RSI: 00000000200018c0 RDI: 00000000200015c0 RBP: 000000000075bf20 R08: 0000000020001940 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000246 R12: 00007f4beb0c86d4 R13: 00000000004c7d4d R14: 00000000004deb28 R15: 00000000ffffffff Allocated by task 18449: netlink: 'syz-executor.5': attribute type 12 has an invalid length. save_stack+0x45/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc mm/kasan/kasan.c:553 [inline] kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:531 kasan_slab_alloc+0xf/0x20 mm/kasan/kasan.c:490 kmem_cache_alloc+0x12e/0x700 mm/slab.c:3559 __d_alloc+0x2e/0x9c0 fs/dcache.c:1610 d_alloc_pseudo+0x1e/0x70 fs/dcache.c:1741 alloc_file_pseudo+0xe2/0x280 fs/file_table.c:224 sock_alloc_file+0x4d/0x170 net/socket.c:394 sock_map_fd net/socket.c:417 [inline] __sys_socket+0x150/0x220 net/socket.c:1350 __do_sys_socket net/socket.c:1355 [inline] __se_sys_socket net/socket.c:1353 [inline] __x64_sys_socket+0x73/0xb0 net/socket.c:1353 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 18449: save_stack+0x45/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3503 [inline] kmem_cache_free+0x86/0x260 mm/slab.c:3765 __d_free fs/dcache.c:257 [inline] dentry_free+0xe9/0x160 fs/dcache.c:348 __dentry_kill+0x457/0x600 fs/dcache.c:580 dentry_kill+0xd3/0x570 fs/dcache.c:685 dput+0x58a/0x670 fs/dcache.c:846 __fput+0x427/0x8b0 fs/file_table.c:291 ____fput+0x16/0x20 fs/file_table.c:309 task_work_run+0x145/0x1c0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x994/0x3080 kernel/exit.c:876 do_group_exit+0x135/0x370 kernel/exit.c:979 get_signal+0x3ec/0x1fc0 kernel/signal.c:2578 do_signal+0x95/0x1960 arch/x86/kernel/signal.c:821 exit_to_usermode_loop+0x244/0x2c0 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x53d/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88809498b2c0 which belongs to the cache dentry(17:syz0) of size 288 The buggy address is located 88 bytes inside of 288-byte region [ffff88809498b2c0, ffff88809498b3e0) The buggy address belongs to the page: page:ffffea00025262c0 count:1 mapcount:0 mapping:ffff88809a865180 index:0x0 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffffea00024c9848 ffffea0000e74a48 ffff88809a865180 raw: 0000000000000000 ffff88809498b000 000000010000000b ffff888055de0e40 page dumped because: kasan: bad access detected page->mem_cgroup:ffff888055de0e40 Memory state around the buggy address: ffff88809498b200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809498b280: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff88809498b300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809498b380: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88809498b400: fc fc fc fc fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================