================================================================== 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 ffff88807c777000 by task syz-executor.2/5506 CPU: 0 PID: 5506 Comm: syz-executor.2 Not tainted 6.10.0-rc3-next-20240611-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/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:0x7f8a37e7cea9 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:00007f8a379de0c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000d8 RAX: ffffffffffffffda RBX: 00007f8a37fb41f0 RCX: 00007f8a37e7cea9 RDX: 0000000000000000 RSI: 0000000000200000 RDI: 00000000202ec000 RBP: 00007f8a37eebff4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007f8a37fb41f0 R15: 00007ffd58d43768 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7c777 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0001f39008 ffff8880b94448a0 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5162, tgid 5162 (kworker/1:7), ts 77009351723, free_ts 90264207357 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_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2283 allocate_slab+0x5a/0x2f0 mm/slub.c:2446 new_slab mm/slub.c:2499 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3685 __slab_alloc+0x58/0xa0 mm/slub.c:3775 __slab_alloc_node mm/slub.c:3828 [inline] slab_alloc_node mm/slub.c:4007 [inline] __do_kmalloc_node mm/slub.c:4139 [inline] kmalloc_node_track_caller_noprof+0x281/0x440 mm/slub.c:4160 kmalloc_reserve+0x111/0x2a0 net/core/skbuff.c:597 __alloc_skb+0x1f3/0x440 net/core/skbuff.c:666 alloc_skb include/linux/skbuff.h:1314 [inline] nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:748 [inline] nsim_dev_trap_report drivers/net/netdevsim/dev.c:805 [inline] nsim_dev_trap_report_work+0x254/0xaa0 drivers/net/netdevsim/dev.c:850 process_one_work kernel/workqueue.c:3248 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3329 worker_thread+0x86d/0xd50 kernel/workqueue.c:3409 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:144 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 page last free pid 5508 tgid 5502 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 discard_slab mm/slub.c:2545 [inline] __put_partials+0xeb/0x130 mm/slub.c:3013 put_cpu_partial+0x17c/0x250 mm/slub.c:3088 __slab_free+0x2ea/0x3d0 mm/slub.c:4325 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3959 [inline] slab_alloc_node mm/slub.c:4019 [inline] __do_kmalloc_node mm/slub.c:4139 [inline] __kmalloc_noprof+0x1a3/0x400 mm/slub.c:4153 kmalloc_noprof include/linux/slab.h:664 [inline] sock_kmalloc+0xd7/0x160 net/core/sock.c:2716 af_alg_alloc_tsgl crypto/af_alg.c:617 [inline] af_alg_sendmsg+0x1140/0x2650 crypto/af_alg.c:1031 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:745 sock_sendmsg+0x134/0x200 net/socket.c:768 splice_to_socket+0xa13/0x10b0 fs/splice.c:889 do_splice_from fs/splice.c:941 [inline] direct_splice_actor+0x11e/0x220 fs/splice.c:1164 splice_direct_to_actor+0x58e/0xc90 fs/splice.c:1108 do_splice_direct_actor fs/splice.c:1207 [inline] do_splice_direct+0x28c/0x3e0 fs/splice.c:1233 Memory state around the buggy address: ffff88807c776f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88807c776f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88807c777000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88807c777080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88807c777100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================