================================================================== BUG: KASAN: use-after-free in madvise_willneed mm/madvise.c:293 [inline] BUG: KASAN: use-after-free in madvise_vma mm/madvise.c:942 [inline] BUG: KASAN: use-after-free in do_madvise+0x11f1/0x2130 mm/madvise.c:1145 Read of size 8 at addr ffff88808992da90 by task syz-executor.0/5134 CPU: 1 PID: 5134 Comm: syz-executor.0 Not tainted 5.9.0-rc1-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+0x1f0/0x31e lib/dump_stack.c:118 print_address_description+0x66/0x620 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report+0x132/0x1d0 mm/kasan/report.c:530 madvise_willneed mm/madvise.c:293 [inline] madvise_vma mm/madvise.c:942 [inline] do_madvise+0x11f1/0x2130 mm/madvise.c:1145 __do_sys_madvise mm/madvise.c:1171 [inline] __se_sys_madvise mm/madvise.c:1169 [inline] __x64_sys_madvise+0x76/0x80 mm/madvise.c:1169 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45d4d9 Code: 5d b4 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 2b b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f91704cec78 EFLAGS: 00000246 ORIG_RAX: 000000000000001c RAX: ffffffffffffffda RBX: 0000000000020800 RCX: 000000000045d4d9 RDX: 0000000000000003 RSI: 0000000000600003 RDI: 0000000020000000 RBP: 000000000118d020 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cfec R13: 00007ffc189f0dbf R14: 00007f91704cf9c0 R15: 000000000118cfec Allocated by task 5130: kasan_save_stack mm/kasan/common.c:48 [inline] kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc+0x100/0x130 mm/kasan/common.c:461 slab_post_alloc_hook+0x3e/0x290 mm/slab.h:518 slab_alloc mm/slab.c:3312 [inline] kmem_cache_alloc+0x1d2/0x2d0 mm/slab.c:3482 vm_area_alloc+0x20/0xf0 kernel/fork.c:347 mmap_region+0x8a3/0x1bc0 mm/mmap.c:1743 do_mmap+0xaa8/0x10e0 mm/mmap.c:1545 vm_mmap_pgoff+0x12c/0x1c0 mm/util.c:506 ksys_mmap_pgoff+0x358/0x4c0 mm/mmap.c:1596 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 5130: kasan_save_stack mm/kasan/common.c:48 [inline] kasan_set_track+0x3d/0x70 mm/kasan/common.c:56 kasan_set_free_info+0x17/0x30 mm/kasan/generic.c:355 __kasan_slab_free+0xdd/0x110 mm/kasan/common.c:422 __cache_free mm/slab.c:3418 [inline] kmem_cache_free+0x79/0xf0 mm/slab.c:3693 remove_vma mm/mmap.c:184 [inline] remove_vma_list mm/mmap.c:2613 [inline] __do_munmap+0x1148/0x1530 mm/mmap.c:2869 do_munmap mm/mmap.c:2877 [inline] mmap_region+0x6dc/0x1bc0 mm/mmap.c:1716 do_mmap+0xaa8/0x10e0 mm/mmap.c:1545 vm_mmap_pgoff+0x12c/0x1c0 mm/util.c:506 ksys_mmap_pgoff+0x358/0x4c0 mm/mmap.c:1596 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88808992da90 which belongs to the cache vm_area_struct of size 200 The buggy address is located 0 bytes inside of 200-byte region [ffff88808992da90, ffff88808992db58) The buggy address belongs to the page: page:000000005705f591 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x8992d flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea00027aef88 ffffea0002a5c908 ffff8880aa46f600 raw: 0000000000000000 ffff88808992d040 000000010000000f 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808992d980: fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808992da00: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc >ffff88808992da80: fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808992db00: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc ffff88808992db80: fc fc fc fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================