================================================================== BUG: KASAN: use-after-free in ptep_get include/linux/pgtable.h:317 [inline] BUG: KASAN: use-after-free in ptep_get_lockless include/linux/pgtable.h:581 [inline] BUG: KASAN: use-after-free in pte_range_none mm/memory.c:4409 [inline] BUG: KASAN: use-after-free in finish_fault+0xf87/0x1460 mm/memory.c:4905 Read of size 8 at addr ffff88805420f000 by task syz-executor.3/17288 CPU: 0 PID: 17288 Comm: syz-executor.3 Not tainted 6.10.0-rc2-next-20240607-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:91 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:117 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 ptep_get include/linux/pgtable.h:317 [inline] ptep_get_lockless include/linux/pgtable.h:581 [inline] pte_range_none mm/memory.c:4409 [inline] finish_fault+0xf87/0x1460 mm/memory.c:4905 do_read_fault mm/memory.c:5052 [inline] do_fault mm/memory.c:5178 [inline] do_pte_missing mm/memory.c:3948 [inline] handle_pte_fault+0x3db5/0x7130 mm/memory.c:5502 __handle_mm_fault mm/memory.c:5645 [inline] handle_mm_fault+0x10df/0x1ba0 mm/memory.c:5810 faultin_page mm/gup.c:1339 [inline] __get_user_pages+0x6ef/0x1590 mm/gup.c:1638 populate_vma_page_range+0x264/0x330 mm/gup.c:2078 __mm_populate+0x27a/0x460 mm/gup.c:2181 mm_populate include/linux/mm.h:3442 [inline] __do_sys_remap_file_pages mm/mmap.c:3177 [inline] __se_sys_remap_file_pages+0x7a1/0x9a0 mm/mmap.c:3103 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f21d6e7cf69 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 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 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f21d7c830c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000d8 RAX: ffffffffffffffda RBX: 00007f21d6fb4120 RCX: 00007f21d6e7cf69 RDX: 0000000000000000 RSI: 0000000000200000 RDI: 00000000202ec000 RBP: 00007f21d6eda6fe R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f21d6fb4120 R15: 00007ffc04273ee8 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xcf4 pfn:0x5420f flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0001532208 ffff8880b94448a0 0000000000000000 raw: 0000000000000cf4 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 17232, tgid 17231 (syz-executor.1), ts 1105915858577, free_ts 1106166014748 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1470 prep_new_page mm/page_alloc.c:1478 [inline] get_page_from_freelist+0x2cbd/0x2d70 mm/page_alloc.c:3457 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4715 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2263 vm_area_alloc_pages mm/vmalloc.c:3567 [inline] __vmalloc_area_node mm/vmalloc.c:3643 [inline] __vmalloc_node_range_noprof+0x971/0x1460 mm/vmalloc.c:3824 vmalloc_user_noprof+0x74/0x80 mm/vmalloc.c:3978 vb2_vmalloc_alloc+0xf2/0x340 drivers/media/common/videobuf2/videobuf2-vmalloc.c:47 __vb2_buf_mem_alloc drivers/media/common/videobuf2/videobuf2-core.c:243 [inline] __vb2_queue_alloc+0xa0f/0x16f0 drivers/media/common/videobuf2/videobuf2-core.c:510 vb2_core_reqbufs+0xd2e/0x17c0 drivers/media/common/videobuf2/videobuf2-core.c:951 vb2_ioctl_reqbufs+0x4e6/0x830 drivers/media/common/videobuf2/videobuf2-v4l2.c:1036 __video_do_ioctl+0xc26/0xde0 drivers/media/v4l2-core/v4l2-ioctl.c:3105 video_usercopy+0x89b/0x1180 drivers/media/v4l2-core/v4l2-ioctl.c:3446 v4l2_ioctl+0x18c/0x1e0 drivers/media/v4l2-core/v4l2-dev.c:364 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 17231 tgid 17231 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1089 [inline] free_unref_page+0xd22/0xea0 mm/page_alloc.c:2621 vfree+0x186/0x2e0 mm/vmalloc.c:3347 vb2_vmalloc_put+0x68/0xb0 drivers/media/common/videobuf2/videobuf2-vmalloc.c:68 __vb2_buf_mem_free+0xfa/0x2a0 drivers/media/common/videobuf2/videobuf2-core.c:276 __vb2_free_mem drivers/media/common/videobuf2/videobuf2-core.c:558 [inline] __vb2_queue_free+0x450/0xed0 drivers/media/common/videobuf2/videobuf2-core.c:586 vb2_core_queue_release+0x6c/0x150 drivers/media/common/videobuf2/videobuf2-core.c:2655 vb2_queue_release drivers/media/common/videobuf2/videobuf2-v4l2.c:957 [inline] _vb2_fop_release drivers/media/common/videobuf2/videobuf2-v4l2.c:1159 [inline] vb2_fop_release+0x171/0x200 drivers/media/common/videobuf2/videobuf2-v4l2.c:1173 v4l2_release+0x28a/0x3b0 drivers/media/v4l2-core/v4l2-dev.c:459 __fput+0x406/0x8b0 fs/file_table.c:422 __do_sys_close fs/open.c:1559 [inline] __se_sys_close fs/open.c:1544 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1544 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88805420ef00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88805420ef80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88805420f000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88805420f080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805420f100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================