================================================================== BUG: KFENCE: use-after-free read in drop_metapage fs/jfs/jfs_metapage.c:229 [inline] BUG: KFENCE: use-after-free read in release_metapage+0x64b/0x960 fs/jfs/jfs_metapage.c:784 Use-after-free read at 0xffff88805f12ef70 (in kfence-#150): drop_metapage fs/jfs/jfs_metapage.c:229 [inline] release_metapage+0x64b/0x960 fs/jfs/jfs_metapage.c:784 write_metapage fs/jfs/jfs_metapage.h:75 [inline] flush_metapage fs/jfs/jfs_metapage.h:81 [inline] ea_write+0x6a3/0xe60 fs/jfs/xattr.c:280 ea_put fs/jfs/xattr.c:612 [inline] __jfs_setxattr+0xa39/0x1190 fs/jfs/xattr.c:785 __jfs_xattr_set+0xf9/0x180 fs/jfs/xattr.c:934 __vfs_setxattr+0x468/0x4a0 fs/xattr.c:200 __vfs_setxattr_noperm+0x12e/0x660 fs/xattr.c:234 vfs_setxattr+0x221/0x430 fs/xattr.c:321 do_setxattr fs/xattr.c:629 [inline] __do_sys_fsetxattr fs/xattr.c:710 [inline] __se_sys_fsetxattr+0x383/0x480 fs/xattr.c:686 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f kfence-#150: 0xffff88805f12ef48-0xffff88805f12efff, size=184, cache=jfs_mp allocated by task 5107 on cpu 0 at 82.351419s: mempool_alloc_noprof+0x197/0x5a0 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:182 [inline] __get_metapage+0x4ed/0xef0 fs/jfs/jfs_metapage.c:652 ea_write+0x637/0xe60 fs/jfs/xattr.c:256 ea_put fs/jfs/xattr.c:612 [inline] __jfs_setxattr+0xa39/0x1190 fs/jfs/xattr.c:785 __jfs_xattr_set+0xf9/0x180 fs/jfs/xattr.c:934 __vfs_setxattr+0x468/0x4a0 fs/xattr.c:200 __vfs_setxattr_noperm+0x12e/0x660 fs/xattr.c:234 vfs_setxattr+0x221/0x430 fs/xattr.c:321 do_setxattr fs/xattr.c:629 [inline] __do_sys_fsetxattr fs/xattr.c:710 [inline] __se_sys_fsetxattr+0x383/0x480 fs/xattr.c:686 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f freed by task 74 on cpu 0 at 82.352114s: free_metapage fs/jfs/jfs_metapage.c:197 [inline] metapage_release_folio+0x412/0x540 fs/jfs/jfs_metapage.c:552 shrink_folio_list+0x26c2/0x8c90 mm/vmscan.c:1413 evict_folios+0x54c7/0x7b60 mm/vmscan.c:4580 try_to_shrink_lruvec+0x9ab/0xbb0 mm/vmscan.c:4775 shrink_one+0x3b9/0x850 mm/vmscan.c:4813 shrink_many mm/vmscan.c:4876 [inline] lru_gen_shrink_node mm/vmscan.c:4954 [inline] shrink_node+0x3799/0x3de0 mm/vmscan.c:5934 kswapd_shrink_node mm/vmscan.c:6762 [inline] balance_pgdat mm/vmscan.c:6954 [inline] kswapd+0x1bcd/0x35a0 mm/vmscan.c:7223 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 CPU: 0 UID: 0 PID: 5107 Comm: syz.0.0 Not tainted 6.11.0-rc4-syzkaller-00002-gb0da640826ba #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 RIP: 0010:drop_metapage fs/jfs/jfs_metapage.c:229 [inline] RIP: 0010:release_metapage+0x64b/0x960 fs/jfs/jfs_metapage.c:784 Code: 89 2b 48 bd 00 00 00 00 00 fc ff df 48 8b 7c 24 40 48 8b 74 24 48 e8 74 24 99 08 41 80 3c 2e 00 74 08 4c 89 ef e8 05 2c d3 fe <49> 8b 5d 00 31 ff 48 89 de e8 07 ef 6b fe 48 85 db 74 0a e8 1d ea RSP: 0018:ffffc90002f6f690 EFLAGS: 00010246 RAX: ffffffff832786a4 RBX: ffff88805f12ef68 RCX: ffff88801ca68000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: dffffc0000000000 R08: ffffffff83278687 R09: 1ffffd40000c57d8 R10: dffffc0000000000 R11: fffff940000c57d9 R12: ffff88805f12ef48 R13: ffff88805f12ef70 R14: 1ffff1100be25dee R15: ffff88805f12ef68 FS: 00007fee20c096c0(0000) GS:ffff888020800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff88805f12ef70 CR3: 0000000036696000 CR4: 0000000000350ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: write_metapage fs/jfs/jfs_metapage.h:75 [inline] flush_metapage fs/jfs/jfs_metapage.h:81 [inline] ea_write+0x6a3/0xe60 fs/jfs/xattr.c:280 ea_put fs/jfs/xattr.c:612 [inline] __jfs_setxattr+0xa39/0x1190 fs/jfs/xattr.c:785 __jfs_xattr_set+0xf9/0x180 fs/jfs/xattr.c:934 __vfs_setxattr+0x468/0x4a0 fs/xattr.c:200 __vfs_setxattr_noperm+0x12e/0x660 fs/xattr.c:234 vfs_setxattr+0x221/0x430 fs/xattr.c:321 do_setxattr fs/xattr.c:629 [inline] __do_sys_fsetxattr fs/xattr.c:710 [inline] __se_sys_fsetxattr+0x383/0x480 fs/xattr.c:686 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fee1fd79e79 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:00007fee20c09038 EFLAGS: 00000246 ORIG_RAX: 00000000000000be RAX: ffffffffffffffda RBX: 00007fee1ff15f80 RCX: 00007fee1fd79e79 RDX: 0000000020000080 RSI: 0000000020000040 RDI: 0000000000000007 RBP: 00007fee1fde7916 R08: 0000000000000001 R09: 0000000000000000 R10: 000000000000fffe R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fee1ff15f80 R15: 00007ffe00aff1a8 ================================================================== ---------------- Code disassembly (best guess): 0: 89 2b mov %ebp,(%rbx) 2: 48 bd 00 00 00 00 00 movabs $0xdffffc0000000000,%rbp 9: fc ff df c: 48 8b 7c 24 40 mov 0x40(%rsp),%rdi 11: 48 8b 74 24 48 mov 0x48(%rsp),%rsi 16: e8 74 24 99 08 call 0x899248f 1b: 41 80 3c 2e 00 cmpb $0x0,(%r14,%rbp,1) 20: 74 08 je 0x2a 22: 4c 89 ef mov %r13,%rdi 25: e8 05 2c d3 fe call 0xfed32c2f * 2a: 49 8b 5d 00 mov 0x0(%r13),%rbx <-- trapping instruction 2e: 31 ff xor %edi,%edi 30: 48 89 de mov %rbx,%rsi 33: e8 07 ef 6b fe call 0xfe6bef3f 38: 48 85 db test %rbx,%rbx 3b: 74 0a je 0x47 3d: e8 .byte 0xe8 3e: 1d .byte 0x1d 3f: ea (bad)