R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007f88df226038 R14: 00007f88df225fa0 R15: 00007fff5fcf6528 ================================================================== BUG: KASAN: use-after-free in jffs2_xattr_delete_inode+0x112/0x130 fs/jffs2/xattr.c:602 Read of size 4 at addr ffff88805f043e28 by task syz.6.2147/13423 CPU: 1 UID: 0 PID: 13423 Comm: syz.6.2147 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report+0xdf/0x1c0 mm/kasan/report.c:595 jffs2_xattr_delete_inode+0x112/0x130 fs/jffs2/xattr.c:602 jffs2_do_clear_inode+0x50/0x470 fs/jffs2/readinode.c:1418 evict+0x3c2/0xad0 fs/inode.c:822 iput_final fs/inode.c:2014 [inline] iput.part.0+0x989/0x1050 fs/inode.c:2063 iput+0x35/0x40 fs/inode.c:2029 jffs2_new_inode+0xaa3/0xcf0 fs/jffs2/fs.c:470 jffs2_create+0x94/0x390 fs/jffs2/dir.c:182 lookup_open+0x1255/0x1990 fs/namei.c:4596 open_last_lookups fs/namei.c:4796 [inline] path_openat+0xa2c/0x2440 fs/namei.c:5026 do_file_open+0x20e/0x430 fs/namei.c:5058 do_sys_openat2+0x10f/0x1e0 fs/open.c:1417 do_sys_open fs/open.c:1423 [inline] __do_sys_creat fs/open.c:1501 [inline] __se_sys_creat fs/open.c:1495 [inline] __x64_sys_creat+0xcc/0x120 fs/open.c:1495 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f88def9e559 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f88dfecf028 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007f88df225fa0 RCX: 00007f88def9e559 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000200000000a40 RBP: 00007f88dfecf090 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007f88df226038 R14: 00007f88df225fa0 R15: 00007fff5fcf6528 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88805f0434c0 pfn:0x5f043 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f0(buddy) raw: 00fff00000000000 ffffea00010b66c8 ffffea000178d148 0000000000000000 raw: ffff88805f0434c0 0000000000000000 00000000f0000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x440dc0(GFP_KERNEL_ACCOUNT|__GFP_ZERO|__GFP_COMP), pid 13415, tgid 13415 (syz.5.2146), ts 274272103330 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1871 prep_new_page mm/page_alloc.c:1879 [inline] get_page_from_freelist+0x110d/0x35d0 mm/page_alloc.c:3943 __alloc_frozen_pages_noprof+0x2eb/0x3300 mm/page_alloc.c:5436 alloc_pages_mpol+0x201/0x550 mm/mempolicy.c:2486 alloc_pages_noprof+0x1a/0x160 mm/mempolicy.c:2577 pagetable_alloc_noprof include/linux/mm.h:3794 [inline] __pud_alloc_one_noprof include/asm-generic/pgalloc.h:181 [inline] pud_alloc_one_noprof include/asm-generic/pgalloc.h:206 [inline] __pud_alloc+0x3b/0x690 mm/memory.c:6938 pud_alloc include/linux/mm.h:3704 [inline] __handle_mm_fault+0x1078/0x2f60 mm/memory.c:6626 handle_mm_fault+0x363/0xa20 mm/memory.c:6876 do_user_addr_fault+0x59c/0x12f0 arch/x86/mm/fault.c:1343 handle_page_fault arch/x86/mm/fault.c:1483 [inline] exc_page_fault+0x6f/0xd0 arch/x86/mm/fault.c:1536 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:595 page last free pid 29 tgid 29 ts 274380755391 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1418 [inline] __free_frozen_pages+0x79f/0x10f0 mm/page_alloc.c:2962 __pagetable_free include/linux/mm.h:3804 [inline] pagetable_free include/linux/mm.h:3828 [inline] pagetable_dtor_free include/linux/mm.h:3927 [inline] __tlb_remove_table include/asm-generic/tlb.h:221 [inline] __tlb_remove_table_free mm/mmu_gather.c:228 [inline] tlb_remove_table_rcu+0x2cf/0x380 mm/mmu_gather.c:291 rcu_do_batch kernel/rcu/tree.c:2650 [inline] rcu_core+0x5f0/0x1260 kernel/rcu/tree.c:2919 handle_softirqs+0x1e6/0x9d0 kernel/softirq.c:645 run_ksoftirqd kernel/softirq.c:1099 [inline] run_ksoftirqd+0x38/0x60 kernel/softirq.c:1091 smpboot_thread_fn+0x3d3/0xab0 kernel/smpboot.c:160 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff88805f043d00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805f043d80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88805f043e00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88805f043e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805f043f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================