loop0: detected capacity change from 0 to 2048 EXT4-fs: Ignoring removed mblk_io_submit option EXT4-fs: Ignoring removed i_version option EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: writeback. loop0: detected capacity change from 2048 to 64 syz.0.0 (5334): drop_caches: 2 overlay: ./bus is not a directory ================================================================== BUG: KASAN: use-after-free in ext4_xattr_list_entries+0x302/0x3d0 fs/ext4/xattr.c:724 Read of size 4 at addr ffff88801141702c by task syz.0.0/5334 CPU: 0 UID: 0 PID: 5334 Comm: syz.0.0 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_xattr_list_entries+0x302/0x3d0 fs/ext4/xattr.c:724 ext4_xattr_ibody_list fs/ext4/xattr.c:793 [inline] ext4_listxattr+0x1f9/0x630 fs/ext4/xattr.c:818 vfs_listxattr fs/xattr.c:493 [inline] listxattr+0x10f/0x2a0 fs/xattr.c:924 filename_listxattr fs/xattr.c:958 [inline] path_listxattrat+0x179/0x3a0 fs/xattr.c:988 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:0x7ff54ef8eec9 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:00007ff54fe41038 EFLAGS: 00000246 ORIG_RAX: 00000000000000c3 RAX: ffffffffffffffda RBX: 00007ff54f1e5fa0 RCX: 00007ff54ef8eec9 RDX: 000000000000004b RSI: 0000200000000340 RDI: 0000200000000500 RBP: 00007ff54f011f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ff54f1e6038 R14: 00007ff54f1e5fa0 R15: 00007fffab724fb8 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11417 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f0(buddy) raw: 00fff00000000000 ffff88802fffbd10 ffffea00008c09c8 0000000000000000 raw: 0000000000000000 0000000000000000 00000000f0000000 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 4703, tgid 4703 (kworker/u4:1), ts 25938159967, free_ts 26713364259 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5183 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:3030 [inline] allocate_slab+0x96/0x3a0 mm/slub.c:3203 new_slab mm/slub.c:3257 [inline] ___slab_alloc+0xe94/0x1920 mm/slub.c:4627 __slab_alloc+0x65/0x100 mm/slub.c:4746 __slab_alloc_node mm/slub.c:4822 [inline] slab_alloc_node mm/slub.c:5233 [inline] __do_kmalloc_node mm/slub.c:5602 [inline] __kmalloc_noprof+0x471/0x7f0 mm/slub.c:5615 kmalloc_noprof include/linux/slab.h:961 [inline] tomoyo_realpath_from_path+0xe3/0x5d0 security/tomoyo/realpath.c:251 tomoyo_init_log+0x10b0/0x1f70 security/tomoyo/audit.c:263 tomoyo_supervisor+0x340/0x1480 security/tomoyo/common.c:2198 tomoyo_audit_env_log security/tomoyo/environ.c:36 [inline] tomoyo_env_perm+0x149/0x1e0 security/tomoyo/environ.c:63 tomoyo_environ security/tomoyo/domain.c:672 [inline] tomoyo_find_next_domain+0x15cf/0x1aa0 security/tomoyo/domain.c:888 tomoyo_bprm_check_security+0x11c/0x180 security/tomoyo/tomoyo.c:102 security_bprm_check+0x89/0x270 security/security.c:1341 search_binary_handler fs/exec.c:1660 [inline] exec_binprm fs/exec.c:1702 [inline] bprm_execve+0x8ee/0x1450 fs/exec.c:1754 page last free pid 4731 tgid 4731 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2906 __slab_free+0x2e7/0x390 mm/slub.c:5923 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:352 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4946 [inline] slab_alloc_node mm/slub.c:5245 [inline] __do_kmalloc_node mm/slub.c:5602 [inline] __kmalloc_noprof+0x3c3/0x7f0 mm/slub.c:5615 kmalloc_noprof include/linux/slab.h:961 [inline] tomoyo_add_entry security/tomoyo/common.c:2132 [inline] tomoyo_supervisor+0xbd5/0x1480 security/tomoyo/common.c:2204 tomoyo_audit_env_log security/tomoyo/environ.c:36 [inline] tomoyo_env_perm+0x149/0x1e0 security/tomoyo/environ.c:63 tomoyo_environ security/tomoyo/domain.c:672 [inline] tomoyo_find_next_domain+0x15cf/0x1aa0 security/tomoyo/domain.c:888 tomoyo_bprm_check_security+0x11c/0x180 security/tomoyo/tomoyo.c:102 security_bprm_check+0x89/0x270 security/security.c:1341 search_binary_handler fs/exec.c:1660 [inline] exec_binprm fs/exec.c:1702 [inline] bprm_execve+0x8ee/0x1450 fs/exec.c:1754 do_execveat_common+0x510/0x6a0 fs/exec.c:1860 do_execve fs/exec.c:1934 [inline] __do_sys_execve fs/exec.c:2010 [inline] __se_sys_execve fs/exec.c:2005 [inline] __x64_sys_execve+0x94/0xb0 fs/exec.c:2005 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 Memory state around the buggy address: ffff888011416f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888011416f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888011417000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888011417080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888011417100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================