loop1: detected capacity change from 0 to 32768 ================================================================== BUG: KASAN: slab-use-after-free in drop_metapage fs/jfs/jfs_metapage.c:223 [inline] BUG: KASAN: slab-use-after-free in release_metapage+0xcde/0xdc0 fs/jfs/jfs_metapage.c:786 Read of size 8 at addr ffff88804fb44bc8 by task syz-executor.1/5404 CPU: 1 PID: 5404 Comm: syz-executor.1 Not tainted 6.8.0-syzkaller-01185-g855684c7d938 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 drop_metapage fs/jfs/jfs_metapage.c:223 [inline] release_metapage+0xcde/0xdc0 fs/jfs/jfs_metapage.c:786 write_metapage fs/jfs/jfs_metapage.h:75 [inline] flush_metapage fs/jfs/jfs_metapage.h:81 [inline] ea_put fs/jfs/xattr.c:614 [inline] __jfs_setxattr+0xc73/0xfb0 fs/jfs/xattr.c:783 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:917 __vfs_setxattr+0x173/0x1e0 fs/xattr.c:201 __vfs_setxattr_noperm+0x127/0x5e0 fs/xattr.c:235 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:296 vfs_setxattr+0x146/0x350 fs/xattr.c:322 do_setxattr+0x146/0x170 fs/xattr.c:630 setxattr+0x15d/0x180 fs/xattr.c:653 path_setxattr+0x179/0x1e0 fs/xattr.c:672 __do_sys_setxattr fs/xattr.c:688 [inline] __se_sys_setxattr fs/xattr.c:684 [inline] __ia32_sys_setxattr+0xc0/0x160 fs/xattr.c:684 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x7a/0x120 arch/x86/entry/common.c:321 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x7a/0x84 RIP: 0023:0xf725f579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f5e595ac EFLAGS: 00000292 ORIG_RAX: 00000000000000e2 RAX: ffffffffffffffda RBX: 0000000020000000 RCX: 00000000200000c0 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 5404: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3813 [inline] slab_alloc_node mm/slub.c:3860 [inline] kmem_cache_alloc+0x136/0x320 mm/slub.c:3867 mempool_alloc+0x176/0x390 mm/mempool.c:408 alloc_metapage fs/jfs/jfs_metapage.c:176 [inline] __get_metapage+0x5f2/0x1170 fs/jfs/jfs_metapage.c:651 ea_get+0xda4/0x12c0 fs/jfs/xattr.c:526 __jfs_setxattr+0x1ed/0xfb0 fs/jfs/xattr.c:718 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:917 __vfs_setxattr+0x173/0x1e0 fs/xattr.c:201 __vfs_setxattr_noperm+0x127/0x5e0 fs/xattr.c:235 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:296 vfs_setxattr+0x146/0x350 fs/xattr.c:322 do_setxattr+0x146/0x170 fs/xattr.c:630 setxattr+0x15d/0x180 fs/xattr.c:653 path_setxattr+0x179/0x1e0 fs/xattr.c:672 __do_sys_setxattr fs/xattr.c:688 [inline] __se_sys_setxattr fs/xattr.c:684 [inline] __ia32_sys_setxattr+0xc0/0x160 fs/xattr.c:684 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x7a/0x120 arch/x86/entry/common.c:321 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x7a/0x84 Freed by task 111: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:589 poison_slab_object mm/kasan/common.c:240 [inline] __kasan_slab_free+0x11d/0x1a0 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2121 [inline] slab_free mm/slub.c:4299 [inline] kmem_cache_free+0x12e/0x360 mm/slub.c:4363 mempool_free+0xe7/0x3b0 mm/mempool.c:554 free_metapage fs/jfs/jfs_metapage.c:191 [inline] metapage_release_folio+0x2d2/0x4e0 fs/jfs/jfs_metapage.c:551 filemap_release_folio+0x1f1/0x280 mm/filemap.c:4079 shrink_folio_list+0x2931/0x3ea0 mm/vmscan.c:1369 evict_folios+0x6e6/0x1ba0 mm/vmscan.c:4521 try_to_shrink_lruvec+0x638/0xa10 mm/vmscan.c:4726 shrink_one+0x3f8/0x7b0 mm/vmscan.c:4765 shrink_many mm/vmscan.c:4828 [inline] lru_gen_shrink_node mm/vmscan.c:4929 [inline] shrink_node+0x2191/0x3770 mm/vmscan.c:5888 kswapd_shrink_node mm/vmscan.c:6696 [inline] balance_pgdat+0x9d0/0x1a90 mm/vmscan.c:6886 kswapd+0x5c1/0xc10 mm/vmscan.c:7146 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 The buggy address belongs to the object at ffff88804fb44ba0 which belongs to the cache jfs_mp of size 184 The buggy address is located 40 bytes inside of freed 184-byte region [ffff88804fb44ba0, ffff88804fb44c58) The buggy address belongs to the physical page: page:ffffea00013ed100 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4fb44 flags: 0x4fff00000000800(slab|node=1|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 04fff00000000800 ffff88801ab3a500 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080100010 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 0x92800(GFP_NOWAIT|__GFP_NORETRY|__GFP_NOMEMALLOC), pid 5404, tgid 5403 (syz-executor.1), ts 135070317214, free_ts 133295290553 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1533 prep_new_page mm/page_alloc.c:1540 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3311 __alloc_pages_slowpath mm/page_alloc.c:4102 [inline] __alloc_pages+0x687/0x2410 mm/page_alloc.c:4582 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2190 [inline] allocate_slab mm/slub.c:2354 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2407 ___slab_alloc+0x4ac/0x1770 mm/slub.c:3540 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3625 __slab_alloc_node mm/slub.c:3678 [inline] slab_alloc_node mm/slub.c:3850 [inline] kmem_cache_alloc+0x2ed/0x320 mm/slub.c:3867 mempool_alloc+0x176/0x390 mm/mempool.c:408 alloc_metapage fs/jfs/jfs_metapage.c:176 [inline] __get_metapage+0x5f2/0x1170 fs/jfs/jfs_metapage.c:651 diMount+0xe6/0x8d0 fs/jfs/jfs_imap.c:111 jfs_mount+0x171/0x8a0 fs/jfs/jfs_mount.c:100 jfs_fill_super+0x5a3/0xd20 fs/jfs/super.c:556 mount_bdev+0x1e3/0x2d0 fs/super.c:1658 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1779 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x6e1/0x1f10 fs/namespace.c:3679 page last free pid 5357 tgid 5356 stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1140 [inline] free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2346 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2486 vfree+0x181/0x7a0 mm/vmalloc.c:2842 snd_dma_free_pages+0x51/0x70 sound/core/memalloc.c:126 do_free_pages sound/core/pcm_memory.c:93 [inline] do_free_pages sound/core/pcm_memory.c:88 [inline] snd_pcm_lib_free_pages+0x172/0x390 sound/core/pcm_memory.c:499 do_hw_free sound/core/pcm_native.c:898 [inline] snd_pcm_release_substream.part.0+0x2a8/0x340 sound/core/pcm_native.c:2765 snd_pcm_release_substream+0x5b/0x70 sound/core/pcm_native.c:2759 snd_pcm_oss_release_file sound/core/oss/pcm_oss.c:2413 [inline] snd_pcm_oss_release_file sound/core/oss/pcm_oss.c:2405 [inline] snd_pcm_oss_release+0x175/0x320 sound/core/oss/pcm_oss.c:2592 __fput+0x270/0xb80 fs/file_table.c:423 task_work_run+0x14e/0x250 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:108 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:201 [inline] syscall_exit_to_user_mode+0x275/0x2a0 kernel/entry/common.c:212 __do_fast_syscall_32+0x8a/0x120 arch/x86/entry/common.c:324 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x7a/0x84 Memory state around the buggy address: ffff88804fb44a80: fc fc fc fc fc 00 00 00 00 00 00 00 00 00 00 00 ffff88804fb44b00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc >ffff88804fb44b80: fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb ^ ffff88804fb44c00: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc ffff88804fb44c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi