================================================================== BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:68 [inline] BUG: KASAN: use-after-free in _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline] BUG: KASAN: use-after-free in mapping_inaccessible include/linux/pagemap.h:335 [inline] BUG: KASAN: use-after-free in isolate_migratepages_block+0x3e83/0x5690 mm/compaction.c:1180 Read of size 8 at addr ffff888024c96038 by task kcompactd0/43 CPU: 3 UID: 0 PID: 43 Comm: kcompactd0 Not tainted 6.12.0-syzkaller-09073-g9f16d5e6f220 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xc3/0x620 mm/kasan/report.c:489 kasan_report+0xd9/0x110 mm/kasan/report.c:602 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0xef/0x1a0 mm/kasan/generic.c:189 instrument_atomic_read include/linux/instrumented.h:68 [inline] _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline] mapping_inaccessible include/linux/pagemap.h:335 [inline] isolate_migratepages_block+0x3e83/0x5690 mm/compaction.c:1180 isolate_migratepages mm/compaction.c:2164 [inline] compact_zone+0x1a5c/0x4280 mm/compaction.c:2611 compact_node+0x1a2/0x2d0 mm/compaction.c:2910 kcompactd+0x779/0xdf0 mm/compaction.c:3208 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x24c96 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 ffffea0000932588 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 37, tgid 37 (kdevtmpfs), ts 5561614776, free_ts 261359595515 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3474 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4751 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 alloc_slab_page mm/slub.c:2412 [inline] allocate_slab mm/slub.c:2578 [inline] new_slab+0x2c9/0x410 mm/slub.c:2631 ___slab_alloc+0xdac/0x1880 mm/slub.c:3818 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] kmem_cache_alloc_lru_noprof+0x2a0/0x2f0 mm/slub.c:4153 shmem_alloc_inode+0x25/0x50 mm/shmem.c:4980 alloc_inode+0x5d/0x230 fs/inode.c:336 new_inode_pseudo fs/inode.c:1174 [inline] new_inode+0x22/0x210 fs/inode.c:1193 __shmem_get_inode mm/shmem.c:2874 [inline] shmem_get_inode+0x194/0xf00 mm/shmem.c:2948 shmem_mknod+0x1a8/0x450 mm/shmem.c:3670 vfs_mknod+0x5d7/0x8e0 fs/namei.c:4189 handle_create drivers/base/devtmpfs.c:219 [inline] handle drivers/base/devtmpfs.c:384 [inline] devtmpfs_work_loop+0x1a8/0x7d0 drivers/base/devtmpfs.c:399 devtmpfsd+0x4c/0x50 drivers/base/devtmpfs.c:441 page last free pid 16335 tgid 16335 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2657 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4141 new_handle fs/jbd2/transaction.c:461 [inline] jbd2__journal_start+0x193/0x6a0 fs/jbd2/transaction.c:488 __ext4_journal_start_sb+0x19f/0x660 fs/ext4/ext4_jbd2.c:112 __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline] ext4_dirty_inode+0xa1/0x130 fs/ext4/inode.c:6038 __mark_inode_dirty+0x1f7/0xe60 fs/fs-writeback.c:2515 mark_inode_dirty include/linux/fs.h:2485 [inline] ext4_setattr+0x380/0x2a70 fs/ext4/inode.c:5553 notify_change+0x6a6/0x1230 fs/attr.c:552 chmod_common+0x210/0x460 fs/open.c:640 do_fchmodat fs/open.c:686 [inline] __do_sys_chmod fs/open.c:710 [inline] __se_sys_chmod fs/open.c:708 [inline] __x64_sys_chmod+0x108/0x1c0 fs/open.c:708 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888024c95f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888024c95f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888024c96000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888024c96080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888024c96100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================