EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: writeback. fscrypt: AES-256-CBC-CTS using implementation "cts-cbc-aes-aesni" loop0: detected capacity change from 1024 to 767 ================================================================== BUG: KASAN: use-after-free in ext4_search_dir+0xf1/0x1b0 fs/ext4/namei.c:1469 Read of size 1 at addr ffff8880461b6416 by task syz.0.17/5477 CPU: 0 UID: 0 PID: 5477 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) 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_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 ext4_search_dir+0xf1/0x1b0 fs/ext4/namei.c:1469 ext4_find_inline_entry+0x492/0x5f0 fs/ext4/inline.c:1621 __ext4_find_entry+0x2fd/0x1f20 fs/ext4/namei.c:1542 ext4_lookup_entry fs/ext4/namei.c:1703 [inline] ext4_lookup+0x13d/0x6c0 fs/ext4/namei.c:1771 lookup_open fs/namei.c:3774 [inline] open_last_lookups fs/namei.c:3895 [inline] path_openat+0x1101/0x3830 fs/namei.c:4131 do_filp_open+0x1fa/0x410 fs/namei.c:4161 do_sys_openat2+0x121/0x1c0 fs/open.c:1435 do_sys_open fs/open.c:1450 [inline] __do_sys_creat fs/open.c:1528 [inline] __se_sys_creat fs/open.c:1522 [inline] __x64_sys_creat+0x8f/0xc0 fs/open.c:1522 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f7a4b58eec9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffdc1eedf58 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007f7a4b7e5fa0 RCX: 00007f7a4b58eec9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000200000000100 RBP: 00007f7a4b611f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f7a4b7e5fa0 R14: 00007f7a4b7e5fa0 R15: 0000000000000002 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x461b6 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000000000 0000000000000000 dead000000000122 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 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5434, tgid 5434 (syz-executor), ts 95394771104, free_ts 96675999104 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:2492 [inline] allocate_slab+0x8a/0x370 mm/slub.c:2660 new_slab mm/slub.c:2714 [inline] ___slab_alloc+0xbeb/0x1420 mm/slub.c:3901 __slab_alloc mm/slub.c:3992 [inline] __slab_alloc_node mm/slub.c:4067 [inline] slab_alloc_node mm/slub.c:4228 [inline] __do_kmalloc_node mm/slub.c:4375 [inline] __kmalloc_noprof+0x305/0x4f0 mm/slub.c:4388 kmalloc_noprof include/linux/slab.h:909 [inline] tomoyo_realpath_from_path+0xe3/0x5d0 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x213/0x4b0 security/tomoyo/file.c:822 security_inode_getattr+0x12f/0x330 security/security.c:2416 vfs_getattr fs/stat.c:259 [inline] vfs_statx_path fs/stat.c:299 [inline] vfs_statx+0x18e/0x550 fs/stat.c:356 vfs_fstatat+0x118/0x170 fs/stat.c:375 __do_sys_newfstatat fs/stat.c:542 [inline] __se_sys_newfstatat fs/stat.c:536 [inline] __x64_sys_newfstatat+0x116/0x190 fs/stat.c:536 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 13 tgid 13 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2895 discard_slab mm/slub.c:2758 [inline] __put_partials+0x156/0x1a0 mm/slub.c:3223 put_cpu_partial+0x17c/0x250 mm/slub.c:3298 __slab_free+0x2d5/0x3c0 mm/slub.c:4565 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x97/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:340 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4191 [inline] slab_alloc_node mm/slub.c:4240 [inline] kmem_cache_alloc_node_noprof+0x1bb/0x3c0 mm/slub.c:4292 __alloc_skb+0x112/0x2d0 net/core/skbuff.c:659 alloc_skb include/linux/skbuff.h:1336 [inline] nlmsg_new include/net/netlink.h:1055 [inline] rtmsg_fib+0xea/0x4c0 net/ipv4/fib_semantics.c:552 fib_table_delete+0xca9/0xf80 net/ipv4/fib_trie.c:1740 fib_magic+0x2e4/0x390 net/ipv4/fib_frontend.c:1135 fib_del_ifaddr+0x1082/0x1480 net/ipv4/fib_frontend.c:1346 fib_inetaddr_event+0xbb/0x190 net/ipv4/fib_frontend.c:1477 notifier_call_chain+0x1b6/0x3e0 kernel/notifier.c:85 blocking_notifier_call_chain+0x6a/0x90 kernel/notifier.c:380 Memory state around the buggy address: ffff8880461b6300: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880461b6380: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8880461b6400: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8880461b6480: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880461b6500: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================