================================================================== BUG: KASAN: use-after-free in ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1544 Read of size 1 at addr ffff88812a3ed900 by task syz-executor/293 CPU: 0 PID: 293 Comm: syz-executor Not tainted 5.15.167-syzkaller-android13-5.15.167_r00 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1c0 lib/dump_stack.c:106 print_address_description+0x87/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:444 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306 ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1544 ext4_find_inline_entry+0x4b6/0x5e0 fs/ext4/inline.c:1718 __ext4_find_entry+0x2b0/0x1af0 fs/ext4/namei.c:1617 ext4_find_entry+0x24f/0x3a0 fs/ext4/namei.c:1751 ext4_rmdir+0x1b8/0xa80 fs/ext4/namei.c:3207 vfs_rmdir+0x324/0x470 fs/namei.c:4149 incfs_kill_sb+0x113/0x230 fs/incfs/vfs.c:1989 deactivate_locked_super+0xad/0x110 fs/super.c:335 deactivate_super+0xbe/0xf0 fs/super.c:366 cleanup_mnt+0x45c/0x510 fs/namespace.c:1143 __cleanup_mnt+0x19/0x20 fs/namespace.c:1150 task_work_run+0x129/0x190 kernel/task_work.c:188 exit_task_work include/linux/task_work.h:33 [inline] do_exit+0xc48/0x2ca0 kernel/exit.c:880 do_group_exit+0x141/0x310 kernel/exit.c:1002 __do_sys_exit_group kernel/exit.c:1013 [inline] __se_sys_exit_group kernel/exit.c:1011 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1011 x64_sys_call+0x610/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7ff18db4e719 Code: Unable to access opcode bytes at RIP 0x7ff18db4e6ef. RSP: 002b:00007ffee2a9f878 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 00007ff18dbc1261 RCX: 00007ff18db4e719 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001 RBP: 0000000000000075 R08: 00007ffee2a9d615 R09: 00007ffee2aa0b30 R10: 000000000000000b R11: 0000000000000246 R12: 00007ffee2aa0b30 R13: 00007ff18dbc123c R14: 0000000000028471 R15: 00007ffee2aa1bf0 Allocated by task 1882: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:433 [inline] __kasan_slab_alloc+0xb1/0xe0 mm/kasan/common.c:466 kasan_slab_alloc include/linux/kasan.h:217 [inline] slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:550 slab_alloc_node mm/slub.c:3240 [inline] slab_alloc mm/slub.c:3248 [inline] kmem_cache_alloc+0xf5/0x200 mm/slub.c:3253 fsnotify_attach_connector_to_object fs/notify/mark.c:531 [inline] fsnotify_add_mark_list fs/notify/mark.c:621 [inline] fsnotify_add_mark_locked+0x3cc/0x1670 fs/notify/mark.c:715 fsnotify_add_inode_mark_locked include/linux/fsnotify_backend.h:550 [inline] inotify_new_watch fs/notify/inotify/inotify_user.c:601 [inline] inotify_update_watch fs/notify/inotify/inotify_user.c:628 [inline] __do_sys_inotify_add_watch fs/notify/inotify/inotify_user.c:785 [inline] __se_sys_inotify_add_watch+0x901/0xc20 fs/notify/inotify/inotify_user.c:709 __x64_sys_inotify_add_watch+0x7b/0x90 fs/notify/inotify/inotify_user.c:709 x64_sys_call+0x6aa/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:255 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff88812a3ed900 which belongs to the cache fsnotify_mark_connector of size 32 The buggy address is located 0 bytes inside of 32-byte region [ffff88812a3ed900, ffff88812a3ed920) The buggy address belongs to the page: page:ffffea0004a8fb40 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88812a3ed000 pfn:0x12a3ed flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 ffffea0004311fc0 0000000200000002 ffff8881001cd500 raw: ffff88812a3ed000 0000000080550004 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 343, ts 33492353643, free_ts 26483606599 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1b/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4485 __alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5779 allocate_slab mm/slub.c:1932 [inline] new_slab+0x9a/0x4e0 mm/slub.c:1995 ___slab_alloc+0x39e/0x830 mm/slub.c:3028 __slab_alloc+0x4a/0x90 mm/slub.c:3115 slab_alloc_node mm/slub.c:3206 [inline] slab_alloc mm/slub.c:3248 [inline] kmem_cache_alloc+0x134/0x200 mm/slub.c:3253 fsnotify_attach_connector_to_object fs/notify/mark.c:531 [inline] fsnotify_add_mark_list fs/notify/mark.c:621 [inline] fsnotify_add_mark_locked+0x3cc/0x1670 fs/notify/mark.c:715 fsnotify_add_inode_mark_locked include/linux/fsnotify_backend.h:550 [inline] inotify_new_watch fs/notify/inotify/inotify_user.c:601 [inline] inotify_update_watch fs/notify/inotify/inotify_user.c:628 [inline] __do_sys_inotify_add_watch fs/notify/inotify/inotify_user.c:785 [inline] __se_sys_inotify_add_watch+0x901/0xc20 fs/notify/inotify/inotify_user.c:709 __x64_sys_inotify_add_watch+0x7b/0x90 fs/notify/inotify/inotify_user.c:709 x64_sys_call+0x6aa/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:255 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1472 [inline] free_pcp_prepare mm/page_alloc.c:1544 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3534 free_unref_page+0xe8/0x750 mm/page_alloc.c:3616 free_the_page mm/page_alloc.c:805 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5855 __vunmap+0x7bc/0x8f0 mm/vmalloc.c:2652 __vfree mm/vmalloc.c:2700 [inline] vfree+0x7f/0xb0 mm/vmalloc.c:2731 kvfree+0x26/0x40 mm/util.c:662 translate_table+0x1020/0x21e0 net/ipv4/netfilter/arp_tables.c:595 do_replace net/ipv4/netfilter/arp_tables.c:984 [inline] do_arpt_set_ctl+0xfbd/0x15c0 net/ipv4/netfilter/arp_tables.c:1428 nf_setsockopt+0x274/0x2a0 net/netfilter/nf_sockopt.c:101 ip_setsockopt+0x2ae7/0x4730 net/ipv4/ip_sockglue.c:1442 tcp_setsockopt+0x22d/0x3800 net/ipv4/tcp.c:3706 sock_common_setsockopt+0xa2/0xc0 net/core/sock.c:3459 __sys_setsockopt+0x4dc/0x840 net/socket.c:2198 __do_sys_setsockopt net/socket.c:2209 [inline] __se_sys_setsockopt net/socket.c:2206 [inline] __x64_sys_setsockopt+0xbf/0xd0 net/socket.c:2206 x64_sys_call+0x1a2/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:55 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 Memory state around the buggy address: ffff88812a3ed800: fc fc fb fb fb fb fc fc fb fb fb fb fc fc fb fb ffff88812a3ed880: fb fb fc fc fb fb fb fb fc fc fb fb fb fb fc fc >ffff88812a3ed900: fb fb fb fb fc fc fb fb fb fb fc fc fb fb fb fb ^ ffff88812a3ed980: fc fc fa fb fb fb fc fc fb fb fb fb fc fc fb fb ffff88812a3eda00: fb fb fc fc fb fb fb fb fc fc fb fb fb fb fc fc ==================================================================