================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read include/linux/instrumented.h:68 [inline] BUG: KASAN: slab-use-after-free in _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline] BUG: KASAN: slab-use-after-free in mapping_unevictable include/linux/pagemap.h:260 [inline] BUG: KASAN: slab-use-after-free in folio_evictable mm/internal.h:353 [inline] BUG: KASAN: slab-use-after-free in lru_add_fn+0x2cc/0x1a20 mm/swap.c:184 Read of size 8 at addr ffff8880768aab18 by task udevd/4549 CPU: 0 PID: 4549 Comm: udevd Not tainted 6.9.0-next-20240520-syzkaller-13491-g632483ea8004 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 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 kasan_check_range+0x282/0x290 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_unevictable include/linux/pagemap.h:260 [inline] folio_evictable mm/internal.h:353 [inline] lru_add_fn+0x2cc/0x1a20 mm/swap.c:184 folio_batch_move_lru+0x322/0x690 mm/swap.c:220 lru_add_drain_cpu+0x10e/0x8c0 mm/swap.c:657 lru_add_drain+0x123/0x3e0 mm/swap.c:757 wp_can_reuse_anon_folio mm/memory.c:3550 [inline] do_wp_page+0x2c65/0x5310 mm/memory.c:3662 handle_pte_fault+0x1189/0x70f0 mm/memory.c:5396 __handle_mm_fault mm/memory.c:5523 [inline] handle_mm_fault+0x10df/0x1ba0 mm/memory.c:5688 do_user_addr_fault arch/x86/mm/fault.c:1338 [inline] handle_page_fault arch/x86/mm/fault.c:1481 [inline] exc_page_fault+0x459/0x8c0 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 RIP: 0033:0x7fd5eff4b485 Code: e9 d0 fa ff ff 48 89 52 28 48 89 52 20 89 c8 41 b9 01 00 00 00 48 ff 44 24 18 c1 f8 05 41 d3 e1 48 98 44 09 8c 85 60 08 00 00 <4c> 89 42 18 48 89 72 10 48 89 56 18 49 89 50 10 45 85 db 74 2d 48 RSP: 002b:00007ffc91266e60 EFLAGS: 00010202 RAX: 0000000000000000 RBX: 0000000000000040 RCX: 0000000000000002 RDX: 00005581fe208050 RSI: 00007fd5f0074b10 RDI: 00005581fe1e4010 RBP: 00007fd5f0074aa0 R08: 00007fd5f0074b10 R09: 0000000000000004 R10: 0000000000000012 R11: 0000000000000000 R12: 0000000000000004 R13: 0000000000000002 R14: 00007fd5f0074b00 R15: 0000000000000040 Allocated by task 5522: 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:312 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3940 [inline] slab_alloc_node mm/slub.c:4000 [inline] kmem_cache_alloc_lru_noprof+0x139/0x2b0 mm/slub.c:4019 nilfs_alloc_inode+0x2e/0xf0 fs/nilfs2/super.c:154 alloc_inode fs/inode.c:261 [inline] iget5_locked+0xa4/0x280 fs/inode.c:1235 nilfs_iget_locked+0x12b/0x180 fs/nilfs2/inode.c:606 nilfs_ifile_read+0x30/0x1b0 fs/nilfs2/ifile.c:192 nilfs_attach_checkpoint+0xed/0x1a0 fs/nilfs2/super.c:557 nilfs_fill_super+0x380/0x6a0 fs/nilfs2/super.c:1067 nilfs_get_tree+0x4f9/0x920 fs/nilfs2/super.c:1211 vfs_get_tree+0x90/0x2a0 fs/super.c:1780 do_new_mount+0x2be/0xb40 fs/namespace.c:3352 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5449: 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:579 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2195 [inline] slab_free mm/slub.c:4436 [inline] kmem_cache_free+0x145/0x350 mm/slub.c:4511 rcu_do_batch kernel/rcu/tree.c:2535 [inline] rcu_core+0xafd/0x1830 kernel/rcu/tree.c:2809 handle_softirqs+0x2d6/0x990 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637 irq_exit_rcu+0x9/0x30 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:541 __call_rcu_common kernel/rcu/tree.c:3072 [inline] call_rcu+0x167/0xa70 kernel/rcu/tree.c:3176 nilfs_put_root+0x97/0xc0 fs/nilfs2/the_nilfs.c:925 nilfs_segctor_destroy fs/nilfs2/segment.c:2747 [inline] nilfs_detach_log_writer+0x8bb/0xbe0 fs/nilfs2/segment.c:2810 nilfs_put_super+0x4d/0x160 fs/nilfs2/super.c:498 generic_shutdown_super+0x136/0x2d0 fs/super.c:642 kill_block_super+0x44/0x90 fs/super.c:1676 deactivate_locked_super+0xc4/0x130 fs/super.c:473 cleanup_mnt+0x426/0x4c0 fs/namespace.c:1267 task_work_run+0x24f/0x310 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x168/0x370 kernel/entry/common.c:218 do_syscall_64+0x102/0x240 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff8880768aa670 which belongs to the cache nilfs2_inode_cache of size 1512 The buggy address is located 1192 bytes inside of freed 1512-byte region [ffff8880768aa670, ffff8880768aac58) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x768a8 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888023313801 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000040 ffff88801af6fdc0 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080130013 00000001ffffefff ffff888023313801 head: 00fff00000000040 ffff88801af6fdc0 dead000000000122 0000000000000000 head: 0000000000000000 0000000080130013 00000001ffffefff ffff888023313801 head: 00fff00000000003 ffffea0001da2a01 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Reclaimable, gfp_mask 0x1d2050(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 5522, tgid 5521 (syz-executor.0), ts 88090751432, free_ts 87527298236 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x2ce2/0x2d90 mm/page_alloc.c:3438 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4696 __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:2264 allocate_slab+0x5a/0x2e0 mm/slub.c:2427 new_slab mm/slub.c:2480 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3666 __slab_alloc+0x58/0xa0 mm/slub.c:3756 __slab_alloc_node mm/slub.c:3809 [inline] slab_alloc_node mm/slub.c:3988 [inline] kmem_cache_alloc_lru_noprof+0x1c5/0x2b0 mm/slub.c:4019 nilfs_alloc_inode+0x2e/0xf0 fs/nilfs2/super.c:154 alloc_inode fs/inode.c:261 [inline] iget5_locked+0xa4/0x280 fs/inode.c:1235 nilfs_iget_locked+0x12b/0x180 fs/nilfs2/inode.c:606 nilfs_dat_read+0xc3/0x310 fs/nilfs2/dat.c:508 nilfs_load_super_root fs/nilfs2/the_nilfs.c:120 [inline] load_nilfs+0x56f/0x1090 fs/nilfs2/the_nilfs.c:301 nilfs_fill_super+0x310/0x6a0 fs/nilfs2/super.c:1062 nilfs_get_tree+0x4f9/0x920 fs/nilfs2/super.c:1211 vfs_get_tree+0x90/0x2a0 fs/super.c:1780 page last free pid 5502 tgid 5502 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1088 [inline] free_unref_page+0xd22/0xea0 mm/page_alloc.c:2601 discard_slab mm/slub.c:2526 [inline] __put_partials+0xeb/0x130 mm/slub.c:2994 put_cpu_partial+0x17c/0x250 mm/slub.c:3069 __slab_free+0x2ea/0x3d0 mm/slub.c:4306 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:3940 [inline] slab_alloc_node mm/slub.c:4000 [inline] __do_kmalloc_node mm/slub.c:4120 [inline] __kmalloc_noprof+0x1a9/0x410 mm/slub.c:4134 kmalloc_noprof include/linux/slab.h:664 [inline] tomoyo_realpath_from_path+0xcf/0x5e0 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x2b7/0x740 security/tomoyo/file.c:822 security_inode_getattr+0xd8/0x130 security/security.c:2269 vfs_getattr+0x45/0x430 fs/stat.c:173 vfs_fstat fs/stat.c:198 [inline] vfs_fstatat+0xd6/0x190 fs/stat.c:300 __do_sys_newfstatat fs/stat.c:468 [inline] __se_sys_newfstatat fs/stat.c:462 [inline] __x64_sys_newfstatat+0x125/0x1b0 fs/stat.c:462 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff8880768aaa00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880768aaa80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880768aab00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880768aab80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880768aac00: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc ==================================================================