================================================================== BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:72 [inline] BUG: KASAN: use-after-free in atomic_long_read include/linux/atomic/atomic-instrumented.h:1265 [inline] BUG: KASAN: use-after-free in is_rwsem_reader_owned kernel/locking/rwsem.c:193 [inline] BUG: KASAN: use-after-free in __down_read_common kernel/locking/rwsem.c:1262 [inline] BUG: KASAN: use-after-free in __down_read_common kernel/locking/rwsem.c:1255 [inline] BUG: KASAN: use-after-free in __down_read kernel/locking/rwsem.c:1269 [inline] BUG: KASAN: use-after-free in down_read+0x1d7/0x450 kernel/locking/rwsem.c:1511 Read of size 8 at addr ffff88806cfc3f08 by task syz-executor.3/5754 CPU: 0 PID: 5754 Comm: syz-executor.3 Not tainted 6.1.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15e/0x45d mm/kasan/report.c:395 kasan_report+0xbf/0x1f0 mm/kasan/report.c:495 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x141/0x190 mm/kasan/generic.c:189 instrument_atomic_read include/linux/instrumented.h:72 [inline] atomic_long_read include/linux/atomic/atomic-instrumented.h:1265 [inline] is_rwsem_reader_owned kernel/locking/rwsem.c:193 [inline] __down_read_common kernel/locking/rwsem.c:1262 [inline] __down_read_common kernel/locking/rwsem.c:1255 [inline] __down_read kernel/locking/rwsem.c:1269 [inline] down_read+0x1d7/0x450 kernel/locking/rwsem.c:1511 hugetlb_vma_lock_read mm/hugetlb.c:6822 [inline] hugetlb_fault+0x40e/0x2060 mm/hugetlb.c:5861 follow_hugetlb_page+0x3f7/0x1860 mm/hugetlb.c:6307 __get_user_pages+0x2cb/0xf10 mm/gup.c:1202 populate_vma_page_range+0x241/0x320 mm/gup.c:1587 __mm_populate+0x105/0x3b0 mm/gup.c:1701 mm_populate include/linux/mm.h:2744 [inline] vm_mmap_pgoff+0x201/0x280 mm/util.c:525 ksys_mmap_pgoff+0x1c7/0x5a0 mm/mmap.c:1458 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f37b448c0d9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f37b5143168 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00007f37b45abf80 RCX: 00007f37b448c0d9 RDX: 0000000000000003 RSI: 0000000000b36000 RDI: 0000000020000000 RBP: 00007f37b44e7ae9 R08: ffffffffffffffff R09: 0000000000000000 R10: 0000000000068831 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffff2d05dff R14: 00007f37b5143300 R15: 0000000000022000 Allocated by task 5754: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] ____kasan_kmalloc mm/kasan/common.c:330 [inline] __kasan_kmalloc+0xa5/0xb0 mm/kasan/common.c:380 kmalloc include/linux/slab.h:553 [inline] hugetlb_vma_lock_alloc.part.0+0x3f/0x130 mm/hugetlb.c:6932 hugetlb_vma_lock_alloc mm/hugetlb.c:6688 [inline] hugetlb_reserve_pages+0xa8f/0xee0 mm/hugetlb.c:6557 hugetlbfs_file_mmap+0x410/0x5c0 fs/hugetlbfs/inode.c:167 call_mmap include/linux/fs.h:2204 [inline] mmap_region+0x6c3/0x1dd0 mm/mmap.c:2625 do_mmap+0x831/0xf60 mm/mmap.c:1412 vm_mmap_pgoff+0x1af/0x280 mm/util.c:520 ksys_mmap_pgoff+0x1c7/0x5a0 mm/mmap.c:1458 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 5761: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x40 mm/kasan/generic.c:511 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1750 slab_free mm/slub.c:3661 [inline] __kmem_cache_free+0xaf/0x3b0 mm/slub.c:3674 hugetlb_vma_lock_release mm/hugetlb.c:6877 [inline] kref_put include/linux/kref.h:65 [inline] __hugetlb_vma_unlock_write_put mm/hugetlb.c:6892 [inline] __hugetlb_vma_unlock_write_free mm/hugetlb.c:6900 [inline] __unmap_hugepage_range_final+0x2b1/0x350 mm/hugetlb.c:5217 unmap_single_vma+0x23d/0x2a0 mm/memory.c:1690 zap_page_range+0x392/0x530 mm/memory.c:1762 madvise_dontneed_single_vma mm/madvise.c:793 [inline] madvise_dontneed_free mm/madvise.c:886 [inline] madvise_vma_behavior+0x12df/0x2050 mm/madvise.c:1025 madvise_walk_vmas+0x1c7/0x2b0 mm/madvise.c:1250 do_madvise.part.0+0x24a/0x340 mm/madvise.c:1429 do_madvise mm/madvise.c:1442 [inline] __do_sys_madvise mm/madvise.c:1442 [inline] __se_sys_madvise mm/madvise.c:1440 [inline] __x64_sys_madvise+0x117/0x150 mm/madvise.c:1440 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff88806cfc3f00 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 8 bytes inside of 192-byte region [ffff88806cfc3f00, ffff88806cfc3fc0) The buggy address belongs to the physical page: page:ffffea0001b3f0c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6cfc3 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea00008aaf80 dead000000000003 ffff888012041a00 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 3646, tgid 3646 (syz-executor.3), ts 163748660623, free_ts 163740707226 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4291 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5558 __alloc_pages_node include/linux/gfp.h:223 [inline] alloc_slab_page mm/slub.c:1796 [inline] allocate_slab+0x80/0x300 mm/slub.c:1939 new_slab mm/slub.c:1992 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3180 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3279 slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x199/0x3e0 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:954 [inline] __kmalloc_node+0x4d/0xd0 mm/slab_common.c:962 kmalloc_array_node include/linux/slab.h:666 [inline] kcalloc_node include/linux/slab.h:671 [inline] memcg_alloc_slab_cgroups+0x8f/0x150 mm/memcontrol.c:2885 account_slab mm/slab.h:635 [inline] allocate_slab+0x270/0x300 mm/slub.c:1957 new_slab mm/slub.c:1992 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3180 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3279 slab_alloc_node mm/slub.c:3364 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x31a/0x3d0 mm/slub.c:3422 vm_area_dup+0x85/0x380 kernel/fork.c:466 dup_mmap+0x655/0x10b0 kernel/fork.c:640 dup_mm+0x91/0x370 kernel/fork.c:1526 copy_mm kernel/fork.c:1575 [inline] copy_process+0x3bc6/0x7190 kernel/fork.c:2253 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] free_pcp_prepare+0x65c/0xd90 mm/page_alloc.c:1509 free_unref_page_prepare mm/page_alloc.c:3387 [inline] free_unref_page_list+0x176/0xc40 mm/page_alloc.c:3529 release_pages+0xc8a/0x1360 mm/swap.c:1055 tlb_batch_pages_flush+0xa8/0x1a0 mm/mmu_gather.c:59 tlb_flush_mmu_free mm/mmu_gather.c:256 [inline] tlb_flush_mmu mm/mmu_gather.c:263 [inline] tlb_finish_mmu+0x14b/0x7e0 mm/mmu_gather.c:363 exit_mmap+0x202/0x7b0 mm/mmap.c:3105 __mmput+0x128/0x4c0 kernel/fork.c:1185 mmput+0x60/0x70 kernel/fork.c:1207 exit_mm kernel/exit.c:516 [inline] do_exit+0xa41/0x2a30 kernel/exit.c:807 do_group_exit+0xd4/0x2a0 kernel/exit.c:950 get_signal+0x21b1/0x2440 kernel/signal.c:2858 arch_do_signal_or_restart+0x86/0x2300 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:296 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88806cfc3e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88806cfc3e80: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88806cfc3f00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88806cfc3f80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88806cfc4000: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc ==================================================================