================================================================== BUG: KASAN: use-after-free in userfaultfd_release+0x56d/0x6e0 fs/userfaultfd.c:879 Read of size 8 at addr ffff8880a6af7f88 by task syz-executor.2/8433 CPU: 1 PID: 8433 Comm: syz-executor.2 Not tainted 5.7.0-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+0x128/0x182 lib/dump_stack.c:118 print_address_description.constprop.8.cold.10+0x9/0x41e mm/kasan/report.c:382 __kasan_report.cold.11+0x20/0x38 mm/kasan/report.c:511 kasan_report+0x32/0x50 mm/kasan/common.c:625 userfaultfd_release+0x56d/0x6e0 fs/userfaultfd.c:879 __fput+0x2a4/0x7a0 fs/file_table.c:280 task_work_run+0xc2/0x160 kernel/task_work.c:123 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x23d/0x2d0 arch/x86/entry/common.c:165 prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline] syscall_return_slowpath arch/x86/entry/common.c:279 [inline] do_syscall_64+0x52a/0x620 arch/x86/entry/common.c:305 entry_SYSCALL_64_after_hwframe+0x49/0xb3 RIP: 0033:0x45cba9 Code: 8d 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 5b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fd64969fc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000143 RAX: ffffffffffffffe8 RBX: 000000000050c520 RCX: 000000000045cba9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 000000000078bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000cab R14: 00000000004cf0b7 R15: 00007fd6496a06d4 Allocated by task 8433: save_stack+0x19/0x40 mm/kasan/common.c:49 set_track mm/kasan/common.c:57 [inline] __kasan_kmalloc.constprop.17+0xc1/0xd0 mm/kasan/common.c:495 slab_post_alloc_hook mm/slab.h:586 [inline] slab_alloc mm/slab.c:3320 [inline] kmem_cache_alloc+0x11b/0x750 mm/slab.c:3484 __do_sys_userfaultfd fs/userfaultfd.c:2026 [inline] __se_sys_userfaultfd fs/userfaultfd.c:2008 [inline] __x64_sys_userfaultfd+0x90/0x430 fs/userfaultfd.c:2008 do_syscall_64+0xc6/0x620 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 Freed by task 8433: save_stack+0x19/0x40 mm/kasan/common.c:49 set_track mm/kasan/common.c:57 [inline] kasan_set_free_info mm/kasan/common.c:317 [inline] __kasan_slab_free+0xf7/0x140 mm/kasan/common.c:456 __cache_free mm/slab.c:3426 [inline] kmem_cache_free+0x7f/0x320 mm/slab.c:3694 __do_sys_userfaultfd fs/userfaultfd.c:2061 [inline] __se_sys_userfaultfd fs/userfaultfd.c:2008 [inline] __x64_sys_userfaultfd+0x36e/0x430 fs/userfaultfd.c:2008 do_syscall_64+0xc6/0x620 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 The buggy address belongs to the object at ffff8880a6af7e00 which belongs to the cache userfaultfd_ctx_cache of size 408 The buggy address is located 392 bytes inside of 408-byte region [ffff8880a6af7e00, ffff8880a6af7f98) The buggy address belongs to the page: page:ffffea00029abdc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880a7c37b00 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffff8880a49d1950 ffff8880a49d1950 ffff88821978d700 raw: ffff8880a7c37b00 ffff8880a6af7000 0000000100000008 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a6af7e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a6af7f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a6af7f80: fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880a6af8000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880a6af8080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================