================================================================== BUG: KASAN: slab-out-of-bounds in instrument_atomic_read include/linux/instrumented.h:68 [inline] BUG: KASAN: slab-out-of-bounds in atomic_read include/linux/atomic/atomic-instrumented.h:32 [inline] BUG: KASAN: slab-out-of-bounds in page_ref_count include/linux/page_ref.h:67 [inline] BUG: KASAN: slab-out-of-bounds in page_ref_add_unless include/linux/page_ref.h:237 [inline] BUG: KASAN: slab-out-of-bounds in folio_ref_add_unless include/linux/page_ref.h:248 [inline] BUG: KASAN: slab-out-of-bounds in folio_try_get+0xde/0x350 include/linux/page_ref.h:264 Read of size 4 at addr ffff88804af21e0c by task syz.3.324/7139 CPU: 0 UID: 0 PID: 7139 Comm: syz.3.324 Not tainted 6.14.0-rc5-syzkaller-g48a5eed9ad58 #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+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0x16e/0x5b0 mm/kasan/report.c:521 kasan_report+0x143/0x180 mm/kasan/report.c:634 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189 instrument_atomic_read include/linux/instrumented.h:68 [inline] atomic_read include/linux/atomic/atomic-instrumented.h:32 [inline] page_ref_count include/linux/page_ref.h:67 [inline] page_ref_add_unless include/linux/page_ref.h:237 [inline] folio_ref_add_unless include/linux/page_ref.h:248 [inline] folio_try_get+0xde/0x350 include/linux/page_ref.h:264 find_get_entry mm/filemap.c:2029 [inline] find_lock_entries+0x2bf/0xbb0 mm/filemap.c:2119 shmem_undo_range+0x2d4/0x1820 mm/shmem.c:1094 shmem_truncate_range mm/shmem.c:1224 [inline] shmem_evict_inode+0x29b/0xa80 mm/shmem.c:1352 evict+0x4e8/0x9a0 fs/inode.c:796 __dentry_kill+0x20d/0x630 fs/dcache.c:643 dput+0x19f/0x2b0 fs/dcache.c:885 __fput+0x60b/0x9f0 fs/file_table.c:472 __do_sys_close fs/open.c:1580 [inline] __se_sys_close fs/open.c:1565 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1565 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:0x7fbdc5b8ba4a Code: 48 3d 00 f0 ff ff 77 48 c3 0f 1f 80 00 00 00 00 48 83 ec 18 89 7c 24 0c e8 43 91 02 00 8b 7c 24 0c 89 c2 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 36 89 d7 89 44 24 0c e8 a3 91 02 00 8b 44 24 RSP: 002b:00007fbdc6913e00 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: ffffffffffffffda RBX: 00000000ffffffff RCX: 00007fbdc5b8ba4a RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 0000000000000002 R08: 0000000000000000 R09: 000000000000590c R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000003 R13: 00007fbdc6913ef0 R14: 00007fbdc6913eb0 R15: 00007fbdbc800000 Allocated by task 7112: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4115 [inline] slab_alloc_node mm/slub.c:4164 [inline] kmem_cache_alloc_lru_noprof+0x1dd/0x390 mm/slub.c:4183 xas_alloc lib/xarray.c:377 [inline] xas_create+0x10d0/0x1ae0 lib/xarray.c:684 xas_store+0x96/0x1870 lib/xarray.c:794 shmem_add_to_page_cache+0x89d/0xcc0 mm/shmem.c:897 shmem_alloc_and_add_folio+0x968/0x1090 mm/shmem.c:1928 shmem_get_folio_gfp+0x621/0x1840 mm/shmem.c:2522 shmem_get_folio mm/shmem.c:2628 [inline] shmem_write_begin+0x165/0x350 mm/shmem.c:3278 generic_perform_write+0x346/0x990 mm/filemap.c:4189 shmem_file_write_iter+0xf9/0x120 mm/shmem.c:3454 new_sync_write fs/read_write.c:586 [inline] vfs_write+0xacf/0xd10 fs/read_write.c:679 ksys_write+0x18f/0x2b0 fs/read_write.c:731 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 Freed by task 16: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4609 [inline] kmem_cache_free+0x195/0x410 mm/slub.c:4711 rcu_do_batch kernel/rcu/tree.c:2546 [inline] rcu_core+0xaaa/0x17a0 kernel/rcu/tree.c:2802 handle_softirqs+0x2d4/0x9b0 kernel/softirq.c:561 run_ksoftirqd+0xca/0x130 kernel/softirq.c:950 smpboot_thread_fn+0x544/0xa30 kernel/smpboot.c:164 kthread+0x7a9/0x920 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 kasan_record_aux_stack+0xaa/0xc0 mm/kasan/generic.c:548 __call_rcu_common kernel/rcu/tree.c:3065 [inline] call_rcu+0x168/0xac0 kernel/rcu/tree.c:3172 xa_node_free lib/xarray.c:260 [inline] xas_delete_node lib/xarray.c:502 [inline] update_node lib/xarray.c:766 [inline] xas_store+0xd27/0x1870 lib/xarray.c:851 page_cache_delete mm/filemap.c:141 [inline] __filemap_remove_folio+0x4e9/0x670 mm/filemap.c:224 filemap_remove_folio+0xe1/0x1f0 mm/filemap.c:256 truncate_inode_folio+0x5d/0x70 mm/truncate.c:162 shmem_undo_range+0x44b/0x1820 mm/shmem.c:1108 shmem_truncate_range mm/shmem.c:1224 [inline] shmem_evict_inode+0x29b/0xa80 mm/shmem.c:1352 evict+0x4e8/0x9a0 fs/inode.c:796 __dentry_kill+0x20d/0x630 fs/dcache.c:643 dput+0x19f/0x2b0 fs/dcache.c:885 __fput+0x60b/0x9f0 fs/file_table.c:472 __do_sys_close fs/open.c:1580 [inline] __se_sys_close fs/open.c:1565 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1565 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 The buggy address belongs to the object at ffff88804af21b80 which belongs to the cache radix_tree_node of size 576 The buggy address is located 76 bytes to the right of allocated 576-byte region [ffff88804af21b80, ffff88804af21dc0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88804af21080 pfn:0x4af20 head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88804421bc01 flags: 0x4fff00000000240(workingset|head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000240 ffff88801b04fdc0 ffffea0000fd3190 ffffea00010bc490 raw: ffff88804af21080 00000000000b0009 00000000f5000000 ffff88804421bc01 head: 04fff00000000240 ffff88801b04fdc0 ffffea0000fd3190 ffffea00010bc490 head: ffff88804af21080 00000000000b0009 00000000f5000000 ffff88804421bc01 head: 04fff00000000001 ffffea00012bc801 ffffffffffffffff 0000000000000000 head: 0000000700000002 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Reclaimable, gfp_mask 0x52810(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_RECLAIMABLE), pid 6325, tgid 6324 (syz.0.83), ts 202062000963, free_ts 200155322331 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x292/0x710 mm/page_alloc.c:4739 alloc_pages_mpol+0x311/0x660 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab+0x8f/0x3a0 mm/slub.c:2587 new_slab mm/slub.c:2640 [inline] ___slab_alloc+0xc27/0x14a0 mm/slub.c:3826 __slab_alloc+0x58/0xa0 mm/slub.c:3916 __slab_alloc_node mm/slub.c:3991 [inline] slab_alloc_node mm/slub.c:4152 [inline] kmem_cache_alloc_lru_noprof+0x26c/0x390 mm/slub.c:4183 xas_alloc lib/xarray.c:377 [inline] xas_create+0x10d0/0x1ae0 lib/xarray.c:684 xas_store+0x96/0x1870 lib/xarray.c:794 shmem_add_to_page_cache+0x89d/0xcc0 mm/shmem.c:897 shmem_alloc_and_add_folio+0x968/0x1090 mm/shmem.c:1928 shmem_get_folio_gfp+0x621/0x1840 mm/shmem.c:2522 shmem_get_folio mm/shmem.c:2628 [inline] shmem_write_begin+0x165/0x350 mm/shmem.c:3278 generic_perform_write+0x346/0x990 mm/filemap.c:4189 shmem_file_write_iter+0xf9/0x120 mm/shmem.c:3454 page last free pid 81 tgid 81 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_frozen_pages+0xe0d/0x10e0 mm/page_alloc.c:2660 __slab_free+0x2c2/0x380 mm/slub.c:4520 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9a/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:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4115 [inline] slab_alloc_node mm/slub.c:4164 [inline] kmem_cache_alloc_node_noprof+0x1d9/0x380 mm/slub.c:4216 zswap_entry_cache_alloc mm/zswap.c:788 [inline] zswap_store_page mm/zswap.c:1456 [inline] zswap_store+0xa08/0x1c20 mm/zswap.c:1571 swap_writepage+0x647/0xce0 mm/page_io.c:278 pageout mm/vmscan.c:696 [inline] shrink_folio_list+0x35c2/0x5ac0 mm/vmscan.c:1402 evict_folios+0x45fd/0x56a0 mm/vmscan.c:4660 try_to_shrink_lruvec+0x713/0x9b0 mm/vmscan.c:4821 shrink_one+0x3b9/0x850 mm/vmscan.c:4866 shrink_many mm/vmscan.c:4929 [inline] lru_gen_shrink_node mm/vmscan.c:5007 [inline] shrink_node+0x379b/0x3e20 mm/vmscan.c:5978 kswapd_shrink_node mm/vmscan.c:6807 [inline] balance_pgdat mm/vmscan.c:6999 [inline] kswapd+0x20f3/0x3b10 mm/vmscan.c:7264 kthread+0x7a9/0x920 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 Memory state around the buggy address: ffff88804af21d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804af21d80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88804af21e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88804af21e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88804af21f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================