QAT: Invalid ioctl QAT: Invalid ioctl ================================================================== BUG: KASAN: use-after-free in handle_userfault+0x22c4/0x2500 fs/userfaultfd.c:374 Read of size 8 at addr ffff8801d934dda0 by task syz-executor3/4485 CPU: 0 PID: 4485 Comm: syz-executor3 Not tainted 4.15.0-rc4-mm1+ #49 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:53 print_address_description+0x73/0x250 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:355 [inline] kasan_report+0x23b/0x360 mm/kasan/report.c:413 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:434 handle_userfault+0x22c4/0x2500 fs/userfaultfd.c:374 do_huge_pmd_anonymous_page+0xe29/0x1b00 mm/huge_memory.c:707 create_huge_pmd mm/memory.c:3838 [inline] __handle_mm_fault+0x1a0c/0x3ce0 mm/memory.c:4042 handle_mm_fault+0x38f/0x930 mm/memory.c:4108 __do_page_fault+0x5c9/0xc90 arch/x86/mm/fault.c:1429 do_page_fault+0xee/0x720 arch/x86/mm/fault.c:1504 page_fault+0x4c/0x60 arch/x86/entry/entry_64.S:1243 RIP: 0033:0x452ad5 RSP: 002b:0000000020687000 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 000000000071bea0 RCX: 0000000000452ac9 RDX: 0000000020b4c000 RSI: 0000000020687000 RDI: 0000000000000600 RBP: 0000000000000047 R08: 00000000207a4f71 R09: 0000000000000000 R10: 0000000020552ffc R11: 0000000000000212 R12: 00000000006ed748 R13: 00000000ffffffff R14: 00007f2999a1b6d4 R15: 0000000000000000 Allocated by task 4480: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:489 kmem_cache_alloc+0x12e/0x760 mm/slab.c:3541 dup_userfaultfd+0x21c/0x890 fs/userfaultfd.c:662 dup_mmap kernel/fork.c:460 [inline] dup_mm kernel/fork.c:1244 [inline] copy_mm+0xa38/0x131f kernel/fork.c:1298 copy_process.part.37+0x1f56/0x4b60 kernel/fork.c:1806 copy_process kernel/fork.c:1619 [inline] _do_fork+0x1f7/0xf70 kernel/fork.c:2100 SYSC_clone kernel/fork.c:2208 [inline] SyS_clone+0x37/0x50 kernel/fork.c:2202 do_syscall_64+0x26c/0x920 arch/x86/entry/common.c:285 return_from_SYSCALL_64+0x0/0x75 Freed by task 4480: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3485 [inline] kmem_cache_free+0x83/0x2a0 mm/slab.c:3743 userfaultfd_ctx_put+0x501/0x720 fs/userfaultfd.c:165 userfaultfd_event_wait_completion+0x86d/0xae0 fs/userfaultfd.c:608 dup_fctx fs/userfaultfd.c:696 [inline] dup_userfaultfd_complete+0x2de/0x480 fs/userfaultfd.c:704 dup_mmap kernel/fork.c:528 [inline] dup_mm kernel/fork.c:1244 [inline] copy_mm+0xeaa/0x131f kernel/fork.c:1298 copy_process.part.37+0x1f56/0x4b60 kernel/fork.c:1806 copy_process kernel/fork.c:1619 [inline] _do_fork+0x1f7/0xf70 kernel/fork.c:2100 SYSC_clone kernel/fork.c:2208 [inline] SyS_clone+0x37/0x50 kernel/fork.c:2202 do_syscall_64+0x26c/0x920 arch/x86/entry/common.c:285 return_from_SYSCALL_64+0x0/0x75 The buggy address belongs to the object at ffff8801d934dc40 which belongs to the cache userfaultfd_ctx_cache of size 360 The buggy address is located 352 bytes inside of 360-byte region [ffff8801d934dc40, ffff8801d934dda8) The buggy address belongs to the page: page:ffffea000764d340 count:1 mapcount:0 mapping:ffff8801d934d000 index:0xffff8801d934dff7 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801d934d000 ffff8801d934dff7 0000000100000009 raw: ffffea00074b5ee0 ffff8801d6768348 ffff8801d676aac0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801d934dc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d934dd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801d934dd80: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc ^ ffff8801d934de00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d934de80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================