================================================================== BUG: KASAN: use-after-free in filemap_fault+0x25f5/0x2a00 mm/filemap.c:2559 Read of size 8 at addr ffff888098f1f988 by task syz-executor4/9900 CPU: 0 PID: 9900 Comm: syz-executor4 Not tainted 4.20.0-next-20190103 #5 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+0x1db/0x2d0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:135 filemap_fault+0x25f5/0x2a00 mm/filemap.c:2559 __do_fault+0x176/0x7b0 mm/memory.c:3013 do_read_fault mm/memory.c:3424 [inline] do_fault mm/memory.c:3550 [inline] handle_pte_fault mm/memory.c:3781 [inline] __handle_mm_fault+0x370a/0x55a0 mm/memory.c:3905 handle_mm_fault+0x4ec/0xc80 mm/memory.c:3942 do_user_addr_fault arch/x86/mm/fault.c:1475 [inline] __do_page_fault+0x5da/0xd60 arch/x86/mm/fault.c:1541 do_page_fault+0xe6/0x7d8 arch/x86/mm/fault.c:1572 page_fault+0x1e/0x30 arch/x86/entry/entry_64.S:1143 RIP: 0010:copy_user_generic_unrolled+0x86/0xc0 arch/x86/lib/copy_user_64.S:66 Code: 4c 8b 5e 38 4c 89 47 20 4c 89 4f 28 4c 89 57 30 4c 89 5f 38 48 8d 76 40 48 8d 7f 40 ff c9 75 b6 89 d1 83 e2 07 c1 e9 03 74 12 <4c> 8b 06 4c 89 07 48 8d 76 08 48 8d 7f 08 ff c9 75 ee 21 d2 74 10 RSP: 0018:ffff888053aaf848 EFLAGS: 00010202 RAX: ffffed100a755f20 RBX: 0000000000000038 RCX: 0000000000000007 RDX: 0000000000000000 RSI: 0000000020005fc0 RDI: ffff888053aaf8c8 RBP: ffff888053aaf880 R08: 1ffff1100a755f19 R09: ffffed100a755f20 R10: ffffed100a755f1f R11: ffff888053aaf8ff R12: 0000000020005fc0 R13: 0000000020005ff8 R14: ffff888053aaf8c8 R15: 00007ffffffff000 copy_from_user include/linux/uaccess.h:147 [inline] copy_msghdr_from_user+0xa0/0x570 net/socket.c:1997 ___sys_sendmsg+0x132/0x910 net/socket.c:2061 __sys_sendmmsg+0x246/0x6f0 net/socket.c:2211 __do_sys_sendmmsg net/socket.c:2240 [inline] __se_sys_sendmmsg net/socket.c:2237 [inline] __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2237 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457ec9 Code: 6d 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 3b b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f0335b44c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000000457ec9 RDX: 08000000000000fc RSI: 0000000020005fc0 RDI: 000000000000000a RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f0335b456d4 R13: 00000000004c4ce5 R14: 00000000004d85d8 R15: 00000000ffffffff Allocated by task 9900: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] kasan_kmalloc mm/kasan/common.c:482 [inline] kasan_kmalloc+0xcf/0xe0 mm/kasan/common.c:455 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:397 kmem_cache_alloc+0x12d/0x710 mm/slab.c:3541 vm_area_alloc+0x7a/0x1d0 kernel/fork.c:331 mmap_region+0x93b/0x1ca0 mm/mmap.c:1756 do_mmap+0xa09/0x1220 mm/mmap.c:1559 do_mmap_pgoff include/linux/mm.h:2421 [inline] vm_mmap_pgoff+0x20b/0x2b0 mm/util.c:350 ksys_mmap_pgoff+0x4f8/0x650 mm/mmap.c:1609 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:100 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:91 [inline] __x64_sys_mmap+0xe9/0x1b0 arch/x86/kernel/sys_x86_64.c:91 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 9923: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:444 kasan_slab_free+0xe/0x10 mm/kasan/common.c:452 __cache_free mm/slab.c:3485 [inline] kmem_cache_free+0x86/0x260 mm/slab.c:3747 vm_area_free+0x1d/0x30 kernel/fork.c:350 remove_vma+0x142/0x180 mm/mmap.c:185 remove_vma_list mm/mmap.c:2585 [inline] __do_munmap+0x72e/0xef0 mm/mmap.c:2828 do_munmap mm/mmap.c:2836 [inline] mmap_region+0x698/0x1ca0 mm/mmap.c:1729 do_mmap+0xa09/0x1220 mm/mmap.c:1559 do_mmap_pgoff include/linux/mm.h:2421 [inline] vm_mmap_pgoff+0x20b/0x2b0 mm/util.c:350 ksys_mmap_pgoff+0x4f8/0x650 mm/mmap.c:1609 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:100 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:91 [inline] __x64_sys_mmap+0xe9/0x1b0 arch/x86/kernel/sys_x86_64.c:91 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888098f1f948 which belongs to the cache vm_area_struct(49:syz4) of size 200 The buggy address is located 64 bytes inside of 200-byte region [ffff888098f1f948, ffff888098f1fa10) The buggy address belongs to the page: page:ffffea000263c7c0 count:1 mapcount:0 mapping:ffff8880a8407840 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea00024a1dc8 ffffea0002219148 ffff8880a8407840 raw: 0000000000000000 ffff888098f1f000 000000010000000f ffff88808c54c440 page dumped because: kasan: bad access detected page->mem_cgroup:ffff88808c54c440 Memory state around the buggy address: ffff888098f1f880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888098f1f900: fb fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb >ffff888098f1f980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888098f1fa00: fb fb fc fc fc fc fc fc fc fc 00 00 00 00 00 00 ffff888098f1fa80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================